[PATCH 0/7] Add RISC-V Smrnmi extension support

Evgeny Voevodin evvoevod at tenstorrent.com
Tue Mar 10 11:31:48 PDT 2026


From: Evgeny Voevodin <evvoevod at tenstorrent.com>

This patch series implements support for the RISC-V Smrnmi (Resumable
Non-Maskable Interrupts) extension in OpenSBI.

This series is based on top of the Tenstorrent Atlantis platform patch series:
https://lore.kernel.org/opensbi/20260310005000.3837512-1-npiggin@gmail.com/T/#t

The Smrnmi extension provides:
- Resumable NMI (RNMI) support with dedicated MNEPC/MNSTATUS/MNCAUSE CSRs
- Resumable NMI Exception (RNME) handling for traps occurring with NMIE=0
- Implementation-defined NMI vector locations via NMIVEC/NMEVEC

Key implementation details:
- Adds infrastructure for RNMI/RNME handlers in firmware assembly (fw_base.S)
- Provides platform callback interface for custom NMI handler installation
- Detects and enables Smrnmi early, before trap-based feature detection
- Ensures trap-based CSR probing works correctly with NMIs enabled
- Adds stub handler for Tenstorrent Atlantis platform

Testing: Verified on virtual Whisper platform.

Evgeny Voevodin (7):
  include: sbi_scratch: Add tmp1 scratch space for RNMI context saving
  lib: sbi: Add Smrnmi extension macros for registers and bits
  firmware: Add RNMI/RNME handler infrastructure
  lib: sbi: Introduce smrnmi_handlers_init() callback for platform code
  lib: sbi: hart: Detect and enable Smrnmi before trap-based feature
    detection
  platform: tenstorrent: ascalon: Introduce Smrnmi handlers init
    callback
  platform: tenstorrent: Add Smrnmi support for Atlantis

 firmware/fw_base.S                            | 159 +++++++++++++++++-
 include/sbi/riscv_encoding.h                  |  10 ++
 include/sbi/sbi_hart.h                        |   2 +
 include/sbi/sbi_platform.h                    |  18 ++
 include/sbi/sbi_scratch.h                     |  11 +-
 include/sbi/sbi_trap.h                        |   4 +
 lib/sbi/sbi_hart.c                            |  35 +++-
 lib/sbi/sbi_trap.c                            |  70 ++++++++
 .../generic/include/tenstorrent/ascalon.h     |  10 ++
 platform/generic/tenstorrent/ascalon.c        |  11 ++
 platform/generic/tenstorrent/atlantis.c       |  16 ++
 11 files changed, 336 insertions(+), 10 deletions(-)

-- 
2.43.0




More information about the opensbi mailing list