Files
linux/arch/powerpc/include/asm
Paul Mackerras 45fe50ea3d powerpc: Work around gcc miscompilation of __pa() on 64-bit
commit bdbc29c19b upstream.

On 64-bit, __pa(&static_var) gets miscompiled by recent versions of
gcc as something like:

        addis 3,2,.LANCHOR1+4611686018427387904@toc@ha
        addi 3,3,.LANCHOR1+4611686018427387904@toc@l

This ends up effectively ignoring the offset, since its bottom 32 bits
are zero, and means that the result of __pa() still has 0xC in the top
nibble.  This happens with gcc 4.8.1, at least.

To work around this, for 64-bit we make __pa() use an AND operator,
and for symmetry, we make __va() use an OR operator.  Using an AND
operator rather than a subtraction ends up with slightly shorter code
since it can be done with a single clrldi instruction, whereas it
takes three instructions to form the constant (-PAGE_OFFSET) and add
it on.  (Note that MEMORY_START is always 0 on 64-bit.)

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-07 22:09:57 -07:00
..
2012-03-28 18:30:02 +01:00
2012-03-28 18:30:02 +01:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2012-07-10 19:18:59 +10:00
2013-04-18 13:03:53 +10:00
2013-04-26 16:08:16 +10:00
2011-07-26 16:49:47 -07:00
2012-03-28 18:30:02 +01:00
2011-11-08 14:51:46 +11:00
2012-03-20 21:48:30 +08:00
2013-04-18 13:03:53 +10:00
2011-12-08 14:02:23 +11:00
2011-05-22 08:47:53 -04:00
2010-06-09 11:12:36 +02:00
2011-07-26 16:49:47 -07:00
2010-05-05 09:11:10 -04:00
2012-11-15 13:00:45 +11:00
2011-03-31 11:26:23 -03:00
2010-10-26 16:52:08 -07:00
2011-03-31 11:26:23 -03:00
2009-12-09 17:10:37 +11:00
2011-09-20 09:19:40 +10:00
2013-02-13 12:56:42 +01:00
2010-03-05 03:04:08 -06:00
2011-04-20 17:01:19 +10:00
2012-09-17 16:31:51 +10:00
2011-03-31 11:26:23 -03:00
2013-05-08 06:36:49 +10:00
2011-03-31 11:26:23 -03:00
2012-07-11 14:18:40 +10:00
2011-05-06 13:32:35 +10:00