commit 2bfc6cd81bd1 ("riscv: Move kernel mapping outside of linear mapping") makes use of MODULES_VADDR to populate kernel, BPF, modules mapping. Currently, MODULES_VADDR is defined as below for RV64: | #define MODULES_VADDR (PFN_ALIGN((unsigned long)&_end) - SZ_2G) But kasan_init() has two local variables which are also named as _start, _end, so MODULES_VADDR is evaluated with the local variable _end rather than the global "_end" as we expected. Fix this issue by renaming the two local variables.
Unified · Split
| @@ -169,7 +169,7 @@ static void __init kasan_shallow_populate(void *start, void *end) · 168 unmodified lines | ||
| 169 | 169 | |
| 170 | 170 | void __init kasan_init(void) |
| 171 | 171 | { |
| 172 | − phys_addr_t _start, _end; | |
| 172 | + phys_addr_t p_start, p_end; | |
| 173 | 173 | u64 i; |
| 174 | 174 | |
| 175 | 175 | /* |
| @@ -189,9 +189,9 @@ void __init kasan_init(void) · 13 unmodified lines | ||
| 189 | 189 | (void *)kasan_mem_to_shadow((void *)VMALLOC_END)); |
| 190 | 190 | |
| 191 | 191 | /* Populate the linear mapping */ |
| 192 | − for_each_mem_range(i, &_start, &_end) { | |
| 193 | − void *start = (void *)__va(_start); | |
| 194 | − void *end = (void *)__va(_end); | |
| 192 | + for_each_mem_range(i, &p_start, &p_end) { | |
| 193 | + void *start = (void *)__va(p_start); | |
| 194 | + void *end = (void *)__va(p_end); | |
| 195 | 195 | |
| 196 | 196 | if (start >= end) |
| 197 | 197 | break; |