Skip to content

Fix issues in LoongArch page fault handling

Lorenz Hetterich lkml loongarch 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Loongarch: Fix stale value in __do_page_fault()arch/loongarch/mm/fault.c+1 -01 reply
2/2LoongArch: Set FAULT_FLAG_INSTRUCTION in __do_page_fault()arch/loongarch/include/asm/exception.h arch/loongarch/mm/fault.c+6 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Fix issues in LoongArch page fault handling

This patch series addresses two issues in LoongArch page fault handling.

First, the page fault handler calls kprobe_page_fault with the current thread's trap_nr.
However, the thread's trap number is not updated prior to the call leading to a stale value being used.

Second, the page fault handler never sets the FAULT_FLAG_INSTRUCTION flag. This means architecture-independent linux code like handle_mm_fault cannot distinguish between read and execute faults. While this does not seem to cause immediate problems,
it is inconsistent with other architectures like x86, arm64, and riscv.

Lorenz Hetterich (2):
Loongarch: Fix stale value in __do_page_fault()
LoongArch: Set FAULT_FLAG_INSTRUCTION in __do_page_fault()

 arch/loongarch/include/asm/exception.h | 3 +++
 arch/loongarch/mm/fault.c              | 4 ++++
 2 files changed, 7 insertions(+)
Signature · 1 line
2.43.0