RISC-V: fix virtual address overlapped in FIXADDR_START and VMEMMAP_START

This patch fixes the virtual address layout in pgtable.h. The virtual
address of FIXADDR_START and VMEMMAP_START should not be overlapped.

Fixes: d95f1a542c3d ("RISC-V: Implement sparsemem")
Signed-off-by: Greentime Hu <greentime.hu@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
[paul.walmsley@sifive.com: fixed patch description]
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>

authored by Greentime Hu and committed by Paul Walmsley 5bf4e52f 4c8eb19c

Changed files
+8 -8
arch
riscv
include
asm
+8 -8
arch/riscv/include/asm/pgtable.h
··· 87 87 #define VMALLOC_END (PAGE_OFFSET - 1) 88 88 #define VMALLOC_START (PAGE_OFFSET - VMALLOC_SIZE) 89 89 90 - #define FIXADDR_TOP VMALLOC_START 91 - #ifdef CONFIG_64BIT 92 - #define FIXADDR_SIZE PMD_SIZE 93 - #else 94 - #define FIXADDR_SIZE PGDIR_SIZE 95 - #endif 96 - #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) 97 - 98 90 /* 99 91 * Roughly size the vmemmap space to be large enough to fit enough 100 92 * struct pages to map half the virtual address space. Then ··· 99 107 #define VMEMMAP_START (VMALLOC_START - VMEMMAP_SIZE) 100 108 101 109 #define vmemmap ((struct page *)VMEMMAP_START) 110 + 111 + #define FIXADDR_TOP (VMEMMAP_START) 112 + #ifdef CONFIG_64BIT 113 + #define FIXADDR_SIZE PMD_SIZE 114 + #else 115 + #define FIXADDR_SIZE PGDIR_SIZE 116 + #endif 117 + #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) 102 118 103 119 /* 104 120 * ZERO_PAGE is a global shared page that is always zero,