From: Bo Gan <ganboing@gmail.com>
To: opensbi@lists.infradead.org, wangruikang@iscas.ac.cn,
dramforever@live.com, andrew.jones@oss.qualcomm.com
Cc: cleger@rivosinc.com, pjw@kernel.org, asrinivasan@oss.tenstorrent.com
Subject: [PATCH v2 0/4] Fixes for vector misaligned load/store handlers
Date: Mon, 8 Jun 2026 23:00:20 -0700 [thread overview]
Message-ID: <20260609060024.706-1-ganboing@gmail.com> (raw)
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
---
v2: Fix the wrong PATCH 4/4 generated in v1.
---
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 | 201 ++++++++++++++++++++++--------------
lib/sbi/sbi_unpriv.c | 88 ++++++++++++++--
6 files changed, 270 insertions(+), 110 deletions(-)
--
2.34.1
--
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi
next reply other threads:[~2026-06-09 6:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 6:00 Bo Gan [this message]
2026-06-09 6:00 ` [PATCH v2 1/4] lib: sbi: cosmetic changes to reduce indentation Bo Gan
2026-06-09 6:00 ` [PATCH v2 2/4] lib: sbi: Rework and split sbi_misaligned(_v)_tinst_fixup Bo Gan
2026-06-09 6:00 ` [PATCH v2 3/4] lib: sbi: Add variable-length unprivilege access functions Bo Gan
2026-06-09 6:00 ` [PATCH v2 4/4] lib: sbi: Rework misaligned vector load/store Bo Gan
2026-06-09 22:02 ` [PATCH v2 0/4] Fixes for vector misaligned load/store handlers Anirudh Srinivasan
2026-06-09 23:54 ` Bo Gan
2026-06-09 23:59 ` Anirudh Srinivasan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260609060024.706-1-ganboing@gmail.com \
--to=ganboing@gmail.com \
--cc=andrew.jones@oss.qualcomm.com \
--cc=asrinivasan@oss.tenstorrent.com \
--cc=cleger@rivosinc.com \
--cc=dramforever@live.com \
--cc=opensbi@lists.infradead.org \
--cc=pjw@kernel.org \
--cc=wangruikang@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox