lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <688d61b1c4c8c_55f09100f4@dwillia2-xfh.jf.intel.com.notmuch>
Date: Fri, 1 Aug 2025 17:54:09 -0700
From: <dan.j.williams@...el.com>
To: Jason Gunthorpe <jgg@...pe.ca>, Jonathan Cameron
	<Jonathan.Cameron@...wei.com>
CC: Aneesh Kumar K.V <aneesh.kumar@...nel.org>, Dan Williams
	<dan.j.williams@...el.com>, <linux-coco@...ts.linux.dev>,
	<kvmarm@...ts.linux.dev>, <linux-pci@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <aik@....com>, <lukas@...ner.de>, "Samuel
 Ortiz" <sameo@...osinc.com>, Xu Yilun <yilun.xu@...ux.intel.com>, "Suzuki K
 Poulose" <Suzuki.Poulose@....com>, Steven Price <steven.price@....com>,
	Catalin Marinas <catalin.marinas@....com>, Marc Zyngier <maz@...nel.org>,
	Will Deacon <will@...nel.org>, Oliver Upton <oliver.upton@...ux.dev>,
	<gregkh@...uxfounation.org>
Subject: Re: [RFC PATCH v1 11/38] KVM: arm64: CCA: register host tsm platform
 device

Jason Gunthorpe wrote:
> On Wed, Jul 30, 2025 at 11:38:27AM +0100, Jonathan Cameron wrote:
> > On Wed, 30 Jul 2025 14:12:26 +0530
> > "Aneesh Kumar K.V" <aneesh.kumar@...nel.org> wrote:
> > 
> > > Jason Gunthorpe <jgg@...pe.ca> writes:
> > > 
> > > > On Tue, Jul 29, 2025 at 06:10:45PM +0100, Jonathan Cameron wrote:
> > > >  
> > > >> > +static struct platform_device cca_host_dev = {  
> > > >> Hmm. Greg is getting increasingly (and correctly in my view) grumpy with
> > > >> platform devices being registered with no underlying resources etc as glue
> > > >> layers.  Maybe some of that will come later.  
> > > >
> > > > Is faux_device a better choice? I admit to not knowing entirely what
> > > > it is for..
> > 
> > I'll go with a cautious yes to faux_device. This case of a glue device
> > with no resources and no reason to be on a particular bus was definitely
> > the intent but I'm not 100% sure without trying it that we don't run
> > into any problems.
> > 
> > Not that many examples yet, but cpuidle-psci.c looks like a vaguely similar
> > case to this one.  
> > 
> > All it really does is move the location of the device and
> > smash together the device registration with probe/remove.
> > That means the device disappears if probe() fails, which is cleaner
> > in many ways than leaving a pointless stub behind.
> > 
> > Maybe it isn't appropriate it if is actually useful to rmmod/modprobe the
> > driver. 
> 
> Yeah, exactly. Can a TSM driver even be modular? If it has to be built
> in then there is no reason to do this:

For example, CRYPTO_DEV_CCP_DD, the AMD PCI device driver that will call
tsm_register(), is already modular.

> > > The goal is to have tsm class device to be parented by the platform
> > > device.
> 
> IMHO the only real point of that is to trigger module autoloading.

Right. For TDX, and I expect CCA as well, the arch code that knows that
PCI/TSM functionality is available and can register a device, may be
running too early to attach a driver to that device.

I.e. I would like to just use faux_device, but without the ability to do
EPROBE_DEFER, for example to await the plaform IOMMU driver. It needs to
move to its own bus so the attach event can be handled at a better time.

> Otherwise the tsm core should accept NULL as the parent pointer during
> registration, it probably already does..

Yes, NULL @parent "just works" with tsm_register().

However, I expect all tsm_register() callers to be from modular drivers.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ