From: Pekka Enberg Date: Sat, 5 Sep 2020 06:07:26 +0000 (+0300) Subject: riscv/mm/fault: Set FAULT_FLAG_INSTRUCTION flag in do_page_fault() X-Git-Tag: v5.10.7~1318^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a960c1323749383e62b67f5d49cdfbdcccde0ef6;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Palmer Dabbelt --- diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c index a173432..1359e21 100644 --- a/arch/riscv/mm/fault.c +++ b/arch/riscv/mm/fault.c @@ -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);