[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <12eba6d2-095c-96e0-8378-9c0a6582cd73@amd.com>
Date: Fri, 7 Feb 2025 15:46:46 -0600
From: Tom Lendacky <thomas.lendacky@....com>
To: Ashish Kalra <Ashish.Kalra@....com>, seanjc@...gle.com,
pbonzini@...hat.com, tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
john.allen@....com, herbert@...dor.apana.org.au, davem@...emloft.net,
joro@...tes.org, suravee.suthikulpanit@....com, will@...nel.org,
robin.murphy@....com
Cc: michael.roth@....com, dionnaglaze@...gle.com, nikunj@....com,
ardb@...nel.org, kevinloughlin@...gle.com, Neeraj.Upadhyay@....com,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-crypto@...r.kernel.org, linux-coco@...ts.linux.dev,
iommu@...ts.linux.dev
Subject: Re: [PATCH v3 2/3] KVM: SVM: Ensure PSP module is initialized if KVM
module is built-in
On 2/3/25 15:56, Ashish Kalra wrote:
> From: Sean Christopherson <seanjc@...gle.com>
>
> The kernel's initcall infrastructure lacks the ability to express
> dependencies between initcalls, whereas the modules infrastructure
> automatically handles dependencies via symbol loading. Ensure the
> PSP SEV driver is initialized before proceeding in sev_hardware_setup()
> if KVM is built-in as the dependency isn't handled by the initcall
> infrastructure.
>
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>
> Signed-off-by: Ashish Kalra <ashish.kalra@....com>
Reviewed-by: Tom Lendacky <thomas.lendacky@....com>
> ---
> arch/x86/kvm/svm/sev.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
> index a2a794c32050..0dbb25442ec1 100644
> --- a/arch/x86/kvm/svm/sev.c
> +++ b/arch/x86/kvm/svm/sev.c
> @@ -2972,6 +2972,16 @@ void __init sev_hardware_setup(void)
> WARN_ON_ONCE(!boot_cpu_has(X86_FEATURE_FLUSHBYASID)))
> goto out;
>
> + /*
> + * The kernel's initcall infrastructure lacks the ability to express
> + * dependencies between initcalls, whereas the modules infrastructure
> + * automatically handles dependencies via symbol loading. Ensure the
> + * PSP SEV driver is initialized before proceeding if KVM is built-in,
> + * as the dependency isn't handled by the initcall infrastructure.
> + */
> + if (IS_BUILTIN(CONFIG_KVM_AMD) && sev_module_init())
> + goto out;
> +
> /* Retrieve SEV CPUID information */
> cpuid(0x8000001f, &eax, &ebx, &ecx, &edx);
>
Powered by blists - more mailing lists