Skip to content

Commit 1bee483

Browse files
yosrym93sean-jc
authored andcommitted
KVM: SVM: Clear current_vmcb during vCPU free for all *possible* CPUs
When freeing a vCPU and thus its VMCB, clear current_vmcb for all possible CPUs, not just online CPUs, as it's theoretically possible a CPU could go offline and come back online in conjunction with KVM reusing the page for a new VMCB. Link: https://lore.kernel.org/all/[email protected] Fixes: fd65d31 ("kvm: svm: Ensure an IBPB on all affected CPUs when freeing a vmcb") Cc: [email protected] Cc: Jim Mattson <[email protected]> Signed-off-by: Yosry Ahmed <[email protected]> [sean: split to separate patch, write changelog] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 459074c commit 1bee483

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/svm/svm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ static void svm_clear_current_vmcb(struct vmcb *vmcb)
14961496
{
14971497
int i;
14981498

1499-
for_each_online_cpu(i)
1499+
for_each_possible_cpu(i)
15001500
cmpxchg(per_cpu_ptr(&svm_data.current_vmcb, i), vmcb, NULL);
15011501
}
15021502

0 commit comments

Comments
 (0)