Skip to content

riscv: Optimize bitops with Zbb extension

Xiao Wang linux-efi linux-riscv lkml 5 versions – Applied

Status from this message: This series was applied to riscv/linux.git (for-next)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 2 repliesApplied 2/2
  2. v42 patches 4 repliesSuperseded
  3. v32 patches 2 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches2 repliesSuperseded
v11 patch14 repliesSuperseded

Changes in v5 from the cover letter

- Fix all the checkpatch complaints from "scripts/checkpatch.pl --strict". (Charlie) There're three kinds of complaints on patch 2/2 code style:
* CHECK: Lines should not end with a '('
* CHECK: spaces preferred around that '-' (ctx:VxV)
* CHECK: Macro argument reuse 'x' - possible side-effects?
The third warning on fls(x) macro is fixed alongside with code style improvement.
- Drop the mistakenly added content in v4. (Charlie)
- Link to v4: https://lore.kernel.org/all/[email protected]/

Patches in v5 All 2 applied

#Subject and filesSizeRepliesApplied
1/2riscv: Rearrange hwcap.h and cpufeature.harch/riscv/include/asm/cpufeature.h arch/riscv/include/asm/elf.h arch/riscv/include/asm/hwcap.h +11 more+95 -1020 repliesApplied
2/2riscv: Optimize bitops with Zbb extensionarch/riscv/include/asm/bitops.h drivers/firmware/efi/libstub/Makefile+252 -42 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchAndrew JonesCharlie Jenkins
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/2] riscv: Optimize bitops with Zbb extension

Bitops optimization with specialized instructions is common practice in popular ISAs, this patch set uses RISC-V Zbb extension to optimize four
bitops: __ffs, __fls, ffs and fls.

The first patch rearranges the content in hwcap.h and cpufeature.h, it helps to avoid a cyclic header including issue for patch 2.

The second patch leverages the alternative mechanism to dynamically apply this optimization.

Thanks,
Xiao

v5:
- Fix all the checkpatch complaints from "scripts/checkpatch.pl --strict". (Charlie) There're three kinds of complaints on patch 2/2 code style:
* CHECK: Lines should not end with a '('
* CHECK: spaces preferred around that '-' (ctx:VxV)
* CHECK: Macro argument reuse 'x' - possible side-effects?
The third warning on fls(x) macro is fixed alongside with code style improvement.
- Drop the mistakenly added content in v4. (Charlie)
- Link to v4: https://lore.kernel.org/all/[email protected]/

v4:
- Simplify the asm code in ffs() and fls() by moving general logic into C implementation. (Charlie)
- Add a comment to decorating the large #ifdef block. (Charlie)
- Link to v3: https://lore.kernel.org/all/[email protected]/

v3:
- Fix riscv32 build issue reported by kernel test robot. V3 changes "hwcap.h" to "cpufeature.h" for files where cpu feature detection APIs are used. (Yujie)
- Link to v2: https://lore.kernel.org/all/[email protected]/

v2:
- Remove the "EFI_" prefix from macro name "EFI_NO_ALTERNATIVE" to make it generic. (Ard)
- patch-1 is added, it's based on "RISC-V: Enable cbo.zero in usermode". (Andrew)
- Link to v1: https://lore.kernel.org/all/[email protected]/

Xiao Wang (2):
riscv: Rearrange hwcap.h and cpufeature.h
riscv: Optimize bitops with Zbb extension

 arch/riscv/include/asm/bitops.h       | 254 +++++++++++++++++++++++++-
 arch/riscv/include/asm/cpufeature.h   |  83 +++++++++
 arch/riscv/include/asm/elf.h          |   2 +-
 arch/riscv/include/asm/hwcap.h        |  91 ---------
 arch/riscv/include/asm/pgtable.h      |   1 +
 arch/riscv/include/asm/switch_to.h    |   2 +-
 arch/riscv/include/asm/vector.h       |   2 +-
 arch/riscv/kvm/aia.c                  |   2 +-
 arch/riscv/kvm/main.c                 |   2 +-
 arch/riscv/kvm/tlb.c                  |   2 +-
 arch/riscv/kvm/vcpu_fp.c              |   2 +-
 arch/riscv/kvm/vcpu_onereg.c          |   2 +-
 arch/riscv/kvm/vcpu_vector.c          |   2 +-
 drivers/clocksource/timer-riscv.c     |   2 +-
 drivers/firmware/efi/libstub/Makefile |   2 +-
 drivers/perf/riscv_pmu_sbi.c          |   2 +-
 16 files changed, 347 insertions(+), 106 deletions(-)
Signature · 1 line
2.25.1