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:	Thu, 10 Oct 2013 10:27:10 -0500
From:	Scott Wood <scottwood@...escale.com>
To:	Bhushan Bharat-R65777 <R65777@...escale.com>
CC:	Kim Phillips <kim.phillips@...aro.org>,
	Wood Scott-B07421 <B07421@...escale.com>,
	Yoder Stuart-B08248 <B08248@...escale.com>,
	"christoffer.dall@...aro.org" <christoffer.dall@...aro.org>,
	"alex.williamson@...hat.com" <alex.williamson@...hat.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"a.motakis@...tualopensystems.com" <a.motakis@...tualopensystems.com>,
	"agraf@...e.de" <agraf@...e.de>,
	Sethi Varun-B16395 <B16395@...escale.com>,
	"peter.maydell@...aro.org" <peter.maydell@...aro.org>,
	"santosh.shukla@...aro.org" <santosh.shukla@...aro.org>,
	"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
Subject: Re: RFC: (re-)binding the VFIO platform driver to a platform device

On Thu, 2013-10-10 at 03:01 -0500, Bhushan Bharat-R65777 wrote:
> 
> > -----Original Message-----
> > From: kvm-owner@...r.kernel.org [mailto:kvm-owner@...r.kernel.org] On Behalf Of
> > Kim Phillips
> > Sent: Thursday, October 10, 2013 8:36 AM
> > To: Wood Scott-B07421
> > Cc: Yoder Stuart-B08248; Wood Scott-B07421; christoffer.dall@...aro.org;
> > alex.williamson@...hat.com; linux-kernel@...r.kernel.org;
> > a.motakis@...tualopensystems.com; agraf@...e.de; Sethi Varun-B16395; Bhushan
> > Bharat-R65777; peter.maydell@...aro.org; santosh.shukla@...aro.org;
> > kvm@...r.kernel.org; gregkh@...uxfoundation.org
> > Subject: Re: RFC: (re-)binding the VFIO platform driver to a platform device
> > 
> > On Wed, 9 Oct 2013 15:03:19 -0500
> > Scott Wood <scottwood@...escale.com> wrote:
> > 
> > > On Wed, 2013-10-09 at 14:44 -0500, Yoder Stuart-B08248 wrote:
> > > > > From: Wood Scott-B07421
> > > > > Sent: Wednesday, October 09, 2013 2:22 PM
> > > > >
> > > > > On Wed, 2013-10-09 at 14:02 -0500, Yoder Stuart-B08248 wrote:
> > > > > > Have been thinking about this issue some more.  As Scott
> > > > > > mentioned,
> > 
> > thanks for bringing this up again.
> > 
> > > > > There's already a "bool suppress_bind_attrs" to prevent sysfs
> > > > > bind/unbind.  I suggested a similar flag to mean the oppsosite --
> > > > > bind
> > > > > *only* through sysfs.  Greg KH was skeptical and wanted to see a
> > > > > patch before any further discussion.
> > > >
> > > > Ah, think I understand now...yes that works as well, and would be
> > > > less intrustive.   So are you writing a patch? :)
> > >
> > > I've been meaning to since the previous round of discussion, but I've
> > > been busy.  Would someone else be able to test it in the context of
> > > using it for VFIO?
> > 
> > yes - see below.
> > 
> > > Otherwise, that looks about right, for the driver side (though
> > > driver_attach could error out earlier rather than testing it inside
> > > the loop).
> > 
> > I've made the changes you suggested and tested the resulting diff below on an
> > arndale board.  I successfully performed the following sequence of commands
> > after first changing the i2c@...80000 node in the device tree to be exclusively
> > compatible with "vfio":

This is not the intended usage.  Leave the device tree alone, add a
wildcard option to platform_match() and use it in VFIO, and set
drv->sysfs_bind_only in VFIO.

> > diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 73f6c29..da81442
> > 100644
> > --- a/drivers/base/bus.c
> > +++ b/drivers/base/bus.c
> > @@ -201,7 +201,8 @@ static ssize_t bind_store(struct device_driver *drv, const
> > char *buf,
> >  	int err = -ENODEV;
> > 
> >  	dev = bus_find_device_by_name(bus, NULL, buf);
> > -	if (dev && dev->driver == NULL && driver_match_device(drv, dev)) {
> > +	if (dev && dev->driver == NULL && (drv->sysfs_bind_only ||
> > +					   driver_match_device(drv, dev))) {
> 
> Should not we check 
>       if (dev && dev->driver == NULL &&
>           (device->explicit_bind_only && drv->explicit_bind_only) ||
>           driver_match_device(drv, dev)))

device->sysfs_bind_only would be a separate patch.

As for drv->sysfs_bind_only, that does not override
driver_match_device().  Wildcard matches are separate and are handled by
individual bus match functions.  This function does not need to be
changed at all for drv->sysfs_bind_only.

-Scott



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ