[PATCH v4 0/2] riscv: Use Kconfig to set unaligned access speed

From: Charlie Jenkins
Date: Fri Feb 16 2024 - 15:38:14 EST


If the hardware unaligned access speed is known at compile time, it is
possible to avoid running the unaligned access speed probe to speedup
boot-time.

Signed-off-by: Charlie Jenkins <charlie@xxxxxxxxxxxx>
---
Changes in v4:
- Add additional Kconfig options for the other unaligned access speeds
- Link to v3: https://lore.kernel.org/r/20240202-disable_misaligned_probe_config-v3-0-c44f91f03bb6@xxxxxxxxxxxx

Changes in v3:
- Revert change to csum (Eric)
- Change ifndefs for ifdefs (Eric)
- Change config in Makefile (Elliot/Eric)
- Link to v2: https://lore.kernel.org/r/20240201-disable_misaligned_probe_config-v2-0-77c368bed7b2@xxxxxxxxxxxx

Changes in v2:
- Move around definitions to reduce ifdefs (Clément)
- Make RISCV_MISALIGNED depend on !HAVE_EFFICIENT_UNALIGNED_ACCESS
(Clément)
- Link to v1: https://lore.kernel.org/r/20240131-disable_misaligned_probe_config-v1-0-98d155e9cda8@xxxxxxxxxxxx

---
Charlie Jenkins (2):
riscv: lib: Introduce has_fast_misaligned_access function
riscv: Set unalignment speed at compile time

arch/riscv/Kconfig | 58 +++++-
arch/riscv/include/asm/cpufeature.h | 45 ++++-
arch/riscv/kernel/Makefile | 6 +-
arch/riscv/kernel/cpufeature.c | 255 --------------------------
arch/riscv/kernel/misaligned_access_speed.c | 265 ++++++++++++++++++++++++++++
arch/riscv/kernel/probe_emulated_access.c | 64 +++++++
arch/riscv/kernel/sys_hwprobe.c | 25 +++
arch/riscv/kernel/traps_misaligned.c | 54 +-----
arch/riscv/lib/csum.c | 7 +-
9 files changed, 454 insertions(+), 325 deletions(-)
---
base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d
change-id: 20240131-disable_misaligned_probe_config-043aea375f93
--
- Charlie