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: <20080709185055.3b47c4db@infradead.org>
Date:	Wed, 9 Jul 2008 18:50:55 -0700
From:	Arjan van de Ven <arjan@...radead.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Joerg Roedel <joerg.roedel@....com>, tglx@...utronix.de,
	mingo@...hat.com, linux-kernel@...r.kernel.org,
	iommu@...ts.linux-foundation.org, bhavna.sarathy@....com,
	Sebastian.Biemueller@....com, robert.richter@....com,
	joro@...tes.org
Subject: Re: [PATCH 02/34] AMD IOMMU: add header file for driver data
 structures and defines

On Wed, 9 Jul 2008 18:38:23 -0700
Andrew Morton <akpm@...ux-foundation.org> wrote:

> On Thu, 26 Jun 2008 21:27:38 +0200 Joerg Roedel
> <joerg.roedel@....com> wrote:
> 
> > +/* helper macros */
> > +#define LOW_U32(x) ((x) & ((1ULL << 32)-1))
> > +#define HIGH_U32(x) (LOW_U32((x) >> 32))
> 
> Please avoid putting general-purpose helpers into private header
> files.

especially broken helpers.

A >> 32 on something that may be a 32 bit entry is bad; int32 >> 32...
gcc can (and does!) optimize that out.

(because it first gets translated into a SHR x86 instruction which then
notices it's encoded as a zero shift.. which then gets deleted)



-- 
If you want to reach me at my work email, use arjan@...ux.intel.com
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org
--
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