[ASan] Add shadow offset for SystemZ.
authorMarcin Koscielnicki <koriakin@0x04.net>
Sat, 30 Apr 2016 09:57:34 +0000 (09:57 +0000)
committerMarcin Koscielnicki <koriakin@0x04.net>
Sat, 30 Apr 2016 09:57:34 +0000 (09:57 +0000)
commit57290f934abbb5c115efc067d68636ecb0741f1e
treebd10b86282950dc03c3c95eca508a6c98d961349
parent30cba35a8408e7d124b89ceec663c1dde89eb566
[ASan] Add shadow offset for SystemZ.

SystemZ on Linux currently has 53-bit address space.  In theory, the hardware
could support a full 64-bit address space, but that's not supported due to
kernel limitations (it'd require 5-level page tables), and there are no plans
for that.  The default process layout stays within first 4TB of address space
(to avoid creating 4-level page tables), so any offset >= (1 << 42) is fine.
Let's use 1 << 52 here, ie. exactly half the address space.

I've originally used 7 << 50 (uses top 1/8th of the address space), but ASan
runtime assumes there's some space after the shadow area.  While this is
fixable, it's simpler to avoid the issue entirely.

Also, I've originally wanted to have the shadow aligned to 1/8th the address
space, so that we can use OR like X86 to assemble the offset.  I no longer
think it's a good idea, since using ADD enables us to load the constant just
once and use it with register + register indexed addressing.

Differential Revision: http://reviews.llvm.org/D19650

llvm-svn: 268161
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp