All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] lib: sbi: Fix Smrnmi/RNMI trap handling issues
@ 2026-08-28  6:09 Nia Su
  2026-08-28  6:09 ` [PATCH 1/2] lib: sbi: Fix Smrnmi init and non-retentive suspend handling Nia Su
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nia Su @ 2026-08-28  6:09 UTC (permalink / raw)
  To: opensbi; +Cc: Nia Su, Nick Hu, Nylon Chen

This series fixes two issues in the Smrnmi extension and RNMI trap
handling code:

Patch 1 moves the Smrnmi CSR setup into a dedicated
sbi_smrnmi_hart_init() helper so it also runs on the non-retentive
suspend resume path (sbi_hart_reinit()), and relaxes
smrnmi_handlers_init to allow a NULL callback and to report failure
via an int return value instead of void.

Patch 2 fixes sbi_trap_rnmi_handler(), which never updates
prev_context and can inherit a stale value from an earlier trap
that reused the same M-mode exception-stack slot. This can make
sbi_trap_error() loop indefinitely instead of printing diagnostics.
The fix maintains the trap-context pointer the same way
sbi_trap_handler() does, so nested contexts always link correctly.

Signed-off-by: Nia Su <nia.su@sifive.com>
---
Nia Su (1):
      lib: sbi: Fix stale prev_context in RNMI handler

Nylon Chen (1):
      lib: sbi: Fix Smrnmi init and non-retentive suspend handling

 include/sbi/sbi_hart.h     |  1 +
 include/sbi/sbi_platform.h |  2 +-
 lib/sbi/sbi_hart.c         | 55 +++++++++++++++++++++++++++++-----------------
 lib/sbi/sbi_trap.c         | 10 +++++++--
 4 files changed, 45 insertions(+), 23 deletions(-)
---
base-commit: 4e79fd7de59f1b2899092c1a84ce68c8ebc68f93
change-id: 20260826-rnmi-trap-fixes-91347b53b0dd

--


-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-31 17:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28  6:09 [PATCH 0/2] lib: sbi: Fix Smrnmi/RNMI trap handling issues Nia Su
2026-08-28  6:09 ` [PATCH 1/2] lib: sbi: Fix Smrnmi init and non-retentive suspend handling Nia Su
2026-08-28  6:09 ` [PATCH 2/2] lib: sbi: Fix stale prev_context in RNMI handler Nia Su
2026-08-31 17:17 ` [PATCH 0/2] lib: sbi: Fix Smrnmi/RNMI trap handling issues Evgeny Voevodin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.