|
|
Log in / Subscribe / Register

riscv: Use Kconfig to set unaligned access speed

From:  Charlie Jenkins <charlie-AT-rivosinc.com>
To:  Paul Walmsley <paul.walmsley-AT-sifive.com>, Palmer Dabbelt <palmer-AT-dabbelt.com>, Albert Ou <aou-AT-eecs.berkeley.edu>, Jisheng Zhang <jszhang-AT-kernel.org>, Evan Green <evan-AT-rivosinc.com>, Clément Léger <cleger-AT-rivosinc.com>, Eric Biggers <ebiggers-AT-kernel.org>, Elliot Berman <quic_eberman-AT-quicinc.com>, Charles Lohr <lohr85-AT-gmail.com>, Conor Dooley <conor.dooley-AT-microchip.com>
Subject:  [PATCH v7 0/4] riscv: Use Kconfig to set unaligned access speed
Date:  Wed, 06 Mar 2024 12:00:00 -0800
Message-ID:  <20240306-disable_misaligned_probe_config-v7-0-6c90419e7a96@rivosinc.com>
Cc:  linux-riscv-AT-lists.infradead.org, linux-kernel-AT-vger.kernel.org, Charlie Jenkins <charlie-AT-rivosinc.com>
Archive-link:  Article

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@rivosinc.com>
---
Changes in v7:
- Fix check_unaligned_access_emulated_all_cpus to return false when any
  cpu has emulated accesses
- Fix wording in Kconfig (Conor)
- Link to v6: https://lore.kernel.org/r/20240301-disable_misaligned_pro...

Changes in v6:
- Consolidate Kconfig into 4 options (probe, emulated, slow,
  efficient)
- Change the behavior of "emulated" to allow hwprobe to return "slow" if
  unaligned accesses are not emulated by the kernel
- With this consolidation, check_unaligned_access_emulated is able to be
  moved back into the original file (traps_misaligned.c)
- Link to v5: https://lore.kernel.org/r/20240227-disable_misaligned_pro...

Changes in v5:
- Clarify Kconfig options from Conor's feedback
- Use "unaligned" instead of "misaligned" in introduced file/function.
  This is a bit hard to standardize because the riscv manual says
  "misaligned" but the existing Linux configs say "unaligned".
- Link to v4: https://lore.kernel.org/r/20240216-disable_misaligned_pro...

Changes in v4:
- Add additional Kconfig options for the other unaligned access speeds
- Link to v3: https://lore.kernel.org/r/20240202-disable_misaligned_pro...

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_pro...

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_pro...

---
Charlie Jenkins (4):
      riscv: lib: Introduce has_fast_unaligned_access function
      riscv: Only check online cpus for emulated accesses
      riscv: Decouple emulated unaligned accesses from access speed
      riscv: Set unaligned access speed at compile time

 arch/riscv/Kconfig                         |  60 ++++--
 arch/riscv/include/asm/cpufeature.h        |  31 ++--
 arch/riscv/kernel/Makefile                 |   4 +-
 arch/riscv/kernel/cpufeature.c             | 255 --------------------------
 arch/riscv/kernel/sys_hwprobe.c            |  15 ++
 arch/riscv/kernel/traps_misaligned.c       |  17 +-
 arch/riscv/kernel/unaligned_access_speed.c | 282 +++++++++++++++++++++++++++++
 arch/riscv/lib/csum.c                      |   7 +-
 8 files changed, 378 insertions(+), 293 deletions(-)
---
base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d
change-id: 20240131-disable_misaligned_probe_config-043aea375f93
-- 
- Charlie




Copyright © 2024, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds