[PATCH RFC 00/10] riscv: Add support for rva23

Charlie Jenkins posted 10 patches 1 month, 4 weeks ago
arch/riscv/Kconfig                                 | 340 +--------------
arch/riscv/Kconfig.extensions                      | 485 +++++++++++++++++++++
arch/riscv/Kconfig.vendor                          |  25 +-
arch/riscv/Makefile                                | 136 +++++-
arch/riscv/include/asm/arch_hweight.h              |   4 +-
arch/riscv/include/asm/archrandom.h                |   2 +-
arch/riscv/include/asm/asm-prototypes.h            |   2 +-
arch/riscv/include/asm/barrier.h                   |   2 +-
arch/riscv/include/asm/bitops.h                    |   8 +-
arch/riscv/include/asm/checksum.h                  |  32 --
arch/riscv/include/asm/cmpxchg.h                   |  14 +-
arch/riscv/include/asm/cpufeature-macros.h         | 136 ++++--
arch/riscv/include/asm/cpufeature.h                |  42 +-
arch/riscv/include/asm/hugetlb.h                   |   2 +-
arch/riscv/include/asm/hwcap.h                     |  18 +-
arch/riscv/include/asm/kgdb.h                      |   2 +-
arch/riscv/include/asm/kvm_vcpu_vector.h           |   2 +-
arch/riscv/include/asm/mmu.h                       |   2 +-
arch/riscv/include/asm/mmu_context.h               |   4 +-
arch/riscv/include/asm/page.h                      |   2 +-
arch/riscv/include/asm/pgtable-64.h                |   2 +-
arch/riscv/include/asm/pgtable.h                   |   6 +-
arch/riscv/include/asm/processor.h                 |   2 +-
arch/riscv/include/asm/simd.h                      |   2 +-
arch/riscv/include/asm/swab.h                      |   2 +-
arch/riscv/include/asm/switch_to.h                 |   4 +-
arch/riscv/include/asm/uaccess.h                   |   2 +-
arch/riscv/include/asm/uprobes.h                   |   2 +-
arch/riscv/include/asm/vector.h                    |   7 +-
arch/riscv/include/asm/vendor_extensions.h         | 113 ++---
arch/riscv/include/asm/xor.h                       |   2 +-
arch/riscv/kernel/Makefile                         |   6 +-
arch/riscv/kernel/cpufeature.c                     |  38 +-
arch/riscv/kernel/head.S                           |   2 +-
arch/riscv/kernel/kgdb.c                           |   2 +-
arch/riscv/kernel/pi/archrandom_early.c            |   1 +
arch/riscv/kernel/probes/decode-insn.c             |   2 +-
arch/riscv/kernel/probes/uprobes.c                 |   2 +-
arch/riscv/kernel/process.c                        |  10 +-
arch/riscv/kernel/ptrace.c                         |  12 +-
arch/riscv/kernel/signal.c                         |   2 +-
arch/riscv/kernel/suspend.c                        |   8 +-
arch/riscv/kernel/sys_hwprobe.c                    |   4 +-
arch/riscv/kernel/tests/kprobes/test-kprobes-asm.S |   6 +-
arch/riscv/kernel/vendor_extensions/Makefile       |  22 +-
arch/riscv/kvm/tlb.c                               |   2 +-
arch/riscv/kvm/vcpu.c                              |  10 +-
arch/riscv/kvm/vcpu_onereg.c                       |  22 +-
arch/riscv/kvm/vcpu_vector.c                       |   2 +-
arch/riscv/lib/Makefile                            |  14 +-
arch/riscv/lib/csum.c                              |  94 ----
arch/riscv/lib/strcmp.S                            |   2 +-
arch/riscv/lib/strlen.S                            |   2 +-
arch/riscv/lib/strncmp.S                           |   2 +-
arch/riscv/lib/uaccess.S                           |   4 +-
arch/riscv/mm/hugetlbpage.c                        |   2 +-
arch/riscv/mm/pgtable.c                            |   2 +-
arch/riscv/mm/tlbflush.c                           |   2 +-
arch/riscv/net/bpf_jit.h                           |   2 +-
drivers/perf/Kconfig                               |   2 +-
drivers/perf/riscv_pmu_sbi.c                       |   3 +-
lib/crc/riscv/crc-t10dif.h                         |   2 +-
lib/crc/riscv/crc32.h                              |   8 +-
lib/crc/riscv/crc64.h                              |   4 +-
lib/raid6/Makefile                                 |   4 +-
lib/raid6/algos.c                                  |   4 +-
66 files changed, 961 insertions(+), 749 deletions(-)
[PATCH RFC 00/10] riscv: Add support for rva23
Posted by Charlie Jenkins 1 month, 4 weeks ago
I will be talking about rva23 at Plumbers this year and have this series
as a draft of my ideas.

rva23 is a RVI profile to group together extensions that are expected to
be found on high-performance systems.

This series:
1. Introduces a framework to add extensions to the kernel cflags
2. Adds a rva23 config option 
3. Optimizes riscv_has_extension_*

This is based on 6.18 plus
https://lore.kernel.org/linux-riscv/20251020-riscv-altn-helper-wip-v4-0-ef941c87669a@iscas.ac.cn/.

Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
---
Charlie Jenkins (10):
      riscv: Standardize extension capitilization
      riscv: kconfig: Reorganize extensions
      riscv: kconfig: Simply arch selection
      riscv: kconfig: Make extensions tristate
      riscv: kconfig: Add zve32x
      riscv: Makefile: Add enabled extensions to compiler flags
      riscv: kconfig: Make vendor extensions tristate
      riscv: Optimize cpufeature macros for extension assumptions
      riscv: kconfig: Add rva23 config
      riscv: csum: Remove inline assembly

 arch/riscv/Kconfig                                 | 340 +--------------
 arch/riscv/Kconfig.extensions                      | 485 +++++++++++++++++++++
 arch/riscv/Kconfig.vendor                          |  25 +-
 arch/riscv/Makefile                                | 136 +++++-
 arch/riscv/include/asm/arch_hweight.h              |   4 +-
 arch/riscv/include/asm/archrandom.h                |   2 +-
 arch/riscv/include/asm/asm-prototypes.h            |   2 +-
 arch/riscv/include/asm/barrier.h                   |   2 +-
 arch/riscv/include/asm/bitops.h                    |   8 +-
 arch/riscv/include/asm/checksum.h                  |  32 --
 arch/riscv/include/asm/cmpxchg.h                   |  14 +-
 arch/riscv/include/asm/cpufeature-macros.h         | 136 ++++--
 arch/riscv/include/asm/cpufeature.h                |  42 +-
 arch/riscv/include/asm/hugetlb.h                   |   2 +-
 arch/riscv/include/asm/hwcap.h                     |  18 +-
 arch/riscv/include/asm/kgdb.h                      |   2 +-
 arch/riscv/include/asm/kvm_vcpu_vector.h           |   2 +-
 arch/riscv/include/asm/mmu.h                       |   2 +-
 arch/riscv/include/asm/mmu_context.h               |   4 +-
 arch/riscv/include/asm/page.h                      |   2 +-
 arch/riscv/include/asm/pgtable-64.h                |   2 +-
 arch/riscv/include/asm/pgtable.h                   |   6 +-
 arch/riscv/include/asm/processor.h                 |   2 +-
 arch/riscv/include/asm/simd.h                      |   2 +-
 arch/riscv/include/asm/swab.h                      |   2 +-
 arch/riscv/include/asm/switch_to.h                 |   4 +-
 arch/riscv/include/asm/uaccess.h                   |   2 +-
 arch/riscv/include/asm/uprobes.h                   |   2 +-
 arch/riscv/include/asm/vector.h                    |   7 +-
 arch/riscv/include/asm/vendor_extensions.h         | 113 ++---
 arch/riscv/include/asm/xor.h                       |   2 +-
 arch/riscv/kernel/Makefile                         |   6 +-
 arch/riscv/kernel/cpufeature.c                     |  38 +-
 arch/riscv/kernel/head.S                           |   2 +-
 arch/riscv/kernel/kgdb.c                           |   2 +-
 arch/riscv/kernel/pi/archrandom_early.c            |   1 +
 arch/riscv/kernel/probes/decode-insn.c             |   2 +-
 arch/riscv/kernel/probes/uprobes.c                 |   2 +-
 arch/riscv/kernel/process.c                        |  10 +-
 arch/riscv/kernel/ptrace.c                         |  12 +-
 arch/riscv/kernel/signal.c                         |   2 +-
 arch/riscv/kernel/suspend.c                        |   8 +-
 arch/riscv/kernel/sys_hwprobe.c                    |   4 +-
 arch/riscv/kernel/tests/kprobes/test-kprobes-asm.S |   6 +-
 arch/riscv/kernel/vendor_extensions/Makefile       |  22 +-
 arch/riscv/kvm/tlb.c                               |   2 +-
 arch/riscv/kvm/vcpu.c                              |  10 +-
 arch/riscv/kvm/vcpu_onereg.c                       |  22 +-
 arch/riscv/kvm/vcpu_vector.c                       |   2 +-
 arch/riscv/lib/Makefile                            |  14 +-
 arch/riscv/lib/csum.c                              |  94 ----
 arch/riscv/lib/strcmp.S                            |   2 +-
 arch/riscv/lib/strlen.S                            |   2 +-
 arch/riscv/lib/strncmp.S                           |   2 +-
 arch/riscv/lib/uaccess.S                           |   4 +-
 arch/riscv/mm/hugetlbpage.c                        |   2 +-
 arch/riscv/mm/pgtable.c                            |   2 +-
 arch/riscv/mm/tlbflush.c                           |   2 +-
 arch/riscv/net/bpf_jit.h                           |   2 +-
 drivers/perf/Kconfig                               |   2 +-
 drivers/perf/riscv_pmu_sbi.c                       |   3 +-
 lib/crc/riscv/crc-t10dif.h                         |   2 +-
 lib/crc/riscv/crc32.h                              |   8 +-
 lib/crc/riscv/crc64.h                              |   4 +-
 lib/raid6/Makefile                                 |   4 +-
 lib/raid6/algos.c                                  |   4 +-
 66 files changed, 961 insertions(+), 749 deletions(-)
---
base-commit: 537904d2226574c759e51bdf301ca8a90d0fdce1
change-id: 20250616-profiles-9cc63e29a9d9

Best regards,
-- 
Charlie Jenkins <thecharlesjenkins@gmail.com>
Re: [PATCH RFC 00/10] riscv: Add support for rva23
Posted by Paul Walmsley 3 weeks, 2 days ago
Hi Charlie,

On Wed, 10 Dec 2025, Charlie Jenkins wrote:

> I will be talking about rva23 at Plumbers this year and have this series
> as a draft of my ideas.
> 
> rva23 is a RVI profile to group together extensions that are expected to
> be found on high-performance systems.
> 
> This series:
> 1. Introduces a framework to add extensions to the kernel cflags
> 2. Adds a rva23 config option 
> 3. Optimizes riscv_has_extension_*
> 
> This is based on 6.18 plus
> https://lore.kernel.org/linux-riscv/20251020-riscv-altn-helper-wip-v4-0-ef941c87669a@iscas.ac.cn/.
> 
> Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>

Thanks for sending these.  A few suggestions, for when you resend these 
patches:

- Please split the cleanup patches into a separate, predecessor series 
  from the patches that are designed to change the way that extensions are 
  handled.  The latter patches will probably take longer to reach 
  consensus around.

- Probably best not to characterize the latter set of patches as "RVA23 
  support" patches, since they won't affect the kernel's ability to 
  support RVA23.  These just enable building an RVA23-specific kernel.  
  It's not entirely clear to me that this is a win -- I assume the 
  argument would be that the performance benefit for some systems would 
  justify the additional complexity and the performance reduction for 
  other systems? -- but that's what we'd need to discuss.

- Continuing that line of thinking, I think we'd want to see some 
  performance measurements after these patches are applied, on 
  hardware, for both RVA23-specific kernels and non-RVA23-specific 
  kernels, and the latter on both non-RVA23 hardware and RVA23 hardware.


thanks,

- Paul