lkml.org 
[lkml]   [2020]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] KVM: SVM: fix compilation with modular PSP and non-modular KVM
On Mon, Apr 13, 2020 at 03:50:31AM -0400, Paolo Bonzini wrote:
> 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 <ubizjak@gmail.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> arch/x86/kvm/svm/sev.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
> index 0e3fc311d7da..364ffe32139c 100644
> --- a/arch/x86/kvm/svm/sev.c
> +++ b/arch/x86/kvm/svm/sev.c
> @@ -1117,7 +1117,7 @@ int __init sev_hardware_setup(void)
> /* Maximum number of encrypted guests supported simultaneously */
> max_sev_asid = cpuid_ecx(0x8000001F);
>
> - if (!max_sev_asid)
> + if (!svm_sev_enabled())
> return 1;
>
> /* Minimum ASID value that should be used for SEV guest */
> @@ -1156,6 +1156,9 @@ int __init sev_hardware_setup(void)
>
> void sev_hardware_teardown(void)
> {
> + if (!svm_sev_enabled())
> + return;
> +

Tabs instead of spaces. Checkpatch also whinges about going past 75 chars
in the changelog.

> bitmap_free(sev_asid_bitmap);
> bitmap_free(sev_reclaim_asid_bitmap);
>
> --
> 2.18.2
>

\
 
 \ /
  Last update: 2020-04-14 01:31    [W:1.423 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site