Skip to content

lib: sbi: Fix stale trap_context/prev_context linking

Nia Su opensbi 2 versions – Applied

Status from this message: Applied this series to the riscv/opensbi repo.

Get series with b4
b4 am [email protected] change-id 20260902-trap-context-fix-b9e78441953e

Versions newest first

  1. v2 Latest2 patches 1 replyApplied
  2. v12 patches 3 repliesSuperseded

Changes in v2 from the cover letter

- Patch 1: trimmed the commit message, added a Fixes tag.
- Added Reviewed-by from Evgeny Voevodin.
- Link to v1: https://lore.kernel.org/r/[email protected]

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2firmware: Clear scratch->trap_context on warm bootfirmware/fw_base.S+3 -00 replies
2/2lib: sbi: Fix stale prev_context in RNMI handlerlib/sbi/sbi_trap.c+8 -20 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchEvgeny VoevodinAnup Patel
SeriesR-b
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] lib: sbi: Fix stale trap_context/prev_context linking

Patch 1 clears scratch->trap_context on warm boot, since non-retentive suspend/resume jumps straight there without restoring it, leaving a stale pointer misused as the next trap's prev_context.

Patch 2 fixes sbi_trap_rnmi_handler() to link prev_context on entry and restore it on exit, the same way sbi_trap_handler() does.

---
Changes in v2:
- Patch 1: trimmed the commit message, added a Fixes tag.
- Added Reviewed-by from Evgeny Voevodin.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Nia Su (2):
firmware: Clear scratch->trap_context on warm boot
lib: sbi: Fix stale prev_context in RNMI handler

 firmware/fw_base.S |  3 +++
 lib/sbi/sbi_trap.c | 10 ++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

---
base-commit: 35511bc6ee1c9c17b6a89b44c52e2044bb51b979
change-id: 20260902-trap-context-fix-b9e78441953e

--

Signature · 3 lines
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi