From nobody Wed Jul 12 16:17:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R1NDX6nbyz4nFYn; Wed, 12 Jul 2023 16:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R1NDX6J54z44MF; Wed, 12 Jul 2023 16:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689178636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JmCxOKGBq5DRxaghkg/TFs5rlt4yxlhuWqCZ3wOYUhA=; b=vyirCf3BBiySPPWEUOynSHTxmWAVghXrfteoacBqah5Dgak575fg27ZQjhni6fppYhGkNj XWOVJmvXUABZVNhGfaC4h6/BnuVW4/0GDcH2dD1zWCZ6SCmb2h5VHPGKt7lKvgFfjWTKM/ wTkF4D5qWwe1ddYo2D9GtClXcRuKAEOe5hbUpaMSgh49lMjS/0toNcCmIKtZ4MaLI45+ty DGZoaV/zXwgc5xiPu02TIPm1NjLAnvN9qhWW3ZGpZ9i7ywHnhV30X390y7xGbXj1IK5zKW /LF3UUqHnMK++lbHVI+8BcJvKpkMGX/ScfpIPVmh25Xqt+C58LZT2rd6MNRdOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689178636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JmCxOKGBq5DRxaghkg/TFs5rlt4yxlhuWqCZ3wOYUhA=; b=EjdwvsOGTeoCVUSWBcBXzhIbVY2S2nXHtOyP9PvrkwiQrwdB7f0TMt5RCs7XjBFWbTRI3N 39nu1cuD8+H0DlvzxCkePk54R9O+RrWaSSWRXKeLvqnt3gOHRzOKdJ68jiXVppRtR89Mk/ VCYC6IEXjeV5VKVDFCp6L2ITZIlQO/p7nR4w1Cy9vTG4lLyeMH42Pq5xBVemUVwSRIYw4b 2DfePpQvXEBXTgV1c/n7SvHymX5MOZ5FVJbkR0moePRFey5+GsOaIjeQe4JVjEKnPV1fLE cZr7QqeTHhgab5fs7TpVMZdTdGamYImraVJSppeazpK55xJd8DfBCLR99z7g6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689178636; a=rsa-sha256; cv=none; b=CIW6gP+UVl/qFqGEeRc3kcLkbRS5MYl1P6XyKFwtvYKaiREKybvyA6xqy1CpKgTKDK5zMB qkvjP0JexFHdeGpE0MC7dDYFElk8iWdfpQWenJmTy4TSm37/2wpnPW1nONXeCcRwCbUhwp ZjRuW5a/InMkT/ZLXJvTvzZdn2WG9KqfSfc9GKOLS39Ta67dplob/qq8PjrL5aSRmz7dvh eBmmzcDHaVLNlK6uqYE1+fZDZR8WRFng0TW0QwsaLWW7tYrJjUuNvGRu9EvuR28zs4+hZl HlgZPR2aG6kXuiCqnAL0E6ts+6MdQE7G6lxbOxWRLiV904pt8i9zgPDbldd5Iw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R1NDX5GyKzFxj; Wed, 12 Jul 2023 16:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36CGHGUH010913; Wed, 12 Jul 2023 16:17:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36CGHGaf010912; Wed, 12 Jul 2023 16:17:16 GMT (envelope-from git) Date: Wed, 12 Jul 2023 16:17:16 GMT Message-Id: <202307121617.36CGHGaf010912@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 30f0328a322e - main - vmm: don't return random error from vcpu_lock_all() if vcpu is empty List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 30f0328a322eb17e7b6bf31a8d587a071e9421ed Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=30f0328a322eb17e7b6bf31a8d587a071e9421ed commit 30f0328a322eb17e7b6bf31a8d587a071e9421ed Author: Gleb Smirnoff AuthorDate: 2023-07-12 16:16:40 +0000 Commit: Gleb Smirnoff CommitDate: 2023-07-12 16:16:40 +0000 vmm: don't return random error from vcpu_lock_all() if vcpu is empty When vcpu array is empty, function would return random value from stack. What I observed was -1. Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D40980 --- sys/amd64/vmm/vmm_dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/amd64/vmm/vmm_dev.c b/sys/amd64/vmm/vmm_dev.c index f9fcb32d8e28..74c751d7f116 100644 --- a/sys/amd64/vmm/vmm_dev.c +++ b/sys/amd64/vmm/vmm_dev.c @@ -187,6 +187,7 @@ vcpu_lock_all(struct vmmdev_softc *sc) int error; uint16_t i, j, maxcpus; + error = 0; vm_slock_vcpus(sc->vm); maxcpus = vm_get_maxcpus(sc->vm); for (i = 0; i < maxcpus; i++) {