public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] riscv: uaccess: optimizations
@ 2025-02-21  0:09 Cyril Bur
  2025-02-21  0:09 ` [PATCH v3 1/4] riscv: implement user_access_begin() and families Cyril Bur
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Cyril Bur @ 2025-02-21  0:09 UTC (permalink / raw)
  To: palmer, aou, paul.walmsley, charlie, jrtc27, ben.dooks
  Cc: linux-riscv, linux-kernel, jszhang

This series tries to optimize riscv uaccess by allowing the use of
user_access_begin() and user_access_end() which permits grouping user accesses
and avoiding the CSR write penalty for each access.

The error path can also be optimised using asm goto which patches 3 and 4
achieve. This will speed up jumping to labels by avoiding the need of an
intermediary error type variable within the uaccess macros

I did read the discussion this series generated. It isn't clear to me
which direction to take the patches, if any.

V2:
I've taken on this series as there isn't any response from Jisheng. No
significant changes other than build fixes.
- Fixes build breakage in patch 3 to do with not having used 'goto' keyword.
- Fixes build breakage in patch 4 on 32bit not having delcared __ptr in the
  macro.

V3:
Significant commit message rewrites.
 - Corrected the justification for patch 2
 - Better explained/justified patches 3 and 4
Minor code changes for legibility and more comments.

Jisheng Zhang (4):
  riscv: implement user_access_begin() and families
  riscv: uaccess: use input constraints for ptr of __put_user()
  riscv: uaccess: use 'asm goto' for put_user()
  riscv: uaccess: use 'asm_goto_output' for get_user()

 arch/riscv/include/asm/uaccess.h | 205 +++++++++++++++++++++++--------
 1 file changed, 152 insertions(+), 53 deletions(-)

-- 
2.34.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2025-03-19  4:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-21  0:09 [PATCH v3 0/4] riscv: uaccess: optimizations Cyril Bur
2025-02-21  0:09 ` [PATCH v3 1/4] riscv: implement user_access_begin() and families Cyril Bur
2025-03-14 13:28   ` Alexandre Ghiti
2025-03-17 23:54     ` [EXT] " Cyril Bur
2025-03-19  4:24     ` Cyril Bur
2025-02-21  0:09 ` [PATCH v3 2/4] riscv: uaccess: use input constraints for ptr of __put_user() Cyril Bur
2025-02-21  0:09 ` [PATCH v3 3/4] riscv: uaccess: use 'asm goto' for put_user() Cyril Bur
2025-02-21  0:09 ` [PATCH v3 4/4] riscv: uaccess: use 'asm_goto_output' for get_user() Cyril Bur
2025-02-23  7:12 ` [PATCH v3 0/4] riscv: uaccess: optimizations Anton Blanchard
2025-03-14 13:28 ` Alexandre Ghiti
2025-03-14 13:49   ` Ben Dooks
2025-03-17 23:52     ` [EXT] " Cyril Bur
2025-03-18  8:02       ` Ben Dooks

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