aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2022-10-31 23:30:55 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2022-11-08 22:08:25 +0000
commit5aab578e3efe209f280d163e4370ce018fc8d619 (patch)
treeef8d45eb0c49d8acc8fb1fea3572537a5d54b897
parentfc929a14ccd84e6608c830ffe5563eb9e4a5bb10 (diff)
downloadsrc-5aab578e3efe209f280d163e4370ce018fc8d619.tar.gz
src-5aab578e3efe209f280d163e4370ce018fc8d619.zip
vmm: do not leak halted_cpus bit after suspension
PR: 267468 (cherry picked from commit 4d447b30f7be761b0c2877513e79f484511a00a5)
-rw-r--r--sys/amd64/vmm/vmm.c7
1 files changed, 6 insertions, 1 deletions
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);
}
}