aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-memcpy.c
diff options
context:
space:
mode:
authorNiklas Cassel <[email protected]>2022-03-02 13:15:53 +0000
committerMarc Zyngier <[email protected]>2022-03-02 13:30:50 +0000
commit098fdbc3531f06aae2426b3a6f9bd730e7691258 (patch)
treef1a22ad2d8f3cc142994117555ed98e52557714c /lib/test_fortify/write_overflow-memcpy.c
parent0d3616bbd03cdfaa8a5fdf38e0fec2b1ef6ec0a0 (diff)
irqchip/sifive-plic: Disable S-mode IRQs if running in M-mode
When detecting a context for a privilege mode different from the current running privilege mode, we simply skip to the next context register. This means that we never clear the S-mode enable bits when running in M-mode. On canaan k210, a bunch of S-mode interrupts are enabled by the bootrom. These S-mode specific interrupts should never trigger, since we never set the mie.SEIE bit in the parent interrupt controller (riscv-intc). However, we will be able to see the mip.SEIE bit set as pending. This isn't a good default when CONFIG_RISCV_M_MODE is set, since in that case we will never enter a lower privilege mode (e.g. S-mode). Let's clear the S-mode enable bits when running the kernel in M-mode, such that we won't have a interrupt pending bit set, which we will never clear. Signed-off-by: Niklas Cassel <[email protected]> Reviewed-by: Anup Patel <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/test_fortify/write_overflow-memcpy.c')
0 files changed, 0 insertions, 0 deletions