[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z4HAFmyhw5DeIRBT@google.com>
Date: Fri, 10 Jan 2025 16:49:26 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: Dionna Amalie Glaze <dionnaglaze@...gle.com>
Cc: Ashish Kalra <ashish.kalra@....com>, Tom Lendacky <thomas.lendacky@....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,
michael.roth@....com, kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-crypto@...r.kernel.org, linux-coco@...ts.linux.dev
Subject: Re: [PATCH v3 6/7] KVM: SVM: Add support to initialize SEV/SNP
functionality in KVM
On Fri, Jan 10, 2025, Dionna Amalie Glaze wrote:
> On Fri, Jan 10, 2025 at 4:40 PM Sean Christopherson <seanjc@...gle.com> wrote:
> > > Is there a way to change the load order of built-in modules and/or change
> > > dependency of built-in modules ?
> >
> > The least awful option I know of would be to have the PSP use a higher priority
> > initcall type so that it runs before the standard initcalls. When compiled as
> > a module, all initcall types are #defined to module_init.
> >
> > E.g. this should work, /cross fingers
> >
> > diff --git a/drivers/crypto/ccp/sp-dev.c b/drivers/crypto/ccp/sp-dev.c
> > index 7eb3e4668286..02c49fbf6198 100644
> > --- a/drivers/crypto/ccp/sp-dev.c
> > +++ b/drivers/crypto/ccp/sp-dev.c
> > @@ -295,5 +295,6 @@ static void __exit sp_mod_exit(void)
> > #endif
> > }
> >
> > -module_init(sp_mod_init);
> > +/* The PSP needs to be initialized before dependent modules, e.g. before KVM. */
> > +subsys_initcall(sp_mod_init);
>
> I was 2 seconds from clicking send with this exact suggestion. There
> are examples in 'drivers/' that use subsys_initcall / module_exit
> pairs.
Ha! For once, I wasn't too slow due to writing an overly verbose message :-)
Powered by blists - more mailing lists