From nobody Tue Nov 08 22:08:56 2022 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 4N6Mgs0c5zz4bYZk; Tue, 8 Nov 2022 22:08:57 +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 4N6Mgs03ZHz3Nh8; Tue, 8 Nov 2022 22:08:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667945337; 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=1ZMQDlkpPukCrMFe44mqMVm8ZUN2ka0u7DNyo5Ki5+g=; b=Ski5zj8LlCNMiZJ4M5h3Kos2RKY3Uqp42kf4DjRRObEOAt+2CBnwFY6T2w/OuH6mEaXY09 iPB7HaLCHn3ggaGyDgaxtUX/eF4HZK0wmdPF8CJCXsJOniw5rXs1zjgX0yGhmcDKk5QH19 MC8vQ3lA8D7OogBvaQQew+8VQz70qDnGXEsRKOAU0/pfhxnRnZ+RILiRL+QwJrWwwY/eM3 Buj5rmUDVRuP+6WBuA4ozcgrhBixhb7NbiEdtnt93B2ZyUcMCw3PFnz6uaWtDxSM2gTClf h4wVngBVPuNoxgMWwdbZ1RhptZbGZSE52/udBeCoIPIoqKFjHXNhalp+Xqti9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667945337; 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=1ZMQDlkpPukCrMFe44mqMVm8ZUN2ka0u7DNyo5Ki5+g=; b=jP8PE1xojPVKKf3TxWD5H/OkKcTaKyc9cEedJwePLkB9ULJb5n/xT4MHz+bH6OoBA/jxHF Sc9L1H9KaI8I82EuwCHlg2XiEpYGL7GT9f/8hMr2bltxYpP3JrqaquHCUZRZvkJmJNaav0 ofQFsRMl7KM/GxWtdoNyF5P32BI4AKMqGrA9yYv3GFdNDlt/LNJLluAyRF1ACzepyE5VEP iCoCPt0s5KCVpQjXvuMlwFal/8lIqTt0eN1zBzF67AjabxY2j125/m7sboQNs4La1WYXFj IPu+/otWko96n2beZGlXVNiIemabahyPf7ugiEhO8iYTK46F04uvDLIR1N++kQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667945337; a=rsa-sha256; cv=none; b=lm2hB+ILe17bX3AsLGswUTjLdAHn8OJDFBoYeloiaWI/8AyRSjMjZBWui4AUXNf4I0Gdd2 wvUIK+yH+nJW1IRB+4vf1RCG9+O6pAGHEbhGNKjkx3XGDZ1JlS3NE7yC/Z3G3ve0CPJbkU r4m4I6DI0q4xDxDWj0P1USaUJvRWpPwiAzAE8cgM5pE1348wbmgJGwRNXD0PlRgUm7S2ZX nCZNwbmFUPe/D/DW2ROXyyLLyzIaNbgCjztLt8ef9x3+9exphzOFMbCGpFWOMxuBVhrFFx dPCoEi+dvGHSydBW7ZMrDcPBi9Hm/N2ytHZ/d48Eere52pWBdwk0sajXSNH7gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4N6Mgr5xpmzyNj; Tue, 8 Nov 2022 22:08:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2A8M8uFI056483; Tue, 8 Nov 2022 22:08:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A8M8uEu056482; Tue, 8 Nov 2022 22:08:56 GMT (envelope-from git) Date: Tue, 8 Nov 2022 22:08:56 GMT Message-Id: <202211082208.2A8M8uEu056482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 5aab578e3efe - stable/13 - vmm: do not leak halted_cpus bit after suspension 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5aab578e3efe209f280d163e4370ce018fc8d619 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5aab578e3efe209f280d163e4370ce018fc8d619 commit 5aab578e3efe209f280d163e4370ce018fc8d619 Author: Konstantin Belousov AuthorDate: 2022-10-31 23:30:55 +0000 Commit: Konstantin Belousov CommitDate: 2022-11-08 22:08:25 +0000 vmm: do not leak halted_cpus bit after suspension PR: 267468 (cherry picked from commit 4d447b30f7be761b0c2877513e79f484511a00a5) --- sys/amd64/vmm/vmm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index b417a2345bed..fc7ea3d7b4be 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -1424,8 +1424,13 @@ vm_handle_hlt(struct vm *vm, int vcpuid, bool intr_disabled, bool *retu) if ((td->td_flags & TDF_NEEDSUSPCHK) != 0) { vcpu_unlock(vcpu); error = thread_check_susp(td, false); - if (error != 0) + if (error != 0) { + if (vcpu_halted) { + CPU_CLR_ATOMIC(vcpuid, + &vm->halted_cpus); + } return (error); + } vcpu_lock(vcpu); } }