diff options
| author | Yosry Ahmed <yosry.ahmed@linux.dev> | 2025-04-29 08:32:15 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-06-27 11:07:30 +0100 |
| commit | fe9a6eab516990611cd85b963ef3d2d71c6802d6 (patch) | |
| tree | 4c4162712479474c574260909b25207946842da0 /arch | |
| parent | de3a9f01087773978b83e4e3de2db37c429e4b4a (diff) | |
| download | linux-fe9a6eab516990611cd85b963ef3d2d71c6802d6.tar.gz linux-fe9a6eab516990611cd85b963ef3d2d71c6802d6.tar.bz2 linux-fe9a6eab516990611cd85b963ef3d2d71c6802d6.zip | |
KVM: SVM: Clear current_vmcb during vCPU free for all *possible* CPUs
commit 1bee4838eb3a2c689f23c7170ea66ae87ea7d93a upstream.
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/20250320013759.3965869-1-yosry.ahmed@linux.dev
Fixes: fd65d3142f73 ("kvm: svm: Ensure an IBPB on all affected CPUs when freeing a vmcb")
Cc: stable@vger.kernel.org
Cc: Jim Mattson <jmattson@google.com>
Signed-off-by: Yosry Ahmed <yosry.ahmed@linux.dev>
[sean: split to separate patch, write changelog]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/x86/kvm/svm/svm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 920e4a3583ab..b6bbd0dc4e65 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -1426,7 +1426,7 @@ static void svm_clear_current_vmcb(struct vmcb *vmcb) { int i; - for_each_online_cpu(i) + for_each_possible_cpu(i) cmpxchg(per_cpu_ptr(&svm_data.current_vmcb, i), vmcb, NULL); } |
