From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Borislav Petkov <bp@alien8.de>, Stefano Garzarella <sgarzare@redhat.com>
Cc: Jarkko Sakkinen <jarkko@kernel.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
"H. Peter Anvin" <hpa@zytor.com>,
linux-coco@lists.linux.dev, linux-integrity@vger.kernel.org,
Ingo Molnar <mingo@redhat.com>,
x86@kernel.org, Tom Lendacky <thomas.lendacky@amd.com>,
Joerg Roedel <jroedel@suse.de>,
Dionna Glaze <dionnaglaze@google.com>,
Claudio Carvalho <cclaudio@linux.ibm.com>,
linux-kernel@vger.kernel.org, Dov Murik <dovmurik@linux.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v6 4/4] x86/sev: register tpm-svsm platform device
Date: Wed, 09 Apr 2025 08:22:37 -0400 [thread overview]
Message-ID: <409a9171bc3224dd55344729ab3106917ac113bf.camel@HansenPartnership.com> (raw)
In-Reply-To: <20250409113154.GGZ_ZaqgfRrrMij_Zm@fat_crate.local>
On Wed, 2025-04-09 at 13:31 +0200, Borislav Petkov wrote:
> On Wed, Apr 09, 2025 at 12:43:01PM +0200, Stefano Garzarella wrote:
> > Sorry, maybe I missed something.
> >
> > tpm_svsm.c registers the driver with
> > module_platform_driver_probe().
> >
> > Someone (the platform I guess) has to register the device by
> > calling platform_device_register(), as we already do for example
> > for sev_guest.
>
> Maybe that platform device thing is the wrong approach. Why does the
> core code need to register some dummy platform device in the first
> place? Why can't drivers/char/tpm/tpm_svsm.c probe and init without
> it?
Because of the way driver and device matching works in Linux. We have
to have a struct device because that sits at the he heart of the TPM
driver binding. If we have a struct device, it has to sit on a bus
(because that's the Linux design) and if we don't have a bus then we
have to use a platform device (or, now, we could use a struct device on
the faux bus). Busses can be either physical (PCI, GSC, ...) and
abstract (virtio, xen, scsi, ...), so it's not impossible, if the SVSM
has more than one device, that it should have it's own SVSM bus which
we could then act a bit like the virtio bus and the SVSM vTPM struct
device could sit on this (the TPM subsystem, like most driver
subsystems, doesn't care about busses, it only cares that the abstract
bus device id matching works).
Regards,
James
next prev parent reply other threads:[~2025-04-09 12:22 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-03 10:09 [PATCH v6 0/4] Enlightened vTPM support for SVSM on SEV-SNP Stefano Garzarella
2025-04-03 10:09 ` [PATCH v6 1/4] x86/sev: add SVSM vTPM probe/send_command functions Stefano Garzarella
2025-04-11 10:15 ` [tip: x86/sev] x86/sev: Add " tip-bot2 for Stefano Garzarella
2025-04-03 10:09 ` [PATCH v6 2/4] svsm: add header with SVSM_VTPM_CMD helpers Stefano Garzarella
2025-04-11 10:15 ` [tip: x86/sev] svsm: Add " tip-bot2 for Stefano Garzarella
2025-04-03 10:09 ` [PATCH v6 3/4] tpm: add SNP SVSM vTPM driver Stefano Garzarella
2025-04-03 19:05 ` Jarkko Sakkinen
2025-04-09 9:43 ` Stefano Garzarella
2025-04-09 14:21 ` Jarkko Sakkinen
2025-04-04 17:31 ` Dionna Amalie Glaze
2025-04-04 18:37 ` Stefano Garzarella
2025-04-04 18:58 ` Dionna Amalie Glaze
2025-04-09 9:45 ` Stefano Garzarella
2025-04-03 10:09 ` [PATCH v6 4/4] x86/sev: register tpm-svsm platform device Stefano Garzarella
2025-04-03 19:06 ` Jarkko Sakkinen
2025-04-08 11:00 ` Borislav Petkov
2025-04-08 11:08 ` Stefano Garzarella
2025-04-08 11:28 ` Borislav Petkov
2025-04-08 11:54 ` Stefano Garzarella
2025-04-09 10:21 ` Borislav Petkov
2025-04-09 10:43 ` Stefano Garzarella
2025-04-09 11:31 ` Borislav Petkov
2025-04-09 12:22 ` James Bottomley [this message]
2025-04-09 15:09 ` Stefano Garzarella
2025-04-09 18:38 ` Borislav Petkov
2025-04-09 16:07 ` Tom Lendacky
2025-04-09 16:51 ` Stefano Garzarella
2025-04-09 18:45 ` Borislav Petkov
2025-04-09 19:16 ` Tom Lendacky
2025-04-10 8:15 ` Stefano Garzarella
2025-04-07 13:46 ` [PATCH v6 0/4] Enlightened vTPM support for SVSM on SEV-SNP Borislav Petkov
2025-04-07 18:14 ` Jarkko Sakkinen
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=409a9171bc3224dd55344729ab3106917ac113bf.camel@HansenPartnership.com \
--to=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=jarkko@kernel.org \
--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
all inboxes | Powered by JetHome®