Skip to content

Commit 7cc8c75

Browse files
AlexGhitipalmer-dabbelt
authored andcommitted
riscv: Make vmalloc/vmemmap end equal to the start of the next region
We used to define VMALLOC_END equal to the start of the next region *minus one* which is inconsistent with the use of this define in the core code (for example, see the definitions of VMALLOC_TOTAL and is_vmalloc_addr). And then make the definition of VMEMMAP_END consistent with VMALLOC_END and all other regions actually. Signed-off-by: Alexandre Ghiti <[email protected]> Reviewed-by: Jisheng Zhang <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 1f77ed9 commit 7cc8c75

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

arch/riscv/include/asm/pgtable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#endif
2626

2727
#define VMALLOC_SIZE (KERN_VIRT_SIZE >> 1)
28-
#define VMALLOC_END (PAGE_OFFSET - 1)
28+
#define VMALLOC_END PAGE_OFFSET
2929
#define VMALLOC_START (PAGE_OFFSET - VMALLOC_SIZE)
3030

3131
#define BPF_JIT_REGION_SIZE (SZ_128M)
@@ -51,7 +51,7 @@
5151
#define VMEMMAP_SHIFT \
5252
(CONFIG_VA_BITS - PAGE_SHIFT - 1 + STRUCT_PAGE_MAX_SHIFT)
5353
#define VMEMMAP_SIZE BIT(VMEMMAP_SHIFT)
54-
#define VMEMMAP_END (VMALLOC_START - 1)
54+
#define VMEMMAP_END VMALLOC_START
5555
#define VMEMMAP_START (VMALLOC_START - VMEMMAP_SIZE)
5656

5757
/*

arch/riscv/mm/fault.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
235235
* only copy the information from the master page table,
236236
* nothing more.
237237
*/
238-
if (unlikely((addr >= VMALLOC_START) && (addr <= VMALLOC_END))) {
238+
if (unlikely((addr >= VMALLOC_START) && (addr < VMALLOC_END))) {
239239
vmalloc_fault(regs, code, addr);
240240
return;
241241
}

0 commit comments

Comments
 (0)