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: <1359564809.32305.23.camel@joe-AO722>
Date:	Wed, 30 Jan 2013 08:53:29 -0800
From:	Joe Perches <joe@...ches.com>
To:	Russell King - ARM Linux <linux@....linux.org.uk>
Cc:	Julia Lawall <julia.lawall@...6.fr>, walter harms <wharms@....de>,
	Mike Rapoport <mike@...pulab.co.il>, Valdis.Kletnieks@...edu,
	cocci@...teme.lip6.fr, Dan Carpenter <dan.carpenter@...cle.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jiri Slaby <jslaby@...e.cz>,
	Paul Fulghum <paulkf@...rogate.com>,
	David Howells <dhowells@...hat.com>,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: coccinelle and bitmask arithmetic

On Wed, 2013-01-30 at 11:35 +0000, Russell King - ARM Linux wrote:
> On Wed, Jan 30, 2013 at 12:21:21PM +0100, Julia Lawall wrote:
> > On Wed, 30 Jan 2013, Russell King - ARM Linux wrote:
> > > So, _either_ logical OR or addition works.
> > >
> > > If we _did_ end up with a PHYS_OFFSET with bits less than bit 26 set
> > > here, we'd have bigger problems - because the base of RAM in PCI space
> > > will not correspond with PHYS_OFFSET and all the DMA mapping stuff breaks.
> > 
> > The "problem" is that the computation is done inconsistently within the
> > same file.  Sometimes with + and sometimes with |.
> 
> And I say that is not a problem; if it _does_ become a problem, there are
> bigger problems that would also need solving, which given a multi-subarch
> kernel become a lot lot harder.
> 
> Sure, we can just change them to all be a bitwise OR (sorry, not logical)
> but that's really only half the story.

As far as I can tell, there'd be a lot of +'s to
change in arch/arm and only 2 uses of | in it8152.c

$ git grep -P "\(?\s*SZ_\d+[A-Z]\s*-\s*1\s*\)?\s*\|" arch/arm
arch/arm/common/it8152.c:                       *dev->dma_mask = (SZ_64M - 1) | PHYS_OFFSET;
arch/arm/common/it8152.c:               dev->coherent_dma_mask = (SZ_64M - 1) | PHYS_OFFSET;

$ git grep -P "\+\s*\(?\s*SZ_\d+[A-Z]\b\s*-\s*1\s*\)?" arch/arm | wc -l
460

I think consistently using + would make it simpler
for some possible future conversion.

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