Skip to content

Commit 01472d8

Browse files
authored
[NFC][asan] Update shadow mapping comments for AArch64 non-Android Linux (#152412)
This adds commentary to explain why ASan does not work for AArch64 non-Android Linux with 39-bit and 42-bit VMAs (e.g., #145259). Additionally, it updates the 42-bit VMA shadow map comment, which has been outdated for the last 10 years (18b2258 changed 39-bit and 42-bit to use the same offset), and adds a comment for the 48-bit VMA shadow map.
1 parent 886b213 commit 01472d8

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

compiler-rt/lib/asan/asan_mapping.h

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,29 @@
8383
// || `[0x0000000000, 0x0d5554ffff]` || LowMem ||
8484
//
8585
// Default Linux/AArch64 (39-bit VMA) mapping:
86-
// || `[0x2000000000, 0x7fffffffff]` || highmem ||
87-
// || `[0x1400000000, 0x1fffffffff]` || highshadow ||
88-
// || `[0x1200000000, 0x13ffffffff]` || shadowgap ||
89-
// || `[0x1000000000, 0x11ffffffff]` || lowshadow ||
90-
// || `[0x0000000000, 0x0fffffffff]` || lowmem ||
86+
// TODO: this mapping is ok, but the allocator size is too large on non-Android
87+
// AArch64 platforms (see asan_allocator.h)
88+
// || `[0x2000000000, 0x7fffffffff]` || highmem || 384GB
89+
// || `[0x1400000000, 0x1fffffffff]` || highshadow || 48GB
90+
// || `[0x1200000000, 0x13ffffffff]` || shadowgap || 8GB
91+
// || `[0x1000000000, 0x11ffffffff]` || lowshadow || 8GB
92+
// || `[0x0000000000, 0x0fffffffff]` || lowmem || 64GB
9193
//
9294
// Default Linux/AArch64 (42-bit VMA) mapping:
93-
// || `[0x10000000000, 0x3ffffffffff]` || highmem ||
94-
// || `[0x0a000000000, 0x0ffffffffff]` || highshadow ||
95-
// || `[0x09000000000, 0x09fffffffff]` || shadowgap ||
96-
// || `[0x08000000000, 0x08fffffffff]` || lowshadow ||
97-
// || `[0x00000000000, 0x07fffffffff]` || lowmem ||
95+
// TODO: this mapping is ok, but the allocator size is too large on non-Android
96+
// AArch64 platforms (see asan_allocator.h)
97+
// || `[0x09000000000, 0x03ffffffffff]` || highmem || 3520GB
98+
// || `[0x02200000000, 0x008fffffffff]` || highshadow || 440GB
99+
// || `[0x01200000000, 0x0021ffffffff]` || shadowgap || 64GB
100+
// || `[0x01000000000, 0x0011ffffffff]` || lowshadow || 8GB
101+
// || `[0x00000000000, 0x000fffffffff]` || lowmem || 64GB
102+
//
103+
// Default Linux/AArch64 (48-bit VMA) mapping:
104+
// || `[0x201000000000, 0xffffffffffff]` || HighMem || 229312GB
105+
// || `[0x041200000000, 0x200fffffffff]` || HighShadow || 28664GB
106+
// || `[0x001200000000, 0x0411ffffffff]` || ShadowGap || 4096GB
107+
// || `[0x001000000000, 0x0011ffffffff]` || LowShadow || 8GB
108+
// || `[0x000000000000, 0x000fffffffff]` || LowMem || 64GB
98109
//
99110
// Default Linux/S390 mapping:
100111
// || `[0x30000000, 0x7fffffff]` || HighMem ||

0 commit comments

Comments
 (0)