Skip to content

Commit a960c13

Browse files
penbergpalmer-dabbelt
authored andcommitted
riscv/mm/fault: Set FAULT_FLAG_INSTRUCTION flag in do_page_fault()
If the page fault "cause" is EXC_INST_PAGE_FAULT, set the FAULT_FLAG_INSTRUCTION flag to let handle_mm_fault() and friends know about it. This has no functional changes because RISC-V uses the default arch_vma_access_permitted() implementation, which always returns true. However, dax_pmd_fault(), for example, has a tracepoint that uses FAULT_FLAG_INSTRUCTION, so we might as well set it. Signed-off-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
1 parent 2baa6d9 commit a960c13

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

arch/riscv/mm/fault.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
234234

235235
if (cause == EXC_STORE_PAGE_FAULT)
236236
flags |= FAULT_FLAG_WRITE;
237-
237+
else if (cause == EXC_INST_PAGE_FAULT)
238+
flags |= FAULT_FLAG_INSTRUCTION;
238239
retry:
239240
mmap_read_lock(mm);
240241
vma = find_vma(mm, addr);

0 commit comments

Comments
 (0)