[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0901121128470.30369@quilx.com>
Date: Mon, 12 Jan 2009 11:33:49 -0600 (CST)
From: Christoph Lameter <cl@...ux-foundation.org>
To: Ingo Molnar <mingo@...e.hu>
cc: Rusty Russell <rusty@...tcorp.com.au>, akpm@...ux-foundation.org,
torvalds@...ux-foundation.org, andi@...stfloor.org,
ak@...ux.intel.com, rth@...ddle.net, sfr@...b.auug.org.au,
travis@....com, linux-kernel@...r.kernel.org
Subject: Re: [patch 2/8] compiler-gcc.h: add more comments to RELOC_HIDE
On Sat, 10 Jan 2009, Ingo Molnar wrote:
> 2) Special structure sizes
>
> For example we want to load a value from "&var + LARGE_OFFSET" (common
> percpu construct). If 'var' is a C structure that happens to have a size
> of 255 bytes, then GCC could legitimately assume that 'LARGE_OFFSET' is
> 0..255 [inclusive], and could optimize LARGE_OFFSET to be truncated to a
> single byte.
But that is not what is occurring. We do not do &var + LARGE_OFFSET.
Instead one does
((void *)&var) + LARGE_OFFSET
or
((unsigned long)&var) + LARGE_OFFSET
The cast should cause the C compiler to drop all assumptions about size.
And the definition of RELOC_HIDE for icc and generic compilers in the tree
show that this is working.
--
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