public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] Optimize Vector context restore on syscall
@ 2026-04-02  4:34 Andy Chiu
  2026-04-02  4:34 ` [PATCH v2] riscv: vector: treat VS_INITIAL as discard Andy Chiu
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Chiu @ 2026-04-02  4:34 UTC (permalink / raw)
  To: linux-riscv, palmer
  Cc: Andy Chiu, linux-kernel, Alexandre Ghiti, bjorn, alexghiti,
	paul.walmsley, greentime.hu, nick.hu, nylon.chen, eric.lin,
	vincent.chen, zong.li, yongxuan.wang, samuel.holland

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

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

end of thread, other threads:[~2026-04-02  4:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-02  4:34 [PATCH v2 0/1] Optimize Vector context restore on syscall Andy Chiu
2026-04-02  4:34 ` [PATCH v2] riscv: vector: treat VS_INITIAL as discard Andy Chiu

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