riscv: Use global mappings for kernel pages

We map kernel pages into all addresses spages, so they can be marked as
global.  This allows hardware to avoid flushing the kernel mappings when
moving between address spaces.

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
[Palmer: commit text]
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
This commit is contained in:
Guo Ren 2021-05-26 05:49:20 +00:00 committed by Palmer Dabbelt
parent 7fa865f564
commit cba43c31f1
No known key found for this signature in database
GPG Key ID: 2E1319F35FBB1889

View File

@ -134,7 +134,8 @@
| _PAGE_WRITE \ | _PAGE_WRITE \
| _PAGE_PRESENT \ | _PAGE_PRESENT \
| _PAGE_ACCESSED \ | _PAGE_ACCESSED \
| _PAGE_DIRTY) | _PAGE_DIRTY \
| _PAGE_GLOBAL)
#define PAGE_KERNEL __pgprot(_PAGE_KERNEL) #define PAGE_KERNEL __pgprot(_PAGE_KERNEL)
#define PAGE_KERNEL_READ __pgprot(_PAGE_KERNEL & ~_PAGE_WRITE) #define PAGE_KERNEL_READ __pgprot(_PAGE_KERNEL & ~_PAGE_WRITE)