Skip to content
Commit 58bda887 authored by Jimmy Zheng's avatar Jimmy Zheng Committed by Anas Nashif
Browse files

arch: riscv: update PMP setting to privileged mode for fault handler



When RISCV_ALWAYS_SWITCH_THROUGH_ECALL is enabled, do_swap() enables PMP
checking in is_kernel_syscall.
If a user thread violates memory protection and do_swap() is called from
the fault handler, a PMP error occurs because the thread is in privileged
mode but still using the old user mode PMP setting.

Update the PMP setting to privileged mode for fault handler.
This also enables the stack guard for user thread's privileged stack in
fault handler.

Signed-off-by: default avatarJimmy Zheng <jimmyzhe@andestech.com>
parent 9f56ff5d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment