[PATCH] D12707: [PATCH] [sanitizers] Add MSan support for AArch64

Adhemerval Zanella via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 05:43:18 PDT 2015


zatrazz added a comment.

> It should be possible to have a single runtime library that would detect VMA at runtime. Maybe it would cost us a percent or two of performance.


The performance issue is not the runtime detection, but how to disentangle all the macros and one VMA assumption
in sanitizer code. The MSAN compiler-rt patch relies on define both the internal allocator (which can be SizeClassAllocator32
or SizeClassAllocator64 depending of the available VMA size) and transformation macros (MEM_TO_SHADOW) that are
used extensively in a lot of places.

And there is the question if this work will be really useful, since the idea is indeed to have only one VMA as default (48-bit
for aarch64).

> Having said that, I don't think this macro, as it is, would cause us any problems in practice, and I don't mind if you go ahead with this patch.

> 

> Two questions:

> 

> Does lower VMA setting work on kernels configured for higher VMA, or does it have to be an exact match?


It must be a exact match because compiler-rt sanitizer libraries mmap specific areas for shadow and origin memory
and they are calculated based on where the user regions are placed. For instance, for 39-bit VMA some text segment
is expected to be between 0x7000000000-0x8000000000 where for 42-bit VMA 0x3f000000000-0x40000000000. This
generates complete different mappings.

> is there a runtime check for an incompatible or suboptimal VMA setting?


Not right now, but it is something I will implement.


http://reviews.llvm.org/D12707





More information about the llvm-commits mailing list