summaryrefslogtreecommitdiff
path: root/arch/riscv/mm/fault.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-09 10:37:10 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-09 10:37:10 +0100
commit9b085d6e889076928d307f05cabf76e35db1e63b (patch)
tree89c83eec98ed9bf07d07d8a7b0dea51564ecd61a /arch/riscv/mm/fault.c
parent441494ec2a302830357d0aa59f3b907e319a8b26 (diff)
parentf8394f232b1eab649ce2df5c5f15b0e528c92091 (diff)
Merge 5.10-rc3 into tty-next
We need the TTY/vt/serial fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/riscv/mm/fault.c')
-rw-r--r--arch/riscv/mm/fault.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c
index 1359e21c0c62..3c8b9e433c67 100644
--- a/arch/riscv/mm/fault.c
+++ b/arch/riscv/mm/fault.c
@@ -86,6 +86,7 @@ static inline void vmalloc_fault(struct pt_regs *regs, int code, unsigned long a
pmd_t *pmd, *pmd_k;
pte_t *pte_k;
int index;
+ unsigned long pfn;
/* User mode accesses just cause a SIGSEGV */
if (user_mode(regs))
@@ -100,7 +101,8 @@ static inline void vmalloc_fault(struct pt_regs *regs, int code, unsigned long a
* of a task switch.
*/
index = pgd_index(addr);
- pgd = (pgd_t *)pfn_to_virt(csr_read(CSR_SATP)) + index;
+ pfn = csr_read(CSR_SATP) & SATP_PPN;
+ pgd = (pgd_t *)pfn_to_virt(pfn) + index;
pgd_k = init_mm.pgd + index;
if (!pgd_present(*pgd_k)) {