Skip to content

Commit 4fcb14d

Browse files
committed
package/linux-patch-c910/5.4: Fixup ASID break vmalloc
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
1 parent 69cf6ea commit 4fcb14d

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

package/linux-patch-c910/5.4/0003-riscv-Use-generic-asid-algorithm-to-implement-switch.patch

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From a507bb311273bb88bc3cf65c17b76ac2017b114d Mon Sep 17 00:00:00 2001
1+
From 7e4ba74d7c53bd62a4807edd8a0dcc78c5c50937 Mon Sep 17 00:00:00 2001
22
From: Guo Ren <guoren@linux.alibaba.com>
33
Date: Wed, 9 Oct 2019 15:20:26 +0800
44
Subject: [PATCH 03/10] riscv: Use generic asid algorithm to implement
@@ -16,7 +16,8 @@ Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
1616
arch/riscv/include/asm/mmu_context.h | 17 ++++++++------
1717
arch/riscv/mm/Makefile | 1 +
1818
arch/riscv/mm/context.c | 43 ++++++++++++++++++++++++++++++++++--
19-
5 files changed, 56 insertions(+), 9 deletions(-)
19+
arch/riscv/mm/fault.c | 2 +-
20+
6 files changed, 57 insertions(+), 10 deletions(-)
2021

2122
diff --git a/arch/riscv/include/asm/csr.h b/arch/riscv/include/asm/csr.h
2223
index a18923f..c747d69 100644
@@ -158,6 +159,19 @@ index ca66d44..cae066c 100644
158159
+ return 0;
159160
+}
160161
+early_initcall(asids_init);
162+
diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c
163+
index 247b8c8..71c9017 100644
164+
--- a/arch/riscv/mm/fault.c
165+
+++ b/arch/riscv/mm/fault.c
166+
@@ -232,7 +232,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
167+
* of a task switch.
168+
*/
169+
index = pgd_index(addr);
170+
- pgd = (pgd_t *)pfn_to_virt(csr_read(CSR_SATP)) + index;
171+
+ pgd = (pgd_t *)pfn_to_virt(csr_read(CSR_SATP) & SATP_PPN) + index;
172+
pgd_k = init_mm.pgd + index;
173+
174+
if (!pgd_present(*pgd_k))
161175
--
162176
2.7.4
163177

0 commit comments

Comments
 (0)