linux-coco.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>,
	Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Borislav Petkov <bp@alien8.de>,
	linux-integrity@vger.kernel.org,
	Dov Murik <dovmurik@linux.ibm.com>,
	Dionna Glaze <dionnaglaze@google.com>,
	linux-coco@lists.linux.dev,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	Claudio Carvalho <cclaudio@linux.ibm.com>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Joerg Roedel <jroedel@suse.de>
Subject: Re: [PATCH v3 4/4] x86/sev: register tpm-svsm platform device
Date: Thu, 20 Mar 2025 17:02:08 +0200	[thread overview]
Message-ID: <Z9wt8EXI5wL1OaSK@kernel.org> (raw)
In-Reply-To: <nrn4ur66lz2ocbkkjl2bgiex3xbp552szerfhalsaefunqxf7p@ki7xf66zrf6u>

On Tue, Mar 18, 2025 at 11:44:05AM +0100, Stefano Garzarella wrote:
> On Mon, Mar 17, 2025 at 03:34:10PM +0200, Jarkko Sakkinen wrote:
> > On Fri, Mar 14, 2025 at 11:56:31AM -0500, Tom Lendacky wrote:
> > > On 3/11/25 04:42, Stefano Garzarella wrote:
> > > > 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
> > > >
> > > > The driver will call snp_svsm_vtpm_probe() to check if SVSM is
> > > > present and if it's support the vTPM protocol.
> > > >
> > > > Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> > > > ---
> > > >  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 2166bdff88b7..a2383457889e 100644
> > > > --- a/arch/x86/coco/sev/core.c
> > > > +++ b/arch/x86/coco/sev/core.c
> > > > @@ -2664,6 +2664,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))
> > > > @@ -2672,6 +2677,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;
> > > > +
> > > 
> > > You could avoid registering the device if an SVSM isn't present. Not sure
> > > if that is desirable or not.
> > 
> > Is there any use for the device if an SVSM isn't present? :-)
> > 
> > I'd judge it based on that...
> 
> 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.

OK good point, thanks! Let's look the update as a whole and not touch
on this. There's already quite a few pieces moving. Ignore this for
the moment :-)

> 
> Thanks,
> Stefano
> 

BR, Jarkko

      reply	other threads:[~2025-03-20 15:02 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-11  9:42 [PATCH v3 0/4] Enlightened vTPM support for SVSM on SEV-SNP Stefano Garzarella
2025-03-11  9:42 ` [PATCH v3 1/4] x86/sev: add SVSM vTPM probe/send_command functions Stefano Garzarella
2025-03-11  9:56   ` Jarkko Sakkinen
2025-03-12 10:56     ` Stefano Garzarella
2025-03-14 15:04       ` Jarkko Sakkinen
2025-03-14 15:27   ` Tom Lendacky
2025-03-17 13:36     ` Jarkko Sakkinen
2025-03-18 10:07       ` Stefano Garzarella
2025-03-20 15:03         ` Jarkko Sakkinen
2025-03-20 17:16           ` Borislav Petkov
2025-03-20 17:30             ` Jarkko Sakkinen
2025-03-21  9:01               ` Stefano Garzarella
2025-03-21 22:05                 ` Borislav Petkov
2025-03-22 20:17                   ` Jarkko Sakkinen
2025-03-24  9:00                     ` Stefano Garzarella
2025-03-11  9:42 ` [PATCH v3 2/4] svsm: add header with SVSM_VTPM_CMD helpers Stefano Garzarella
2025-03-11 10:07   ` Jarkko Sakkinen
2025-03-12 11:47     ` Stefano Garzarella
2025-03-11  9:42 ` [PATCH v3 3/4] tpm: add SNP SVSM vTPM driver Stefano Garzarella
2025-03-14 16:48   ` Tom Lendacky
2025-03-17 13:43     ` Jarkko Sakkinen
2025-03-18 10:38       ` Stefano Garzarella
2025-03-18 14:54         ` Tom Lendacky
2025-03-18 16:18           ` Stefano Garzarella
2025-03-19 23:44             ` Jason Gunthorpe
2025-03-20 11:18               ` Stefano Garzarella
2025-03-20 15:00               ` Jarkko Sakkinen
2025-03-20 14:56         ` Jarkko Sakkinen
2025-03-11  9:42 ` [PATCH v3 4/4] x86/sev: register tpm-svsm platform device Stefano Garzarella
2025-03-14 16:56   ` Tom Lendacky
2025-03-17 13:34     ` Jarkko Sakkinen
2025-03-18 10:44       ` Stefano Garzarella
2025-03-20 15:02         ` Jarkko Sakkinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z9wt8EXI5wL1OaSK@kernel.org \
    --to=jarkko@kernel.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=bp@alien8.de \
    --cc=cclaudio@linux.ibm.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dionnaglaze@google.com \
    --cc=dovmurik@linux.ibm.com \
    --cc=hpa@zytor.com \
    --cc=jgg@ziepe.ca \
    --cc=jroedel@suse.de \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterhuewe@gmx.de \
    --cc=sgarzare@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).