From: Andy Chiu <andybnac@gmail.com>
To: linux-riscv@lists.infradead.org, palmer@dabbelt.com
Cc: Andy Chiu <andybnac@gmail.com>,
linux-kernel@vger.kernel.org, Alexandre Ghiti <alex@ghiti.fr>,
bjorn@kernel.org, alexghiti@rivosinc.com,
paul.walmsley@sifive.com, greentime.hu@sifive.com,
nick.hu@sifive.com, nylon.chen@sifive.com, eric.lin@sifive.com,
vincent.chen@sifive.com, zong.li@sifive.com,
yongxuan.wang@sifive.com, samuel.holland@sifive.com
Subject: [PATCH v2 0/1] Optimize Vector context restore on syscall
Date: Wed, 1 Apr 2026 23:34:13 -0500 [thread overview]
Message-ID: <20260402043414.2421916-1-andybnac@gmail.com> (raw)
Accroding to the ABI, Vector registers are not preserved across a
syscall. Therefore, the kernel invalidates all V-reg at the entry of the
trap handler and marks the state dirty. This patch provide an
optimization such that the invalidation is performed only once before
returning back to the user space. Also by tracking this state,
specifically reserving VS_INITIAL for this optimized restore, we cut the
cost of saving and restoring V-reg at context switch for processes
calling syscalls.
---
Changelog v2: rebase on top of for-next
Andy Chiu (1):
riscv: vector: treat VS_INITIAL as discard
arch/riscv/include/asm/vector.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--
2.53.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next reply other threads:[~2026-04-02 4:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 4:34 Andy Chiu [this message]
2026-04-02 4:34 ` [PATCH v2] riscv: vector: treat VS_INITIAL as discard Andy Chiu
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=20260402043414.2421916-1-andybnac@gmail.com \
--to=andybnac@gmail.com \
--cc=alex@ghiti.fr \
--cc=alexghiti@rivosinc.com \
--cc=bjorn@kernel.org \
--cc=eric.lin@sifive.com \
--cc=greentime.hu@sifive.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=nick.hu@sifive.com \
--cc=nylon.chen@sifive.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=samuel.holland@sifive.com \
--cc=vincent.chen@sifive.com \
--cc=yongxuan.wang@sifive.com \
--cc=zong.li@sifive.com \
/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