Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Nov 2022 21:00:52 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 4d447b30f7be - main - vmm: do not leak halted_cpus bit after suspension
Message-ID:  <202211012100.2A1L0quS064932@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=4d447b30f7be761b0c2877513e79f484511a00a5

commit 4d447b30f7be761b0c2877513e79f484511a00a5
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-10-31 23:30:55 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-11-01 18:44:42 +0000

    vmm: do not leak halted_cpus bit after suspension
    
    Reported by:    bz
    PR:     267468
    Reviewed by:    markj
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D37227
---
 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 8daf2ae29737..dc6e03303b44 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_ast_pending(td, TDA_SUSPEND)) {
 			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);
 		}
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202211012100.2A1L0quS064932>