OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Fixes for vector misaligned load/store handlers
@ 2026-06-08 21:16 Bo Gan
  2026-06-08 21:17 ` [PATCH 1/4] lib: sbi: cosmetic changes to reduce indentation Bo Gan
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Bo Gan @ 2026-06-08 21:16 UTC (permalink / raw)
  To: opensbi, wangruikang, dramforever, andrew.jones; +Cc: cleger, pjw, asrinivasan

Re-visit the vector misaligned load/store handlers and fix:

a. Avoid stack overflow by using a small sliding mask[] buffer,
   thus optimizes stack usage *IMPORTANT* (correctness). There's no-
   longer a need to have a pre-defined vlen maximum, and worry about
   whether the stack can hold the mask[] variable.

b. Maintain the value of vstart when redirecting uptrap. (optmization)
   Avoids doing duplicate work when the instruction gets restarted.

c. Explicitly set VS dirty in (V)SSTATUS. (correctness), VS in
   VSSTATUS must be set dirty if coming from V=1.

d. Zero out tinst in uptrap if not guest-page fault (correctness).

This is a follow up patch to [1] and should be applied on top.
[1] https://lore.kernel.org/opensbi/CAEev2e_Vg1mMP4mOKanFX_EGeUzpczRcWW++vBBuN1CfyM0BJw@mail.gmail.com/T/#t

Bo Gan (4):
  lib: sbi: cosmetic changes to reduce indentation
  lib: sbi: Rework and split sbi_misaligned(_v)_tinst_fixup
  lib: sbi: Add variable-length unprivilege access functions
  lib: sbi: Rework misaligned vector load/store

 include/sbi/sbi_trap_ldst.h |   3 -
 include/sbi/sbi_unpriv.h    |  16 +++
 include/sbi/sbi_vector.h    |   6 ++
 lib/sbi/sbi_trap_ldst.c     |  66 +++++++-----
 lib/sbi/sbi_trap_v_ldst.c   | 198 +++++++++++++++++++++++-------------
 lib/sbi/sbi_unpriv.c        |  88 ++++++++++++++--
 6 files changed, 269 insertions(+), 108 deletions(-)

-- 
2.34.1


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

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

end of thread, other threads:[~2026-06-09  6:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-08 21:16 [PATCH 0/4] Fixes for vector misaligned load/store handlers Bo Gan
2026-06-08 21:17 ` [PATCH 1/4] lib: sbi: cosmetic changes to reduce indentation Bo Gan
2026-06-08 21:17 ` [PATCH 2/4] lib: sbi: Rework and split sbi_misaligned(_v)_tinst_fixup Bo Gan
2026-06-08 21:17 ` [PATCH 3/4] lib: sbi: Add variable-length unprivilege access functions Bo Gan
2026-06-08 21:17 ` [PATCH 4/4] lib: sbi: Rework misaligned vector load/store Bo Gan
2026-06-09  6:06 ` [PATCH 0/4] Fixes for vector misaligned load/store handlers Bo Gan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox