diff options
| author | Evgeny Voevodin <[email protected]> | 2026-05-07 18:08:07 +0000 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2026-05-09 12:59:43 +0530 |
| commit | 2d211fe6f9d511cdcce344f1c9c422fe33b5a957 (patch) | |
| tree | 2cfbc4ff22633ccc88fc28d0fcd5d2595bac585d /scripts/create-binary-archive.sh | |
| parent | 0cfd6c0b5ec0f7394c4537c288a948c49894dcc6 (diff) | |
lib: sbi: hart: Detect and enable Smrnmi before trap-based feature detection
The location of the RNMI/E trap vectors in the Smrnmi extension is
implementation-defined, so platforms with vendor-specific NMI vector
mechanisms must install the firmware's NMI entry points themselves.
Add an smrnmi_handlers_init() callback to sbi_platform_operations that
receives the firmware entry points and lets platform code install them
at the hardware-specific vector locations. Two pointers are passed:
- _trap_rnmi_handler: the dedicated RNMI entry point that saves
context using the Smrnmi MN* CSRs and returns via mnret.
- _trap_handler: the regular M-mode trap entry since RNME is taken
as a regular M-mode trap with NMIE=0.
When Smrnmi is present, install the platform's NMI vectors via the new
callback, initialize MNSCRATCH with the per-hart scratch pointer, and
set MNSTATUS.NMIE.
Smrnmi-enabled platforms must register smrnmi_handlers_init; if the
extension is detected but no callback is registered, sbi_panic() is
called since enabling NMIs without handlers in place would route
subsequent traps into nowhere.
Signed-off-by: Evgeny Voevodin <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Link: https://lore.kernel.org/r/88b1470e1e3348d454b4b995a11a85c01914f7af.1778176768.git.evvoevod@tenstorrent.com
Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'scripts/create-binary-archive.sh')
0 files changed, 0 insertions, 0 deletions
