提交 9ef1530c 编写于 作者: P Paolo Bonzini

KVM: SVM: fix compilation with modular PSP and non-modular KVM

Use svm_sev_enabled() in order to cull all calls to PSP code.  Otherwise,
compilation fails with undefined symbols if the PSP device driver is compiled
as a module and KVM is not.
Reported-by: NUros Bizjak <ubizjak@gmail.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 dbef2808
...@@ -1117,7 +1117,7 @@ int __init sev_hardware_setup(void) ...@@ -1117,7 +1117,7 @@ int __init sev_hardware_setup(void)
/* Maximum number of encrypted guests supported simultaneously */ /* Maximum number of encrypted guests supported simultaneously */
max_sev_asid = cpuid_ecx(0x8000001F); max_sev_asid = cpuid_ecx(0x8000001F);
if (!max_sev_asid) if (!svm_sev_enabled())
return 1; return 1;
/* Minimum ASID value that should be used for SEV guest */ /* Minimum ASID value that should be used for SEV guest */
...@@ -1156,6 +1156,9 @@ int __init sev_hardware_setup(void) ...@@ -1156,6 +1156,9 @@ int __init sev_hardware_setup(void)
void sev_hardware_teardown(void) void sev_hardware_teardown(void)
{ {
if (!svm_sev_enabled())
return;
bitmap_free(sev_asid_bitmap); bitmap_free(sev_asid_bitmap);
bitmap_free(sev_reclaim_asid_bitmap); bitmap_free(sev_reclaim_asid_bitmap);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册