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: <20141126165653.GB11202@redhat.com>
Date:	Wed, 26 Nov 2014 18:56:53 +0200
From:	"Michael S. Tsirkin" <mst@...hat.com>
To:	Greg Kurz <gkurz@...ux.vnet.ibm.com>
Cc:	linux-kernel@...r.kernel.org, rusty@....ibm.com,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	Sudeep Dutt <sudeep.dutt@...el.com>,
	virtualization@...ts.linux-foundation.org,
	linux-s390@...r.kernel.org, lguest@...ts.ozlabs.org,
	Pawel Moll <pawel.moll@....com>,
	Christian Borntraeger <borntraeger@...ibm.com>,
	Joel Stanley <joel@....id.au>, Arnd Bergmann <arnd@...db.de>,
	Siva Yerramreddy <yshivakrishna@...il.com>,
	Martin Schwidefsky <schwidefsky@...ibm.com>,
	pbonzini@...hat.com, Brian Swetland <swetland@...gle.com>,
	Ashutosh Dixit <ashutosh.dixit@...el.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Amit Shah <amit.shah@...hat.com>, linux390@...ibm.com,
	David Miller <davem@...emloft.net>
Subject: Re: [PATCH v4 02/42] virtio: add support for 64 bit features.

On Wed, Nov 26, 2014 at 05:48:09PM +0100, Greg Kurz wrote:
> On Tue, 25 Nov 2014 18:41:22 +0200
> "Michael S. Tsirkin" <mst@...hat.com> wrote:
> 
> > From: Rusty Russell <rusty@...tcorp.com.au>
> > 
> > Change the u32 to a u64, and make sure to use 1ULL everywhere!
> > 
> > Cc: Brian Swetland <swetland@...gle.com>
> > Cc: Christian Borntraeger <borntraeger@...ibm.com>
> > [Thomas Huth: fix up virtio-ccw get_features]
> > Signed-off-by: Rusty Russell <rusty@...tcorp.com.au>
> > Signed-off-by: Cornelia Huck <cornelia.huck@...ibm.com>
> > Acked-by: Pawel Moll <pawel.moll@....com>
> > Acked-by: Ohad Ben-Cohen <ohad@...ery.com>
> > 
> > Signed-off-by: Michael S. Tsirkin <mst@...hat.com>

...

> > @@ -86,14 +86,14 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev,
> >  {
> >  	/* Did you forget to fix assumptions on max features? */
> >  	if (__builtin_constant_p(fbit))
> > -		BUILD_BUG_ON(fbit >= 32);
> > +		BUILD_BUG_ON(fbit >= 64);
> 
> 
> While you're here, maybe you could derive the max value from the .features field ?
> 
> -               BUILD_BUG_ON(fbit >= 64);
> +               BUILD_BUG_ON(fbit >= (sizeof(vdev->features) << 3));

I don't see how that will help.
All that 1ULL math only works up to 64 bit.
So this only makes it look like we support any size,
but doesn't really.

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