Commit 5bf4e52f authored by Greentime Hu's avatar Greentime Hu Committed by Paul Walmsley

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: d95f1a54 ("RISC-V: Implement sparsemem")
Signed-off-by: default avatarGreentime Hu <greentime.hu@sifive.com>
Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
[paul.walmsley@sifive.com: fixed patch description]
Signed-off-by: default avatarPaul Walmsley <paul.walmsley@sifive.com>
parent 4c8eb19c
...@@ -87,14 +87,6 @@ extern pgd_t swapper_pg_dir[]; ...@@ -87,14 +87,6 @@ extern pgd_t swapper_pg_dir[];
#define VMALLOC_END (PAGE_OFFSET - 1) #define VMALLOC_END (PAGE_OFFSET - 1)
#define VMALLOC_START (PAGE_OFFSET - VMALLOC_SIZE) #define VMALLOC_START (PAGE_OFFSET - VMALLOC_SIZE)
#define FIXADDR_TOP VMALLOC_START
#ifdef CONFIG_64BIT
#define FIXADDR_SIZE PMD_SIZE
#else
#define FIXADDR_SIZE PGDIR_SIZE
#endif
#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
/* /*
* Roughly size the vmemmap space to be large enough to fit enough * Roughly size the vmemmap space to be large enough to fit enough
* struct pages to map half the virtual address space. Then * struct pages to map half the virtual address space. Then
...@@ -108,6 +100,14 @@ extern pgd_t swapper_pg_dir[]; ...@@ -108,6 +100,14 @@ extern pgd_t swapper_pg_dir[];
#define vmemmap ((struct page *)VMEMMAP_START) #define vmemmap ((struct page *)VMEMMAP_START)
#define FIXADDR_TOP (VMEMMAP_START)
#ifdef CONFIG_64BIT
#define FIXADDR_SIZE PMD_SIZE
#else
#define FIXADDR_SIZE PGDIR_SIZE
#endif
#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
/* /*
* ZERO_PAGE is a global shared page that is always zero, * ZERO_PAGE is a global shared page that is always zero,
* used for zero-mapped memory areas, etc. * used for zero-mapped memory areas, etc.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment