diff options
author | Niklas Cassel <niklas.cassel@wdc.com> | 2022-03-02 13:15:53 +0000 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2022-03-02 13:30:50 +0000 |
commit | 098fdbc3531f06aae2426b3a6f9bd730e7691258 (patch) | |
tree | f1a22ad2d8f3cc142994117555ed98e52557714c /tools/perf/scripts/python/stackcollapse.py | |
parent | 0d3616bbd03cdfaa8a5fdf38e0fec2b1ef6ec0a0 (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 <niklas.cassel@wdc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220302131544.3166154-3-Niklas.Cassel@wdc.com
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions