[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z-7cJyB1LXi75Z0F@kernel.org>
Date: Thu, 3 Apr 2025 22:06:15 +0300
From: Jarkko Sakkinen <jarkko@...nel.org>
To: Stefano Garzarella <sgarzare@...hat.com>
Cc: 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, Borislav Petkov <bp@...en8.de>,
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 Thu, Apr 03, 2025 at 12:09:42PM +0200, Stefano Garzarella wrote:
> From: Stefano Garzarella <sgarzare@...hat.com>
>
> SNP platform can provide a vTPM device emulated by SVSM.
>
> The "tpm-svsm" device can be handled by the platform driver added
> by the previous commit in drivers/char/tpm/tpm_svsm.c
>
> Register the device unconditionally. The support check (e.g. SVSM, cmd)
> is in snp_svsm_vtpm_probe(), keeping all logic in one place.
> This function is called during the driver's probe along with other
> setup tasks like memory allocation.
>
> Reviewed-by: Tom Lendacky <thomas.lendacky@....com>
> Signed-off-by: Stefano Garzarella <sgarzare@...hat.com>
> ---
> v6:
> - added Tom's R-b
> v4:
> - explained better why we register it anyway in the commit message
> ---
> arch/x86/coco/sev/core.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
> index efb43c9d3d30..acbd9bc526b1 100644
> --- a/arch/x86/coco/sev/core.c
> +++ b/arch/x86/coco/sev/core.c
> @@ -2689,6 +2689,11 @@ static struct platform_device sev_guest_device = {
> .id = -1,
> };
>
> +static struct platform_device tpm_svsm_device = {
> + .name = "tpm-svsm",
> + .id = -1,
> +};
> +
> static int __init snp_init_platform_device(void)
> {
> if (!cc_platform_has(CC_ATTR_GUEST_SEV_SNP))
> @@ -2697,6 +2702,9 @@ 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;
> +
> pr_info("SNP guest platform device initialized.\n");
> return 0;
> }
> --
> 2.49.0
>
>
Reviewed-by: Jarkko Sakkinen <jarkko@...nel.org>
BR, Jarkko
Powered by blists - more mailing lists