Skip to content

Commit

Permalink
riscv/mm/fault: Set FAULT_FLAG_INSTRUCTION flag in do_page_fault()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pekka Enberg authored and Palmer Dabbelt committed Sep 16, 2020
1 parent 2baa6d9 commit a960c13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/riscv/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs)

if (cause == EXC_STORE_PAGE_FAULT)
flags |= FAULT_FLAG_WRITE;

else if (cause == EXC_INST_PAGE_FAULT)
flags |= FAULT_FLAG_INSTRUCTION;
retry:
mmap_read_lock(mm);
vma = find_vma(mm, addr);
Expand Down

0 comments on commit a960c13

Please sign in to comment.