Skip to content

Commit

Permalink
kvm: svm: de-allocate svm_cpu_data for all cpus in svm_cpu_uninit()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jacob Xu authored and Paolo Bonzini committed Dec 4, 2020
1 parent 0c55f86 commit a2b2d4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kvm/svm/svm.c
Original file line number Diff line number Diff line change
@@ -530,12 +530,12 @@ static int svm_hardware_enable(void)

static void svm_cpu_uninit(int cpu)
{
struct svm_cpu_data *sd = per_cpu(svm_data, raw_smp_processor_id());
struct svm_cpu_data *sd = per_cpu(svm_data, cpu);

if (!sd)
return;

per_cpu(svm_data, raw_smp_processor_id()) = NULL;
per_cpu(svm_data, cpu) = NULL;
kfree(sd->sev_vmcbs);
__free_page(sd->save_area);
kfree(sd);

0 comments on commit a2b2d4b

Please sign in to comment.