File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
llvm/lib/Transforms/Instrumentation Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 72
72
// || `[0x2000000000, 0x23ffffffff]` || LowShadow ||
73
73
// || `[0x0000000000, 0x1fffffffff]` || LowMem ||
74
74
//
75
- // Default Linux/RISCV64 Sv39 mapping:
75
+ // Default Linux/RISCV64 Sv39 mapping with SHADOW_OFFSET == 0xd55550000;
76
+ // (the exact location of SHADOW_OFFSET may vary depending the dynamic probing
77
+ // by FindDynamicShadowStart).
78
+ //
76
79
// || `[0x1555550000, 0x3fffffffff]` || HighMem ||
77
80
// || `[0x0fffffa000, 0x1555555fff]` || HighShadow ||
78
81
// || `[0x0effffa000, 0x0fffff9fff]` || ShadowGap ||
186
189
# elif SANITIZER_FREEBSD && defined(__aarch64__)
187
190
# define ASAN_SHADOW_OFFSET_CONST 0x0000800000000000
188
191
# elif SANITIZER_RISCV64
189
- # define ASAN_SHADOW_OFFSET_CONST 0x0000000d55550000
192
+ # define ASAN_SHADOW_OFFSET_DYNAMIC
190
193
# elif defined(__aarch64__)
191
194
# define ASAN_SHADOW_OFFSET_CONST 0x0000001000000000
192
195
# elif defined(__powerpc64__)
Original file line number Diff line number Diff line change @@ -1096,7 +1096,8 @@ uptr GetMaxVirtualAddress() {
1096
1096
# if SANITIZER_NETBSD && defined(__x86_64__)
1097
1097
return 0x7f7ffffff000ULL ; // (0x00007f8000000000 - PAGE_SIZE)
1098
1098
# elif SANITIZER_WORDSIZE == 64
1099
- # if defined(__powerpc64__) || defined(__aarch64__) || defined(__loongarch__)
1099
+ # if defined(__powerpc64__) || defined(__aarch64__) || \
1100
+ defined (__loongarch__) || SANITIZER_RISCV64
1100
1101
// On PowerPC64 we have two different address space layouts: 44- and 46-bit.
1101
1102
// We somehow need to figure out which one we are using now and choose
1102
1103
// one of 0x00000fffffffffffUL and 0x00003fffffffffffUL.
@@ -1105,9 +1106,8 @@ uptr GetMaxVirtualAddress() {
1105
1106
// This should (does) work for both PowerPC64 Endian modes.
1106
1107
// Similarly, aarch64 has multiple address space layouts: 39, 42 and 47-bit.
1107
1108
// loongarch64 also has multiple address space layouts: default is 47-bit.
1109
+ // RISC-V 64 also has multiple address space layouts: 39, 48 and 57-bit.
1108
1110
return (1ULL << (MostSignificantSetBitIndex (GET_CURRENT_FRAME ()) + 1 )) - 1 ;
1109
- # elif SANITIZER_RISCV64
1110
- return (1ULL << 38 ) - 1 ;
1111
1111
# elif SANITIZER_MIPS64
1112
1112
return (1ULL << 40 ) - 1 ; // 0x000000ffffffffffUL;
1113
1113
# elif defined(__s390x__)
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ static const uint64_t kMIPS32_ShadowOffset32 = 0x0aaa0000;
107
107
static const uint64_t kMIPS64_ShadowOffset64 = 1ULL << 37 ;
108
108
static const uint64_t kAArch64_ShadowOffset64 = 1ULL << 36 ;
109
109
static const uint64_t kLoongArch64_ShadowOffset64 = 1ULL << 46 ;
110
- static const uint64_t kRISCV64_ShadowOffset64 = 0xd55550000 ;
110
+ static const uint64_t kRISCV64_ShadowOffset64 = kDynamicShadowSentinel ;
111
111
static const uint64_t kFreeBSD_ShadowOffset32 = 1ULL << 30 ;
112
112
static const uint64_t kFreeBSD_ShadowOffset64 = 1ULL << 46 ;
113
113
static const uint64_t kFreeBSDAArch64_ShadowOffset64 = 1ULL << 47 ;
You can’t perform that action at this time.
0 commit comments