Skip to contentSkip to conversation

kvm: svm: de-allocate svm_cpu_data for all cpus in svm_cpu_uninit()

PATCH New Jacob Xu 1 participant 1 message Dec 3, 2020

Subsystems (3)
lore
Share & tools
lore

Jacob Xu

author
#0 lore raw

PATCH 1/1 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.

---
 arch/x86/kvm/svm/svm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/svm/svm.c +2 -2
index 79b3a564f1c9..da7eb4aaf44f 100644
@@ -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);
Signature · 1 line
2.29.2.576.ga3fc446d84-goog