This patch adds 48-bits VMA support for tsan on aarch64. As current
mappings for aarch64, 48-bit VMA also supports PIE executable. This
limits the mapping mechanism because the PIE address bits
(usually 0aaaaXXXXXXXX) makes it harder to create a mask/xor value
to include all memory regions. I think it is possible to create a
large application VAM range by either dropping PIE support or tune
current range.
The patch also remove the heap accounting and checking if the architecture
does not uses 64-bit size allocator. This is due the fact heap VAM
range is used only for the allocator on TSAN, so this allows use the
range for application usage.
It also changes slight the way addresses are packed in SyncVar structure:
previously it assumes x86_64 as the maximum VMA range. Since ID is 14 bits
wide, shifting 48 bits should be ok.
Tested on x86_64, ppc64le and aarch64 (39 and 48 bits VMA).
I see that kHeapMemBeg/End situation is quite inconsistent across mappings. E.g. aarch64/42vma reserves a non-empty range for heap:
But it is actually unused.
I see ways to get situation under control: