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]
Date:   Wed, 24 Aug 2022 14:11:48 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     "Gupta, Nipun" <Nipun.Gupta@....com>
Cc:     "jgg@...dia.com" <jgg@...dia.com>,
        Robin Murphy <robin.murphy@....com>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "krzysztof.kozlowski+dt@...aro.org" 
        <krzysztof.kozlowski+dt@...aro.org>,
        "rafael@...nel.org" <rafael@...nel.org>,
        "eric.auger@...hat.com" <eric.auger@...hat.com>,
        "alex.williamson@...hat.com" <alex.williamson@...hat.com>,
        "cohuck@...hat.com" <cohuck@...hat.com>,
        "Gupta, Puneet (DCG-ENG)" <puneet.gupta@....com>,
        "song.bao.hua@...ilicon.com" <song.bao.hua@...ilicon.com>,
        "mchehab+huawei@...nel.org" <mchehab+huawei@...nel.org>,
        "maz@...nel.org" <maz@...nel.org>,
        "f.fainelli@...il.com" <f.fainelli@...il.com>,
        "jeffrey.l.hugo@...il.com" <jeffrey.l.hugo@...il.com>,
        "saravanak@...gle.com" <saravanak@...gle.com>,
        "Michael.Srba@...nam.cz" <Michael.Srba@...nam.cz>,
        "mani@...nel.org" <mani@...nel.org>,
        "yishaih@...dia.com" <yishaih@...dia.com>,
        "jgg@...pe.ca" <jgg@...pe.ca>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "okaya@...nel.org" <okaya@...nel.org>,
        "Anand, Harpreet" <harpreet.anand@....com>,
        "Agarwal, Nikhil" <nikhil.agarwal@....com>,
        "Simek, Michal" <michal.simek@....com>,
        "git (AMD-Xilinx)" <git@....com>
Subject: Re: [RFC PATCH v2 2/6] bus/cdx: add the cdx bus driver

On Wed, Aug 24, 2022 at 08:50:19AM +0000, Gupta, Nipun wrote:
> [AMD Official Use Only - General]
> 
> 
> 
> > -----Original Message-----
> > From: Greg KH <gregkh@...uxfoundation.org>
> > Sent: Monday, August 22, 2022 7:00 PM
> > To: Gupta, Nipun <Nipun.Gupta@....com>
> > Cc: robh+dt@...nel.org; krzysztof.kozlowski+dt@...aro.org;
> > rafael@...nel.org; eric.auger@...hat.com; alex.williamson@...hat.com;
> > cohuck@...hat.com; Gupta, Puneet (DCG-ENG)
> > <puneet.gupta@....com>; song.bao.hua@...ilicon.com;
> > mchehab+huawei@...nel.org; maz@...nel.org; f.fainelli@...il.com;
> > jeffrey.l.hugo@...il.com; saravanak@...gle.com;
> > Michael.Srba@...nam.cz; mani@...nel.org; yishaih@...dia.com;
> > jgg@...pe.ca; linux-kernel@...r.kernel.org; devicetree@...r.kernel.org;
> > kvm@...r.kernel.org; okaya@...nel.org; Anand, Harpreet
> > <harpreet.anand@....com>; Agarwal, Nikhil <nikhil.agarwal@....com>;
> > Simek, Michal <michal.simek@....com>; git (AMD-Xilinx) <git@....com>;
> > jgg@...dia.com; Robin Murphy <robin.murphy@....com>
> > Subject: Re: [RFC PATCH v2 2/6] bus/cdx: add the cdx bus driver
> > 
> > [CAUTION: External Email]
> > 
> > On Mon, Aug 22, 2022 at 01:21:47PM +0000, Gupta, Nipun wrote:
> > > [AMD Official Use Only - General]
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Greg KH <gregkh@...uxfoundation.org>
> > > > Sent: Wednesday, August 17, 2022 9:03 PM
> > > > To: Gupta, Nipun <Nipun.Gupta@....com>
> > > > Cc: robh+dt@...nel.org; krzysztof.kozlowski+dt@...aro.org;
> > rafael@...nel.org;
> > > > eric.auger@...hat.com; alex.williamson@...hat.com;
> > cohuck@...hat.com;
> > > > Gupta, Puneet (DCG-ENG) <puneet.gupta@....com>;
> > > > song.bao.hua@...ilicon.com; mchehab+huawei@...nel.org;
> > maz@...nel.org;
> > > > f.fainelli@...il.com; jeffrey.l.hugo@...il.com; saravanak@...gle.com;
> > > > Michael.Srba@...nam.cz; mani@...nel.org; yishaih@...dia.com;
> > > > jgg@...pe.ca; linux-kernel@...r.kernel.org;
> > devicetree@...r.kernel.org;
> > > > kvm@...r.kernel.org; okaya@...nel.org; Anand, Harpreet
> > > > <harpreet.anand@....com>; Agarwal, Nikhil
> > <nikhil.agarwal@....com>;
> > > > Simek, Michal <michal.simek@....com>; git (AMD-Xilinx)
> > <git@....com>
> > > > Subject: Re: [RFC PATCH v2 2/6] bus/cdx: add the cdx bus driver
> > > >
> > > > [CAUTION: External Email]
> > > >
> > > > On Wed, Aug 17, 2022 at 08:35:38PM +0530, Nipun Gupta wrote:
> > > > > CDX bus driver manages the scanning and populating FPGA
> > > > > based devices present on the CDX bus.
> > > > >
> > > > > The bus driver sets up the basic infrastructure and fetches
> > > > > the device related information from the firmware. These
> > > > > devices are registered as platform devices.
> > > >
> > > > Ick, why?  These aren't platform devices, they are CDX devices.  Make
> > > > them real devices here, don't abuse the platform device interface for
> > > > things that are not actually on the platform bus.
> > >
> > > CDX is a virtual bus (FW based) which discovers FPGA based platform
> > > devices based on communication with FW.
> > 
> > virtual busses are fine to have as a real bus in the kernel, no problem
> > there.
> > 
> > > These devices are essentially platform devices as these are memory
> > mapped
> > > on system bus, but having a property that they are dynamically discovered
> > > via FW and are rescannable.
> > 
> > If they are dynamically discoverable and rescannable, then great, it's a
> > bus in the kernel and NOT a platform device.
> > 
> > > I think your point is correct in the sense that CDX bus is not an actual bus,
> > > but a FW based mechanism to discover FPGA based platform devices.
> > >
> > > Can you kindly suggest us if we should have the CDX platform device
> > scanning
> > > code as a CDX bus in "drivers/bus/" folder OR have it in "drivers/fpga/" or
> > > "drivers/platform/" or which other suitable location?
> > 
> > drivers/cdx/ ?
> 
> I agree that the approach, which is correct should be used, just wanted
> to reconfirm as adding a new bus would lead to change in other areas
> like SMMU, MSI and VFIO too and we will need vfio-cdx interface for CDX
> bus, similar to vfio-platform.
> 
> On another mail Robin and Jason have suggested to use OF_DYNAMIC.
> Can you please also let us know in case that is a suited option where we
> use OF_DYNAMIC and have our code as part of "drivers/fpga" instead of
> using the bus. (something like pseries CPU hotplug is using to add new
> CPU platform devices on runtime:
> https://elixir.bootlin.com/linux/v5.19.3/source/arch/powerpc/platforms/pseries/hotplug-cpu.c#L534).
> We can share the RFC in case you are interested in looking at code flow
> using the of_dynamic approach.

Please no more abuse of the platform device.

If your device can be discovered by scanning a bus, it is not a platform
device.

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ