-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
package/linux-patch-c910/5.4: Fixup ASID break vmalloc
Signed-off-by: Guo Ren <[email protected]>
- Loading branch information
Showing
1 changed file
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
From a507bb311273bb88bc3cf65c17b76ac2017b114d Mon Sep 17 00:00:00 2001 | ||
From 7e4ba74d7c53bd62a4807edd8a0dcc78c5c50937 Mon Sep 17 00:00:00 2001 | ||
From: Guo Ren <[email protected]> | ||
Date: Wed, 9 Oct 2019 15:20:26 +0800 | ||
Subject: [PATCH 03/10] riscv: Use generic asid algorithm to implement | ||
|
@@ -16,7 +16,8 @@ Signed-off-by: Guo Ren <[email protected]> | |
arch/riscv/include/asm/mmu_context.h | 17 ++++++++------ | ||
arch/riscv/mm/Makefile | 1 + | ||
arch/riscv/mm/context.c | 43 ++++++++++++++++++++++++++++++++++-- | ||
5 files changed, 56 insertions(+), 9 deletions(-) | ||
arch/riscv/mm/fault.c | 2 +- | ||
6 files changed, 57 insertions(+), 10 deletions(-) | ||
|
||
diff --git a/arch/riscv/include/asm/csr.h b/arch/riscv/include/asm/csr.h | ||
index a18923f..c747d69 100644 | ||
|
@@ -158,6 +159,19 @@ index ca66d44..cae066c 100644 | |
+ return 0; | ||
+} | ||
+early_initcall(asids_init); | ||
diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c | ||
index 247b8c8..71c9017 100644 | ||
--- a/arch/riscv/mm/fault.c | ||
+++ b/arch/riscv/mm/fault.c | ||
@@ -232,7 +232,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs) | ||
* of a task switch. | ||
*/ | ||
index = pgd_index(addr); | ||
- pgd = (pgd_t *)pfn_to_virt(csr_read(CSR_SATP)) + index; | ||
+ pgd = (pgd_t *)pfn_to_virt(csr_read(CSR_SATP) & SATP_PPN) + index; | ||
pgd_k = init_mm.pgd + index; | ||
|
||
if (!pgd_present(*pgd_k)) | ||
-- | ||
2.7.4 | ||
|