From: Jason Gunthorpe <jgg@ziepe.ca>
To: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: Stefano Garzarella <sgarzare@redhat.com>,
linux-coco@lists.linux.dev, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Peter Huewe <peterhuewe@gmx.de>, "H. Peter Anvin" <hpa@zytor.com>,
linux-integrity@vger.kernel.org, x86@kernel.org,
Joerg Roedel <jroedel@suse.de>,
Jarkko Sakkinen <jarkko@kernel.org>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Claudio Carvalho <cclaudio@linux.ibm.com>,
Dov Murik <dovmurik@linux.ibm.com>,
Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [PATCH 3/3] x86/sev: add a SVSM vTPM platform device
Date: Tue, 10 Dec 2024 11:04:13 -0400 [thread overview]
Message-ID: <20241210150413.GI1888283@ziepe.ca> (raw)
In-Reply-To: <50a2e1d29b065498146f459035e447851a518d1a.camel@HansenPartnership.com>
On Tue, Dec 10, 2024 at 09:55:41AM -0500, James Bottomley wrote:
> On Tue, 2024-12-10 at 10:40 -0400, Jason Gunthorpe wrote:
> > On Tue, Dec 10, 2024 at 03:34:23PM +0100, Stefano Garzarella wrote:
> >
> > > + if (platform_device_add_data(&tpm_device, &pops,
> > > sizeof(pops)))
> > > + return -ENODEV;
> > > + if (platform_device_register(&tpm_device))
> > > + return -ENODEV;
> >
> > This seems like an old fashioned way to instantiate a device. Why do
> > this? Just put the TPM driver here and forget about pops? Simple tpm
> > drivers are not very complex.
>
> This driver may be for the AMD SEV SVSM vTPM module, but there are
> other platforms where there's an internal vTPM which might be contacted
> via a platform specific enlightenment (Intel SNP and Microsoft
> OpenHCL).
Sure, that's what TPM drivers are for, give those platforms TPM drivers
too.
Why put a mini driver hidden under an already mini driver?
> This separation of the platform device from the contact
> mechanism is designed to eliminate the duplication of having a platform
> device within each implementation and to make any bugs in the mssim
> protocol centrally fixable (every vTPM currently speaks this).
That makes sense, but that isn't really what I see in this series?
Patch one just has tpm_class_ops send() invoke pops sendrcv() after
re-arranging the arguments?
It looks to me like there would be mert in adding a new op to
tpm_class_ops for the send/recv type operating mode and have the core
code manage the buffer singleton (is a global static even *correct*??)
After that, there is no meaningful shared code here, and maybe the
TPM_CHIP_FLAG_IRQ hack can be avoided too.
Simply call tpm_chip_alloc/register from the sev code directly and
provide an op that does the send/recv. Let the tpm core code deal with
everything else. It is much cleaner than platform devices and driver
data..
Jason
next prev parent reply other threads:[~2024-12-10 15:04 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-10 14:34 [PATCH 0/3] Enlightened vTPM support for SVSM on SEV-SNP Stefano Garzarella
2024-12-10 14:34 ` [PATCH 1/3] tpm: add generic platform device Stefano Garzarella
2024-12-12 9:51 ` Stefano Garzarella
2024-12-12 14:35 ` James Bottomley
2024-12-12 15:30 ` Stefano Garzarella
2024-12-12 15:41 ` James Bottomley
2024-12-12 16:12 ` Stefano Garzarella
2024-12-10 14:34 ` [PATCH 2/3] x86/sev: add SVSM call macros for the vTPM protocol Stefano Garzarella
2024-12-10 14:34 ` [PATCH 3/3] x86/sev: add a SVSM vTPM platform device Stefano Garzarella
2024-12-10 14:40 ` Jason Gunthorpe
2024-12-10 14:55 ` James Bottomley
2024-12-10 15:04 ` Jason Gunthorpe [this message]
2024-12-11 8:19 ` Stefano Garzarella
2024-12-11 15:00 ` Jason Gunthorpe
2024-12-11 15:38 ` Stefano Garzarella
2024-12-11 15:53 ` Jason Gunthorpe
2024-12-11 16:42 ` Stefano Garzarella
2024-12-19 15:35 ` Stefano Garzarella
2024-12-19 15:40 ` Jarkko Sakkinen
2024-12-19 16:06 ` Stefano Garzarella
2025-01-14 10:42 ` Stefano Garzarella
2025-01-14 13:07 ` Jason Gunthorpe
2025-01-14 16:51 ` Stefano Garzarella
2025-01-14 17:33 ` Jason Gunthorpe
2025-01-14 22:46 ` Jarkko Sakkinen
2025-01-14 22:48 ` Jarkko Sakkinen
2025-01-14 23:12 ` Jarkko Sakkinen
2025-01-22 21:29 ` Dionna Amalie Glaze
2025-01-23 9:50 ` Jarkko Sakkinen
2025-01-23 10:09 ` Stefano Garzarella
2025-01-23 11:46 ` Jarkko Sakkinen
2025-01-23 11:49 ` Jarkko Sakkinen
2025-01-23 12:29 ` Stefano Garzarella
2024-12-11 16:30 ` Tom Lendacky
2024-12-11 16:55 ` Stefano Garzarella
2024-12-11 17:02 ` James Bottomley
2024-12-13 11:48 ` Stefano Garzarella
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=20241210150413.GI1888283@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=James.Bottomley@hansenpartnership.com \
--cc=bp@alien8.de \
--cc=cclaudio@linux.ibm.com \
--cc=dave.hansen@linux.intel.com \
--cc=dovmurik@linux.ibm.com \
--cc=hpa@zytor.com \
--cc=jarkko@kernel.org \
--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