[PATCH] D46456: [asan] Add support for Myriad RTEMS memory map
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 11 11:20:26 PDT 2018
vitalybuka added inline comments.
================
Comment at: compiler-rt/lib/asan/asan_mapping.h:201
+# elif SANITIZER_MYRIAD2
+# define SHADOW_OFFSET kMyriadShadowOffset32
# else
----------------
please define SHADOW_SCALE here
================
Comment at: compiler-rt/lib/asan/asan_mapping.h:294
#if ASAN_FIXED_MAPPING
+#if SANITIZER_MYRIAD2
+static uptr kHighMemEnd = 0;
----------------
you can use ASAN_FIXED_MAPPING and platform specific FindDynamicShadowStart()
================
Comment at: compiler-rt/lib/asan/asan_mapping.h:311
+static inline uptr RawAddr(uptr a) {
+ return SANITIZER_MYRIAD2 ? (a & ~kMyriadCacheBitMask32) : a;
+}
----------------
what is this for?
================
Comment at: compiler-rt/lib/asan/asan_mapping.h:329
+ a = RawAddr(a);
+ return kHighMemBeg && a >= kHighMemBeg && a <= kHighMemEnd;
}
----------------
Instead of checking kHighMemBeg here, can you just set kHighMemEnd = kHighMemBeg - 1
================
Comment at: compiler-rt/lib/asan/asan_poisoning.cc:187
+ // On Myriad, address not in DRAM range need to be treated as
+ // unpoisoned.
+ if (!AddrIsInMem(beg) && !AddrIsInShadow(beg)) return 0;
----------------
Why do you need to check AddrIsInShadow here? Could you make sure that ranges set so that not DRAM is not AddrIsInMem
Repository:
rL LLVM
https://reviews.llvm.org/D46456
More information about the llvm-commits
mailing list