linux/arch/powerpc
Paul Mackerras bdbc29c19b powerpc: Work around gcc miscompilation of __pa() on 64-bit
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.)

CC: <stable@vger.kernel.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-27 16:59:30 +10:00
..
boot powerpc: Add T4 LAC device tree binding & defs 2013-06-24 19:52:36 -05:00
configs PCI: hotplug: Convert to be builtin only, not modular 2013-07-25 14:11:06 -06:00
crypto powerpc: Fix compile of sha1-powerpc-asm.S on 32-bit 2013-03-05 16:56:26 +11:00
include powerpc: Work around gcc miscompilation of __pa() on 64-bit 2013-08-27 16:59:30 +10:00
kernel powerpc: Don't Oops when accessing /proc/powerpc/lparcfg without hypervisor 2013-08-27 16:38:33 +10:00
kvm powerpc/kvm/book3s_pr: Return appropriate error when allocation fails 2013-08-09 18:06:54 +10:00
lib powerpc: Fix single step emulation of 32bit overflowed branches 2013-06-20 16:55:13 +10:00
math-emu powerpc/math-emu: Fix decoding of some instructions 2013-06-20 17:05:05 +10:00
mm powerpc: VPHN topology change updates all siblings 2013-08-01 13:11:47 +10:00
net ppc: bpf_jit: can call module_free() from any context 2013-05-20 14:03:50 -07:00
oprofile Merge branch 'merge' into next 2013-01-29 11:33:37 +11:00
perf powerpc/perf: Export PERF_EVENT_CONFIG_EBB_SHIFT to userspace 2013-08-01 13:11:46 +10:00
platforms powerpc/pseries: Add backward compatibilty to read old kernel oops-log 2013-08-09 18:06:44 +10:00
sysdev Merge remote-tracking branch 'scott/next' into next 2013-07-02 17:42:17 +10:00
xmon Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2013-05-02 10:16:16 -07:00
Kconfig powerpc: Work around gcc miscompilation of __pa() on 64-bit 2013-08-27 16:59:30 +10:00
Kconfig.debug Merge branch 'kconfig-diet' from Dave Hansen 2013-07-04 11:25:51 -07:00
Makefile
relocs_check.pl Fix warning typo "CONFIG_RELCOATABLE" 2013-05-29 15:11:30 +02:00