Commit a101c9d6 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Paolo Bonzini

KVM: SVM: Switch to bitmap_zalloc()

Switch to bitmap_zalloc() to show clearly what we are allocating.
Besides that it returns pointer of bitmap type instead of opaque void *.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 9a984586
...@@ -1226,8 +1226,7 @@ static __init int sev_hardware_setup(void) ...@@ -1226,8 +1226,7 @@ static __init int sev_hardware_setup(void)
min_sev_asid = cpuid_edx(0x8000001F); min_sev_asid = cpuid_edx(0x8000001F);
/* Initialize SEV ASID bitmap */ /* Initialize SEV ASID bitmap */
sev_asid_bitmap = kcalloc(BITS_TO_LONGS(max_sev_asid), sev_asid_bitmap = bitmap_zalloc(max_sev_asid, GFP_KERNEL);
sizeof(unsigned long), GFP_KERNEL);
if (!sev_asid_bitmap) if (!sev_asid_bitmap)
return 1; return 1;
...@@ -1405,7 +1404,7 @@ static __exit void svm_hardware_unsetup(void) ...@@ -1405,7 +1404,7 @@ static __exit void svm_hardware_unsetup(void)
int cpu; int cpu;
if (svm_sev_enabled()) if (svm_sev_enabled())
kfree(sev_asid_bitmap); bitmap_free(sev_asid_bitmap);
for_each_possible_cpu(cpu) for_each_possible_cpu(cpu)
svm_cpu_uninit(cpu); svm_cpu_uninit(cpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment