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: <20150323171725.5c459dec.cornelia.huck@de.ibm.com>
Date:	Mon, 23 Mar 2015 17:17:25 +0100
From:	Cornelia Huck <cornelia.huck@...ibm.com>
To:	Gerd Hoffmann <kraxel@...hat.com>
Cc:	"Michael S. Tsirkin" <mst@...hat.com>,
	virtio-dev@...ts.oasis-open.org,
	open list <linux-kernel@...r.kernel.org>,
	"open list:ABI/API" <linux-api@...r.kernel.org>,
	virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH 1/1] Add virtio-input driver.

On Mon, 23 Mar 2015 16:05:29 +0100
Gerd Hoffmann <kraxel@...hat.com> wrote:

> On Mo, 2015-03-23 at 15:54 +0100, Michael S. Tsirkin wrote:
> > On Mon, Mar 23, 2015 at 03:27:35PM +0100, Gerd Hoffmann wrote:
> > >   Hi,
> > > 
> > > > > > > You are doing leXXX everywhere, that's VERSION_1 dependency.
> > > > > > > virtio_cread will do byteswaps differently without VERSION_1.
> > > > > > > Just don't go there.
> > > 
> > > > So to clarify, you dislike using __virtio32 in virtio input header?
> > > 
> > > Well, as I understand things __virtio32 implies byteorder depends on
> > > whenever we are using VERSION_1 or not.  And non-transitional drivers
> > > should not need it as everything is by definition little endian.
> > > 
> > > So, yes, your suggestion to just require VERSION_1 in the driver implies
> > > in my eyes that there should be no reason to use __virtio32 instead of
> > > __le32.
> > > 
> > > Or do I miss something here?
> > > 
> > > cheers,
> > >   Gerd
> > > 
> > 
> > You are right but then if you do require VERSION_1 then
> > __virtio32 becomes identical to __le32.
> 
> Except that sparse doesn't know that and throws errors when I mix the
> two.
> 
> > There's some runtime overhead as we check on each access,
> > but it shouldn't matter here, right?
> 
> Correct, config space is used at initialization time only.
> 
> > I guess we could add virtio_cread_le - is this what
> > you'd like?
> 
> I just want something that makes both you and sparse happy.  I don't
> care much whenever that is adding virtio_cread_le() or using __virtio32
> even though it'll effectively is __le32 due to VERSION_1 being required.

I think it is clearer if you use __virtio32: The fact that virtio-input
is VERSION_1 only is not apparent from looking at the config space
definition, and explicitly forcing le accesses makes it look similar to
the oddballs like virtio-balloon. Just my two cents.

--
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