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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201021072532.GF16172@yilunxu-OptiPlex-7050>
Date:   Wed, 21 Oct 2020 15:25:32 +0800
From:   Xu Yilun <yilun.xu@...el.com>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     Tom Rix <trix@...hat.com>, mdf@...nel.org,
        linux-fpga@...r.kernel.org, linux-kernel@...r.kernel.org,
        lgoncalv@...hat.com, hao.wu@...el.com, yilun.xu@...el.com
Subject: Re: [PATCH 1/2] fpga: dfl: add driver_override support

Hi Greg,

On Tue, Oct 20, 2020 at 11:21:55AM +0200, Greg KH wrote:
> On Tue, Oct 20, 2020 at 04:57:23PM +0800, Xu Yilun wrote:
> > On Tue, Oct 20, 2020 at 09:32:59AM +0200, Greg KH wrote:
> > > On Tue, Oct 20, 2020 at 03:11:58PM +0800, Xu Yilun wrote:
> > > > I think it is normal case that a driver is successfully registered but
> > > > doesn't match any device because it provides no id_table.
> > > 
> > > How is that "normal"?  What would ever cause that driver to be bound to
> > > a device then?
> > 
> > This patchset adds the driver_override sysfs node, to let userspace
> > specify which driver (by name matching) to be bound to a device. The
> > driver "dfl-uio-pdev" doesn't provide an id_table, it could only be
> > bound to a device whose driver_override is set to "dfl-uio-pdev".
> > 
> > Sorry, this is actually not "normal". Usually dfl drivers with valid id_table
> > should be used to drive the dfl devices. But we also want to give an option
> > for userspace to take full control of the device, some IP blocks in FPGA are
> > written for specific purposes by FPGA user so a userspace driver may
> > serve them better.
> > 
> > > 
> > > And you better not say userspace is responsible for it...
> > 
> > Actually it is the userspace's decision which device they want to
> > access directly ...
> > 
> > I'm not sure if this idea is OK. I see similar implementation for
> > pci/platform devices.
> 
> That is there for debugging and for being able to support things when
> the kernel is not updated with a new device id yet.

We are trying to use the driver_override for similar purposes on FPGA.
The FPGA card could be reprogramed with a newly developed Hardware
component by users. Sometimes only the FPGA users know which dfl device
they want to operate on. This is why we give the option to users for
direct I/O access.

Also FPGA users have the requirement for diagnostic of the newly
developed components.

It is possible we define an id_table for dfl_uio_pdev driver, but then
users have to modify the driver code everytime they create & reprogram
a new HW component.

> 
> The virtio people took this to a new extreme and use it to bind real
> devices through to virtual machines, but really, that's horrid.  And
> they have problems with it as is seen in random patches at times.

Sorry I didn't have much knowledge on this.
Does the sysfs 'driver_override' or 'new_id' have problems, or the
userspace direct I/O access mechanism (UIO/VFIO) has problems?

If it is the former, I could consider some other way to generate the UIO
devices for DFL. But could you help specify more about the issues?

Thanks very much,
Yilun

> 
> Don't make this the only way to support this, that's not an ok api.
> 
> greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ