diff options
author | Bibo Mao <maobibo@loongson.cn> | 2023-09-06 16:53:10 +0200 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2023-09-06 16:53:10 +0200 |
commit | 0921af6ccfb37dc2d6aefcf744333c14e7ca739d (patch) | |
tree | 4bdb59dc579e6b2a98fe02142261a629cb22469d /arch/loongarch/include/asm/pgtable.h | |
parent | LoongArch: mm: Introduce unified function populate_kernel_pte() (diff) | |
download | linux-0921af6ccfb37dc2d6aefcf744333c14e7ca739d.tar.xz linux-0921af6ccfb37dc2d6aefcf744333c14e7ca739d.zip |
LoongArch: Use static defined zero page rather than allocated
On LoongArch system, there is only one page needed for zero page (no
cache synonyms), and there is no COLOR_ZERO_PAGE, so zero_page_mask is
useless and the macro __HAVE_COLOR_ZERO_PAGE is not necessary.
Like other popular architectures, It is simpler to define the zero page
in kernel BSS code segment rather than dynamically allocate.
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/include/asm/pgtable.h')
-rw-r--r-- | arch/loongarch/include/asm/pgtable.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/loongarch/include/asm/pgtable.h b/arch/loongarch/include/asm/pgtable.h index 0ac6afa4a825..7699af049443 100644 --- a/arch/loongarch/include/asm/pgtable.h +++ b/arch/loongarch/include/asm/pgtable.h @@ -70,12 +70,9 @@ struct vm_area_struct; * for zero-mapped memory areas etc.. */ -extern unsigned long empty_zero_page; -extern unsigned long zero_page_mask; +extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]; -#define ZERO_PAGE(vaddr) \ - (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask)))) -#define __HAVE_COLOR_ZERO_PAGE +#define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page) /* * TLB refill handlers may also map the vmalloc area into xkvrange. |