lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d8cab90f-8c9c-7f79-0913-ba0d8576206d@amd.com>
Date:   Thu, 16 Apr 2020 08:57:05 -0500
From:   Tom Lendacky <thomas.lendacky@....com>
To:     Paolo Bonzini <pbonzini@...hat.com>, linux-kernel@...r.kernel.org,
        kvm@...r.kernel.org
Cc:     ubizjak@...il.com
Subject: Re: [PATCH] KVM: SVM: fix compilation with modular PSP and
 non-modular KVM

On 4/13/20 2:50 AM, 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.

The Kconfig support will set CONFIG_KVM_AMD_SEV to "n" in this situation, 
so it might be worth seeing if sev.o could be removed from the build at 
that point. I'll try and look at that when I get a chance, but I'm 
currently buried with a ton of other work.

> 
> Reported-by: Uros Bizjak <ubizjak@...il.com>
> Signed-off-by: Paolo Bonzini <pbonzini@...hat.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())

It looks like these are spaces instead of tabs, could just be my email 
veiwer, though.

>   		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;
> +

Ditto on the spaces/tabs thing, here.

Thanks,
Tom

>   	bitmap_free(sev_asid_bitmap);
>   	bitmap_free(sev_reclaim_asid_bitmap);
>   
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ