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: <20210913205429.GA1085962@roeck-us.net>
Date:   Mon, 13 Sep 2021 13:54:29 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     "Michael S. Tsirkin" <mst@...hat.com>
Cc:     Alexey Kardashevskiy <aik@...abs.ru>,
        Jason Wang <jasowang@...hat.com>,
        Rob Herring <robh+dt@...nel.org>,
        Arnd Bergmann <arnd@...nel.org>,
        Jean-Philippe Brucker <jean-philippe@...aro.org>,
        Viresh Kumar <viresh.kumar@...aro.org>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Bill Mills <bill.mills@...aro.org>,
        Alex Bennée <alex.bennee@...aro.org>,
        "Enrico Weigelt, metux IT consult" <info@...ux.net>,
        Jie Deng <jie.deng@...el.com>, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        virtualization@...ts.linux-foundation.org,
        Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH] virtio: don't fail on !of_device_is_compatible

On Mon, Sep 13, 2021 at 04:23:57PM -0400, Michael S. Tsirkin wrote:
> On Mon, Sep 13, 2021 at 06:47:52AM -0400, Michael S. Tsirkin wrote:
> > A recent change checking of_device_is_compatible on probe broke some
> > powerpc/pseries setups. Apparently there virtio devices do not have a
> > "compatible" property - they are matched by PCI vendor/device ids.
> > 
> > Let's just skip of_node setup but proceed with initialization like we
> > did previously.
> > 
> > Fixes: 694a1116b405 ("virtio: Bind virtio device to device-tree node")
> > Reported-by: Alexey Kardashevskiy <aik@...abs.ru>
> > Cc: Arnd Bergmann <arnd@...db.de>
> > Cc: Viresh Kumar <viresh.kumar@...aro.org>
> > Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
> > ---
> 
> 
> Guenter could you take a look at this patch pls? Does it help?
> 
> 
I confirmed that this patch fixes the problem. I replied in that thread.

Thanks,
Guenter

> 
> > Arnd could you help review this pls? Viresh is on vacation.
> > 
> >  drivers/virtio/virtio.c | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
> > index c46cc1fbc7ae..19a70a2361b4 100644
> > --- a/drivers/virtio/virtio.c
> > +++ b/drivers/virtio/virtio.c
> > @@ -347,8 +347,13 @@ static int virtio_device_of_init(struct virtio_device *dev)
> >  	ret = snprintf(compat, sizeof(compat), "virtio,device%x", dev->id.device);
> >  	BUG_ON(ret >= sizeof(compat));
> >  
> > +	/*
> > +	 * On powerpc/pseries virtio devices are PCI devices so PCI
> > +	 * vendor/device ids play the role of the "compatible" property.
> > +	 * Simply don't init of_node in this case.
> > +	 */
> >  	if (!of_device_is_compatible(np, compat)) {
> > -		ret = -EINVAL;
> > +		ret = 0;
> >  		goto out;
> >  	}
> >  
> > -- 
> > MST
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ