Skip to content

Commit 9ef1530

Browse files
committed
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: Uros Bizjak <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent dbef280 commit 9ef1530

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/x86/kvm/svm/sev.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ int __init sev_hardware_setup(void)
11171117
/* Maximum number of encrypted guests supported simultaneously */
11181118
max_sev_asid = cpuid_ecx(0x8000001F);
11191119

1120-
if (!max_sev_asid)
1120+
if (!svm_sev_enabled())
11211121
return 1;
11221122

11231123
/* Minimum ASID value that should be used for SEV guest */
@@ -1156,6 +1156,9 @@ int __init sev_hardware_setup(void)
11561156

11571157
void sev_hardware_teardown(void)
11581158
{
1159+
if (!svm_sev_enabled())
1160+
return;
1161+
11591162
bitmap_free(sev_asid_bitmap);
11601163
bitmap_free(sev_reclaim_asid_bitmap);
11611164

0 commit comments

Comments
 (0)