Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RISCV: fix PMP stack guard not active during boot #75622

Merged
merged 2 commits into from
Jul 11, 2024

Commits on Jul 8, 2024

  1. riscv: pmp: abstract the MPRV catchall entry and its QEMU workaround

    This will be needed at more than one location.
    
    Signed-off-by: Nicolas Pitre <[email protected]>
    Nicolas Pitre committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    ca99d5c View commit details
    Browse the repository at this point in the history
  2. riscv: pmp: actually activate stack overflow protection during boot

    Before this, stack protection would be effective only after switching to
    the first thread.
    
    Even before the first thread is created, the kernel init code uses the
    IRQ stack to set things up. Let's make sure this is safeguarded as well.
    
    This also fixes the incompatibility between CONFIG_RISCV_PMP and
    CONFIG_RISCV_ALWAYS_SWITCH_THROUGH_ECALL, the later needing an exception
    call to switch to the first thread and exception code assuming stack
    guard is already set up in the PMP.
    
    Signed-off-by: Nicolas Pitre <[email protected]>
    Nicolas Pitre committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    3e14a48 View commit details
    Browse the repository at this point in the history