public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] riscv: uaccess: optimizations
@ 2024-11-18 23:01 Cyril Bur
  2024-11-18 23:01 ` [PATCH v2 1/4] riscv: implement user_access_begin and families Cyril Bur
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Cyril Bur @ 2024-11-18 23:01 UTC (permalink / raw)
  To: palmer, aou, paul.walmsley; +Cc: linux-riscv, linux-kernel

Orignally sent by Jisheng Zhang <jszhang@kernel.org>

This series tries to optimize riscv uaccess in the following way:

patch1 implement the user_access_begin and families, I.E the unsafe
accessors. when a function like strncpy_from_user() is called,
the userspace access protection is disabled and enabled for every
word read. After patch1, the protection is disabled at the beginning
of the copy and enabled at the end.

patch2 is a simple clean up

patch3 uses 'asm goto' for put_user()
patch4 uses 'asm goto output' for get_user()

Both patch3 and patch4 are based on the fact -- 'asm goto' and
'asm goto output'generates noticeably better code since we don't need
to test the error etc, the exception just jumps to the error handling
directly.

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.
I did read the discussion this series generated. It isn't clear to me
which direction to take the patches, if any.


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

end of thread, other threads:[~2025-02-18 19:21 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-18 23:01 [PATCH v2 0/4] riscv: uaccess: optimizations Cyril Bur
2024-11-18 23:01 ` [PATCH v2 1/4] riscv: implement user_access_begin and families Cyril Bur
2025-01-17 23:21   ` Charlie Jenkins
2025-02-05 15:08     ` Ben Dooks
2025-02-13 17:07       ` Cyril Bur
2025-02-13 17:16         ` Ben Dooks
2025-02-18 19:21           ` Cyril Bur
2024-11-18 23:01 ` [PATCH v2 2/4] riscv: uaccess: use input constraints for ptr of __put_user Cyril Bur
2025-01-17 23:23   ` Charlie Jenkins
2025-01-17 23:34   ` Jessica Clarke
2025-01-31  1:31     ` Cyril Bur
2025-01-31  6:00       ` Charlie Jenkins
2024-11-18 23:01 ` [PATCH v2 3/4] riscv: uaccess: use 'asm goto' for put_user() Cyril Bur
2025-01-17 23:24   ` Charlie Jenkins
2024-11-18 23:01 ` [PATCH v2 4/4] riscv: uaccess: use 'asm goto output' for get_user Cyril Bur
2025-01-17 23:24   ` Charlie Jenkins

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