[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <o2u7p3wb64lcc4sziunr274hyubkgmspzdjcvihbpzkw6mkvpo@sjq3vi4y2qfl>
Date: Tue, 8 Apr 2025 13:54:07 +0200
From: Stefano Garzarella <sgarzare@...hat.com>
To: Borislav Petkov <bp@...en8.de>
Cc: Jarkko Sakkinen <jarkko@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>, Peter Huewe <peterhuewe@....de>, Jason Gunthorpe <jgg@...pe.ca>,
"H. Peter Anvin" <hpa@...or.com>, linux-coco@...ts.linux.dev, linux-integrity@...r.kernel.org,
Ingo Molnar <mingo@...hat.com>, x86@...nel.org, Tom Lendacky <thomas.lendacky@....com>,
Joerg Roedel <jroedel@...e.de>, Dionna Glaze <dionnaglaze@...gle.com>,
Claudio Carvalho <cclaudio@...ux.ibm.com>, James Bottomley <James.Bottomley@...senpartnership.com>,
linux-kernel@...r.kernel.org, Dov Murik <dovmurik@...ux.ibm.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH v6 4/4] x86/sev: register tpm-svsm platform device
On Tue, Apr 08, 2025 at 01:28:20PM +0200, Borislav Petkov wrote:
>On Tue, Apr 08, 2025 at 01:08:36PM +0200, Stefano Garzarella wrote:
>> We discussed a bit on v3, but I'm open to change it:
>> https://lore.kernel.org/linux-integrity/nrn4ur66lz2ocbkkjl2bgiex3xbp552szerfhalsaefunqxf7p@ki7xf66zrf6u/
>>
>> I tried to keep the logic of whether or not the driver is needed all in
>> the tpm_svsm_probe()/snp_svsm_vtpm_probe() (where I check for SVSM).
>> If you prefer to move some pieces here, though, I'm open.
>
>Yes please.
>
>It doesn't make a whole lotta sense right now to register a TPM platform
>driver at one place without even knowing you're running with an SVSM inside
>the guest blob or not.
>
>The usual approach is to register upon a successful detection.
I see, so IIUC I can just apply the following change to this patch and
avoid to export snp_svsm_vtpm_probe() at all, right?
diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
index acbd9bc526b1..fa83e6c7f990 100644
--- a/arch/x86/coco/sev/core.c
+++ b/arch/x86/coco/sev/core.c
@@ -2702,8 +2702,10 @@ static int __init snp_init_platform_device(void)
if (platform_device_register(&sev_guest_device))
return -ENODEV;
- if (platform_device_register(&tpm_svsm_device))
- return -ENODEV;
+ if (snp_svsm_vtpm_probe()) {
+ if (platform_device_register(&tpm_svsm_device))
+ return -ENODEV;
+ }
pr_info("SNP guest platform device initialized.\n");
return 0;
Thanks,
Stefano
Powered by blists - more mailing lists