Skip to content

Commit a2b2d4b

Browse files
Jacob Xubonzini
authored andcommitted
kvm: svm: de-allocate svm_cpu_data for all cpus in svm_cpu_uninit()
The cpu arg for svm_cpu_uninit() was previously ignored resulting in the per cpu structure svm_cpu_data not being de-allocated for all cpus. Signed-off-by: Jacob Xu <jacobhxu@google.com> Message-Id: <20201203205939.1783969-1-jacobhxu@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 0c55f86 commit a2b2d4b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/x86/kvm/svm/svm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,12 +530,12 @@ static int svm_hardware_enable(void)
530530

531531
static void svm_cpu_uninit(int cpu)
532532
{
533-
struct svm_cpu_data *sd = per_cpu(svm_data, raw_smp_processor_id());
533+
struct svm_cpu_data *sd = per_cpu(svm_data, cpu);
534534

535535
if (!sd)
536536
return;
537537

538-
per_cpu(svm_data, raw_smp_processor_id()) = NULL;
538+
per_cpu(svm_data, cpu) = NULL;
539539
kfree(sd->sev_vmcbs);
540540
__free_page(sd->save_area);
541541
kfree(sd);

0 commit comments

Comments
 (0)