Re: [PATCH v8 4/5] KVM: riscv: selftests: Fix compile error

2024-07-26 Thread Clément Léger
SIMPLE_CONFIG(zcf, ZCF), > +KVM_ISA_EXT_SIMPLE_CONFIG(zca, ZCA); > +KVM_ISA_EXT_SIMPLE_CONFIG(zcb, ZCB); > +KVM_ISA_EXT_SIMPLE_CONFIG(zcd, ZCD); > +KVM_ISA_EXT_SIMPLE_CONFIG(zcf, ZCF); > KVM_ISA_EXT_SIMPLE_CONFIG(zcmop, ZCMOP); > KVM_ISA_EXT_SIMPLE_CONFIG(zfa, ZFA); > KVM_ISA_EXT_SIMPLE_CONFIG(zfh, ZFH); Arg, my bad. Thanks for fixing that. Reviewed-by: Clément Léger Thanks, Clément

Re: [PATCH v7 08/16] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb

2024-06-24 Thread Clément Léger
On 23/06/2024 17:42, Conor Dooley wrote: > On Wed, Jun 19, 2024 at 01:35:18PM +0200, Clément Léger wrote: >> The Zc* standard extension for code reduction introduces new extensions. >> This patch adds support for Zca, Zcf, Zcd and Zcb. Zce, Zcmt and Zcmp >> are left ou

[PATCH 5/5] KVM: riscv: selftests: Add Zaamo/Zalrsc extensions to get-reg-list test

2024-06-19 Thread Clément Léger
The KVM RISC-V allows Zaamo/Zalrsc extensions for Guest/VM so add these extensions to get-reg-list test. Signed-off-by: Clément Léger --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 8 1 file changed, 8 insertions(+) diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c

[PATCH 4/5] RISC-V: KVM: Allow Zaamo/Zalrsc extensions for Guest/VM

2024-06-19 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zaamo/Zalrsc extensions for Guest/VM. Signed-off-by: Clément Léger --- arch/riscv/include/uapi/asm/kvm.h | 2 ++ arch/riscv/kvm/vcpu_onereg.c | 4 2 files changed, 6 insertions(+) diff --git

[PATCH 3/5] riscv: hwprobe: export Zaamo and Zalrsc extensions

2024-06-19 Thread Clément Léger
Export the Zaamo and Zalrsc extensions to userspace using hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 8 arch/riscv/include/uapi/asm/hwprobe.h | 2 ++ arch/riscv/kernel/sys_hwprobe.c | 2 ++ 3 files changed, 12 insertions(+) diff --git

[PATCH 2/5] riscv: add parsing for Zaamo and Zalrsc extensions

2024-06-19 Thread Clément Léger
These 2 new extensions are actually a subset of the A extension which provides atomic memory operations and load-reserved/store-conditional instructions. Signed-off-by: Clément Léger --- arch/riscv/include/asm/hwcap.h | 2 ++ arch/riscv/kernel/cpufeature.c | 9 - 2 files changed, 10

[PATCH 1/5] dt-bindings: riscv: add Zaamo and Zalrsc ISA extension description

2024-06-19 Thread Clément Léger
Add description for the Zaamo and Zalrsc ISA extension[1]. Link: https://github.com/riscv/riscv-zaamo-zalrsc [1] Signed-off-by: Clément Léger --- .../devicetree/bindings/riscv/extensions.yaml | 19 +++ 1 file changed, 19 insertions(+) diff --git a/Documentation/devicetree

[PATCH 0/5] riscv: add support for Zaamo and Zalrsc extensions

2024-06-19 Thread Clément Léger
9.676940-1-cle...@rivosinc.com/ --- Clément Léger (5): dt-bindings: riscv: add Zaamo and Zalrsc ISA extension description riscv: add parsing for Zaamo and Zalrsc extensions riscv: hwprobe: export Zaamo and Zalrsc extensions RISC-V: KVM: Allow Zaamo/Zalrsc extensions for Guest/VM KVM: riscv:

[PATCH v7 16/16] KVM: riscv: selftests: Add Zcmop extension to get-reg-list test

2024-06-19 Thread Clément Léger
The KVM RISC-V allows Zcmop extension for Guest/VM so add this extension to get-reg-list test. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing

[PATCH v7 15/16] RISC-V: KVM: Allow Zcmop extension for Guest/VM

2024-06-19 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zcmop extension for Guest/VM. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_onereg.c | 2 ++ 2 files

[PATCH v7 14/16] riscv: hwprobe: export Zcmop ISA extension

2024-06-19 Thread Clément Léger
Export Zcmop ISA extension through hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 4 arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_hwprobe.c | 1 + 3 files changed, 6 insertions(+) diff --git a/Documentation/arch/riscv

[PATCH v7 13/16] riscv: add ISA extension parsing for Zcmop

2024-06-19 Thread Clément Léger
Add parsing for Zcmop ISA extension which was ratified in commit c732a4f39a4c ("Zcmop is ratified/1.0") of the riscv-isa-manual. Signed-off-by: Clément Léger Reviewed-by: Conor Dooley Reviewed-by: Charlie Jenkins --- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpufea

[PATCH v7 12/16] dt-bindings: riscv: add Zcmop ISA extension description

2024-06-19 Thread Clément Léger
Add description for the Zcmop (Compressed May-Be-Operations) ISA extension which was ratified in commit c732a4f39a4c ("Zcmop is ratified/1.0") of the riscv-isa-manual. Signed-off-by: Clément Léger Acked-by: Conor Dooley --- .../devicetree/bindings/riscv/extensions.yaml

[PATCH v7 11/16] KVM: riscv: selftests: Add some Zc* extensions to get-reg-list test

2024-06-19 Thread Clément Léger
The KVM RISC-V allows Zca, Zcf, Zcd and Zcb extensions for Guest/VM so add these extensions to get-reg-list test. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 16 1 file changed, 16 insertions

[PATCH v7 10/16] RISC-V: KVM: Allow Zca, Zcf, Zcd and Zcb extensions for Guest/VM

2024-06-19 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zca, Zcf, Zcd and Zcb extensions for Guest/VM. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 4 arch/riscv/kvm/vcpu_onereg.c

[PATCH v7 09/16] riscv: hwprobe: export Zca, Zcf, Zcd and Zcb ISA extensions

2024-06-19 Thread Clément Léger
Export Zca, Zcf, Zcd and Zcb ISA extension through hwprobe. Signed-off-by: Clément Léger Reviewed-by: Charlie Jenkins --- Documentation/arch/riscv/hwprobe.rst | 20 arch/riscv/include/uapi/asm/hwprobe.h | 4 arch/riscv/kernel/sys_hwprobe.c | 4 3 files

[PATCH v7 08/16] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb

2024-06-19 Thread Clément Léger
The Zc* standard extension for code reduction introduces new extensions. This patch adds support for Zca, Zcf, Zcd and Zcb. Zce, Zcmt and Zcmp are left out of this patch since they are targeting microcontrollers/ embedded CPUs instead of application processors. Signed-off-by: Clément Léger

[PATCH v7 07/16] riscv: add ISA extensions validation callback

2024-06-19 Thread Clément Léger
h a stable state. In order to avoid any potential infinite looping, allow looping a maximum of the number of extension we handle. Zicboz and Zicbom extensions are modified to use this validation mechanism. Signed-off-by: Clément Léger Reviewed-by: Conor Dooley --- arch/riscv/include/asm/cpufeatu

[PATCH v7 06/16] dt-bindings: riscv: add Zca, Zcf, Zcd and Zcb ISA extension description

2024-06-19 Thread Clément Léger
-by: Clément Léger Reviewed-by: Conor Dooley Reviewed-by: Charlie Jenkins --- .../devicetree/bindings/riscv/extensions.yaml | 78 +++ 1 file changed, 78 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv

[PATCH v7 05/16] KVM: riscv: selftests: Add Zimop extension to get-reg-list test

2024-06-19 Thread Clément Léger
The KVM RISC-V allows Zimop extension for Guest/VM so add this extension to get-reg-list test. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing

[PATCH v7 04/16] RISC-V: KVM: Allow Zimop extension for Guest/VM

2024-06-19 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zimop extension for Guest/VM. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_onereg.c | 2 ++ 2 files

[PATCH v7 03/16] riscv: hwprobe: export Zimop ISA extension

2024-06-19 Thread Clément Léger
Export Zimop ISA extension through hwprobe. Signed-off-by: Clément Léger Reviewed-by: Charlie Jenkins --- Documentation/arch/riscv/hwprobe.rst | 4 arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_hwprobe.c | 1 + 3 files changed, 6 insertions(+) diff --git

[PATCH v7 02/16] riscv: add ISA extension parsing for Zimop

2024-06-19 Thread Clément Léger
Add parsing for Zimop ISA extension which was ratified in commit 58220614a5f of the riscv-isa-manual. Signed-off-by: Clément Léger Reviewed-by: Charlie Jenkins --- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpufeature.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch

[PATCH v7 01/16] dt-bindings: riscv: add Zimop ISA extension description

2024-06-19 Thread Clément Léger
Add description for the Zimop (May-Be-Operations) ISA extension which was ratified in commit 58220614a5f of the riscv-isa-manual. Signed-off-by: Clément Léger Reviewed-by: Charlie Jenkins --- Documentation/devicetree/bindings/riscv/extensions.yaml | 5 + 1 file changed, 5 insertions

[PATCH v7 00/16] Add support for a few Zc* extensions, Zcmop and Zimop

2024-06-19 Thread Clément Léger
://lore.kernel.org/lkml/20240410091106.749233-1-cle...@rivosinc.com/ Clément Léger (16): dt-bindings: riscv: add Zimop ISA extension description riscv: add ISA extension parsing for Zimop riscv: hwprobe: export Zimop ISA extension RISC-V: KVM: Allow Zimop extension for Guest/VM KVM: risc

[PATCH v6 13/16] riscv: add ISA extension parsing for Zcmop

2024-06-04 Thread Clément Léger
Add parsing for Zcmop ISA extension which was ratified in commit c732a4f39a4c ("Zcmop is ratified/1.0") of the riscv-isa-manual. Signed-off-by: Clément Léger Reviewed-by: Conor Dooley Reviewed-by: Charlie Jenkins --- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpufea

[PATCH v6 16/16] KVM: riscv: selftests: Add Zcmop extension to get-reg-list test

2024-06-04 Thread Clément Léger
The KVM RISC-V allows Zcmop extension for Guest/VM so add this extension to get-reg-list test. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing

[PATCH v6 15/16] RISC-V: KVM: Allow Zcmop extension for Guest/VM

2024-06-04 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zcmop extension for Guest/VM. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_onereg.c | 2 ++ 2 files

[PATCH v6 14/16] riscv: hwprobe: export Zcmop ISA extension

2024-06-04 Thread Clément Léger
Export Zcmop ISA extension through hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 4 arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_hwprobe.c | 1 + 3 files changed, 6 insertions(+) diff --git a/Documentation/arch/riscv

[PATCH v6 12/16] dt-bindings: riscv: add Zcmop ISA extension description

2024-06-04 Thread Clément Léger
Add description for the Zcmop (Compressed May-Be-Operations) ISA extension which was ratified in commit c732a4f39a4c ("Zcmop is ratified/1.0") of the riscv-isa-manual. Signed-off-by: Clément Léger Acked-by: Conor Dooley --- .../devicetree/bindings/riscv/extensions.yaml

[PATCH v6 11/16] KVM: riscv: selftests: Add some Zc* extensions to get-reg-list test

2024-06-04 Thread Clément Léger
The KVM RISC-V allows Zca, Zcf, Zcd and Zcb extensions for Guest/VM so add these extensions to get-reg-list test. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 16 1 file changed, 16 insertions

[PATCH v6 10/16] RISC-V: KVM: Allow Zca, Zcf, Zcd and Zcb extensions for Guest/VM

2024-06-04 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zca, Zcf, Zcd and Zcb extensions for Guest/VM. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 4 arch/riscv/kvm/vcpu_onereg.c

[PATCH v6 09/16] riscv: hwprobe: export Zca, Zcf, Zcd and Zcb ISA extensions

2024-06-04 Thread Clément Léger
Export Zca, Zcf, Zcd and Zcb ISA extension through hwprobe. Signed-off-by: Clément Léger Reviewed-by: Charlie Jenkins --- Documentation/arch/riscv/hwprobe.rst | 20 arch/riscv/include/uapi/asm/hwprobe.h | 4 arch/riscv/kernel/sys_hwprobe.c | 4 3 files

[PATCH v6 08/16] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb

2024-06-04 Thread Clément Léger
The Zc* standard extension for code reduction introduces new extensions. This patch adds support for Zca, Zcf, Zcd and Zcb. Zce, Zcmt and Zcmp are left out of this patch since they are targeting microcontrollers/ embedded CPUs instead of application processors. Signed-off-by: Clément Léger

[PATCH v6 07/16] riscv: add ISA extensions validation callback

2024-06-04 Thread Clément Léger
h a stable state. In order to avoid any potential infinite looping, allow looping a maximum of the number of extension we handle. Zicboz and Zicbom extensions are modified to use this validation mechanism. Signed-off-by: Clément Léger Reviewed-by: Conor Dooley --- arch/riscv/include/asm/cpufeatu

[PATCH v6 06/16] dt-bindings: riscv: add Zca, Zcf, Zcd and Zcb ISA extension description

2024-06-04 Thread Clément Léger
-by: Clément Léger Reviewed-by: Conor Dooley Reviewed-by: Charlie Jenkins --- .../devicetree/bindings/riscv/extensions.yaml | 78 +++ 1 file changed, 78 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv

[PATCH v6 05/16] KVM: riscv: selftests: Add Zimop extension to get-reg-list test

2024-06-04 Thread Clément Léger
The KVM RISC-V allows Zimop extension for Guest/VM so add this extension to get-reg-list test. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing

[PATCH v6 04/16] RISC-V: KVM: Allow Zimop extension for Guest/VM

2024-06-04 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zimop extension for Guest/VM. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_onereg.c | 2 ++ 2 files

[PATCH v6 03/16] riscv: hwprobe: export Zimop ISA extension

2024-06-04 Thread Clément Léger
Export Zimop ISA extension through hwprobe. Signed-off-by: Clément Léger Reviewed-by: Charlie Jenkins --- Documentation/arch/riscv/hwprobe.rst | 4 arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_hwprobe.c | 1 + 3 files changed, 6 insertions(+) diff --git

[PATCH v6 02/16] riscv: add ISA extension parsing for Zimop

2024-06-04 Thread Clément Léger
Add parsing for Zimop ISA extension which was ratified in commit 58220614a5f of the riscv-isa-manual. Signed-off-by: Clément Léger Reviewed-by: Charlie Jenkins --- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpufeature.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch

[PATCH v6 01/16] dt-bindings: riscv: add Zimop ISA extension description

2024-06-04 Thread Clément Léger
Add description for the Zimop (May-Be-Operations) ISA extension which was ratified in commit 58220614a5f of the riscv-isa-manual. Signed-off-by: Clément Léger Reviewed-by: Charlie Jenkins --- Documentation/devicetree/bindings/riscv/extensions.yaml | 5 + 1 file changed, 5 insertions

[PATCH v6 00/16] Add support for a few Zc* extensions, Zcmop and Zimop

2024-06-04 Thread Clément Léger
3-1-cle...@rivosinc.com/ Clément Léger (16): dt-bindings: riscv: add Zimop ISA extension description riscv: add ISA extension parsing for Zimop riscv: hwprobe: export Zimop ISA extension RISC-V: KVM: Allow Zimop extension for Guest/VM KVM: riscv: selftests: Add Zimop extension to get-reg-list te

Re: [PATCH v5 08/16] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb

2024-06-04 Thread Clément Léger
On 30/05/2024 23:13, Palmer Dabbelt wrote: > On Wed, 22 May 2024 00:20:09 PDT (-0700), cle...@rivosinc.com wrote: >> >> >> On 21/05/2024 21:49, Conor Dooley wrote: >>> On Fri, May 17, 2024 at 04:52:48PM +0200, Clément Léger wrote: >>> >>>

Re: [PATCH v5 02/16] riscv: add ISA extension parsing for Zimop

2024-05-30 Thread Clément Léger
On 30/05/2024 16:37, Charlie Jenkins wrote: > On Thu, May 30, 2024 at 10:12:39AM +0200, Clément Léger wrote: >> >> >> On 30/05/2024 00:21, Charlie Jenkins wrote: >>> On Wed, May 29, 2024 at 03:08:39PM -0700, Charlie Jenkins wrote: >>>> On Fri, May 1

Re: [PATCH v5 02/16] riscv: add ISA extension parsing for Zimop

2024-05-30 Thread Clément Léger
On 30/05/2024 00:21, Charlie Jenkins wrote: > On Wed, May 29, 2024 at 03:08:39PM -0700, Charlie Jenkins wrote: >> On Fri, May 17, 2024 at 04:52:42PM +0200, Clément Léger wrote: >>> Add parsing for Zimop ISA extension which was ratified in commit >>> 58220614

Re: [PATCH v5 08/16] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb

2024-05-22 Thread Clément Léger
On 21/05/2024 21:49, Conor Dooley wrote: > On Fri, May 17, 2024 at 04:52:48PM +0200, Clément Léger wrote: > >> +static int riscv_ext_zca_depends(const struct riscv_isa_ext_data *data, >> + const unsigned long *isa_bitmap) &g

Re: [PATCH v5 07/16] riscv: add ISA extensions validation callback

2024-05-21 Thread Clément Léger
On 17/05/2024 18:44, Conor Dooley wrote: > On Fri, May 17, 2024 at 04:52:47PM +0200, Clément Léger wrote: >> Since a few extensions (Zicbom/Zicboz) already needs validation and >> future ones will need it as well (Zc*) add a validate() callback to >> struct riscv_isa_e

[PATCH v5 16/16] KVM: riscv: selftests: Add Zcmop extension to get-reg-list test

2024-05-17 Thread Clément Léger
The KVM RISC-V allows Zcmop extension for Guest/VM so add this extension to get-reg-list test. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing

[PATCH v5 15/16] RISC-V: KVM: Allow Zcmop extension for Guest/VM

2024-05-17 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zcmop extension for Guest/VM. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_onereg.c | 2 ++ 2 files

[PATCH v5 14/16] riscv: hwprobe: export Zcmop ISA extension

2024-05-17 Thread Clément Léger
Export Zcmop ISA extension through hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 4 arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_hwprobe.c | 1 + 3 files changed, 6 insertions(+) diff --git a/Documentation/arch/riscv

[PATCH v5 13/16] riscv: add ISA extension parsing for Zcmop

2024-05-17 Thread Clément Léger
Add parsing for Zcmop ISA extension which was ratified in commit b854a709c00 ("Zcmop is ratified/1.0") of the riscv-isa-manual. Signed-off-by: Clément Léger --- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpufeature.c | 1 + 2 files changed, 2 insertions(+) diff --git a/

[PATCH v5 12/16] dt-bindings: riscv: add Zcmop ISA extension description

2024-05-17 Thread Clément Léger
Add description for the Zcmop (Compressed May-Be-Operations) ISA extension which was ratified in commit c732a4f39a4 ("Zcmop is ratified/1.0") of the riscv-isa-manual. Signed-off-by: Clément Léger Acked-by: Conor Dooley --- .../devicetree/bindings/riscv/extensions.yaml

[PATCH v5 11/16] KVM: riscv: selftests: Add some Zc* extensions to get-reg-list test

2024-05-17 Thread Clément Léger
The KVM RISC-V allows Zca, Zcf, Zcd and Zcb extensions for Guest/VM so add these extensions to get-reg-list test. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 16 1 file changed, 16 insertions

[PATCH v5 10/16] RISC-V: KVM: Allow Zca, Zcf, Zcd and Zcb extensions for Guest/VM

2024-05-17 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zca, Zcf, Zcd and Zcb extensions for Guest/VM. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 4 arch/riscv/kvm/vcpu_onereg.c

[PATCH v5 09/16] riscv: hwprobe: export Zca, Zcf, Zcd and Zcb ISA extensions

2024-05-17 Thread Clément Léger
Export Zca, Zcf, Zcd and Zcb ISA extension through hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 20 arch/riscv/include/uapi/asm/hwprobe.h | 4 arch/riscv/kernel/sys_hwprobe.c | 4 3 files changed, 28 insertions(+) diff

[PATCH v5 08/16] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb

2024-05-17 Thread Clément Léger
The Zc* standard extension for code reduction introduces new extensions. This patch adds support for Zca, Zcf, Zcd and Zcb. Zce, Zcmt and Zcmp are left out of this patch since they are targeting microcontrollers/ embedded CPUs instead of application processors. Signed-off-by: Clément Léger

[PATCH v5 07/16] riscv: add ISA extensions validation callback

2024-05-17 Thread Clément Léger
h a stable state. In order to avoid any potential infinite looping, allow looping a maximum of the number of extension we handle. Zicboz and Zicbom extensions are modified to use this validation mechanism. Signed-off-by: Clément Léger --- arch/riscv/include/asm/cpufeature.h | 23 ++-- arch/ri

[PATCH v5 06/16] dt-bindings: riscv: add Zca, Zcf, Zcd and Zcb ISA extension description

2024-05-17 Thread Clément Léger
-by: Clément Léger Reviewed-by: Conor Dooley --- .../devicetree/bindings/riscv/extensions.yaml | 78 +++ 1 file changed, 78 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml index b9100addeb90

[PATCH v5 05/16] KVM: riscv: selftests: Add Zimop extension to get-reg-list test

2024-05-17 Thread Clément Léger
The KVM RISC-V allows Zimop extension for Guest/VM so add this extension to get-reg-list test. Signed-off-by: Clément Léger --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c b/tools

[PATCH v5 03/16] riscv: hwprobe: export Zimop ISA extension

2024-05-17 Thread Clément Léger
Export Zimop ISA extension through hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 4 arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_hwprobe.c | 1 + 3 files changed, 6 insertions(+) diff --git a/Documentation/arch/riscv

[PATCH v5 04/16] RISC-V: KVM: Allow Zimop extension for Guest/VM

2024-05-17 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zimop extension for Guest/VM. Signed-off-by: Clément Léger --- arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_onereg.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/arch/riscv

[PATCH v5 02/16] riscv: add ISA extension parsing for Zimop

2024-05-17 Thread Clément Léger
Add parsing for Zimop ISA extension which was ratified in commit 58220614a5f of the riscv-isa-manual. Signed-off-by: Clément Léger --- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpufeature.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/riscv/include/asm/hwcap.h b/arch

[PATCH v5 01/16] dt-bindings: riscv: add Zimop ISA extension description

2024-05-17 Thread Clément Léger
Add description for the Zimop (May-Be-Operations) ISA extension which was ratified in commit 58220614a5f of the riscv-isa-manual. Signed-off-by: Clément Léger --- Documentation/devicetree/bindings/riscv/extensions.yaml | 5 + 1 file changed, 5 insertions(+) diff --git a/Documentation

[PATCH v5 00/16] Add support for a few Zc* extensions, Zcmop and Zimop

2024-05-17 Thread Clément Léger
://lore.kernel.org/lkml/20240410091106.749233-1-cle...@rivosinc.com/ Clément Léger (16): dt-bindings: riscv: add Zimop ISA extension description riscv: add ISA extension parsing for Zimop riscv: hwprobe: export Zimop ISA extension RISC-V: KVM: Allow Zimop extension for Guest/VM KVM: riscv: selftes

Re: [PATCH v4 02/11] riscv: add ISA extensions validation

2024-05-15 Thread Clément Léger
On 14/05/2024 19:39, Conor Dooley wrote: > On Mon, Apr 29, 2024 at 05:04:55PM +0200, Clément Léger wrote: >> Since a few extensions (Zicbom/Zicboz) already needs validation and >> future ones will need it as well (Zc*) add a validate() callback to >> struct riscv_isa_e

Re: [PATCH v4 02/11] riscv: add ISA extensions validation

2024-05-14 Thread Clément Léger
On 14/05/2024 14:43, Conor Dooley wrote: > On Tue, May 14, 2024 at 09:53:08AM +0200, Clément Léger wrote: >> >> >> On 30/04/2024 13:44, Conor Dooley wrote: >>> On Tue, Apr 30, 2024 at 09:18:47AM +0200, Clément Léger wrote: >>>> >>>> >

Re: [PATCH v4 02/11] riscv: add ISA extensions validation

2024-05-14 Thread Clément Léger
On 30/04/2024 13:44, Conor Dooley wrote: > On Tue, Apr 30, 2024 at 09:18:47AM +0200, Clément Léger wrote: >> >> >> On 30/04/2024 00:15, Conor Dooley wrote: >>> On Mon, Apr 29, 2024 at 05:04:55PM +0200, Clément Léger wrote: >>>> Since a few extension

Re: [PATCH v4 02/11] riscv: add ISA extensions validation

2024-04-30 Thread Clément Léger
On 30/04/2024 14:12, Conor Dooley wrote: > On Tue, Apr 30, 2024 at 01:58:11PM +0200, Clément Léger wrote: >> Yeah, see what you mean. I think we also need to define if we want to >> expose all the ISA extensions in /proc/cpuinfo (ie no matter the config >> of the

Re: [PATCH v4 02/11] riscv: add ISA extensions validation

2024-04-30 Thread Clément Léger
On 30/04/2024 13:44, Conor Dooley wrote: > On Tue, Apr 30, 2024 at 09:18:47AM +0200, Clément Léger wrote: >> >> >> On 30/04/2024 00:15, Conor Dooley wrote: >>> On Mon, Apr 29, 2024 at 05:04:55PM +0200, Clément Léger wrote: >>>> Since a few extension

Re: [PATCH v4 02/11] riscv: add ISA extensions validation

2024-04-30 Thread Clément Léger
On 30/04/2024 00:15, Conor Dooley wrote: > On Mon, Apr 29, 2024 at 05:04:55PM +0200, Clément Léger wrote: >> Since a few extensions (Zicbom/Zicboz) already needs validation and >> future ones will need it as well (Zc*) add a validate() callback to >> struct riscv_isa_e

[PATCH v4 09/11] riscv: hwprobe: export Zcmop ISA extension

2024-04-29 Thread Clément Léger
Export Zcmop ISA extension through hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 4 arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_hwprobe.c | 1 + 3 files changed, 6 insertions(+) diff --git a/Documentation/arch/riscv

[PATCH v4 11/11] KVM: riscv: selftests: Add Zcmop extension to get-reg-list test

2024-04-29 Thread Clément Léger
The KVM RISC-V allows Zcmop extension for Guest/VM so add this extension to get-reg-list test. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing

[PATCH v4 10/11] RISC-V: KVM: Allow Zcmop extension for Guest/VM

2024-04-29 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zcmop extension for Guest/VM. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_onereg.c | 2 ++ 2 files

[PATCH v4 08/11] riscv: add ISA extension parsing for Zcmop

2024-04-29 Thread Clément Léger
Add parsing for Zcmop ISA extension which was ratified in commit b854a709c00 ("Zcmop is ratified/1.0") of the riscv-isa-manual. Signed-off-by: Clément Léger --- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpufeature.c | 1 + 2 files changed, 2 insertions(+) diff --git a/

[PATCH v4 07/11] dt-bindings: riscv: add Zcmop ISA extension description

2024-04-29 Thread Clément Léger
Add description for the Zcmop (Compressed May-Be-Operations) ISA extension which was ratified in commit c732a4f39a4 ("Zcmop is ratified/1.0") of the riscv-isa-manual. Signed-off-by: Clément Léger Acked-by: Conor Dooley --- .../devicetree/bindings/riscv/extensions.yaml

[PATCH v4 06/11] KVM: riscv: selftests: Add some Zc* extensions to get-reg-list test

2024-04-29 Thread Clément Léger
The KVM RISC-V allows Zca, Zcf, Zcd and Zcb extensions for Guest/VM so add these extensions to get-reg-list test. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 16 1 file changed, 16 insertions

[PATCH v4 05/11] RISC-V: KVM: Allow Zca, Zcf, Zcd and Zcb extensions for Guest/VM

2024-04-29 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zca, Zcf, Zcd and Zcb extensions for Guest/VM. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 4 arch/riscv/kvm/vcpu_onereg.c

[PATCH v4 04/11] riscv: hwprobe: export Zca, Zcf, Zcd and Zcb ISA extensions

2024-04-29 Thread Clément Léger
Export Zca, Zcf, Zcd and Zcb ISA extension through hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 20 arch/riscv/include/uapi/asm/hwprobe.h | 4 arch/riscv/kernel/sys_hwprobe.c | 4 3 files changed, 28 insertions(+) diff

[PATCH v4 03/11] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb

2024-04-29 Thread Clément Léger
The Zc* standard extension for code reduction introduces new extensions. This patch adds support for Zca, Zcf, Zcd and Zcb. Zce, Zcmt and Zcmp are left out of this patch since they are targeting microcontrollers/ embedded CPUs instead of application processors. Signed-off-by: Clément Léger

[PATCH v4 02/11] riscv: add ISA extensions validation

2024-04-29 Thread Clément Léger
. In order to avoid any potential infinite looping, allow looping a maximum of the number of extension we handle. Zicboz and Zicbom extensions are modified to use this validation mechanism. Signed-off-by: Clément Léger --- arch/riscv/include/asm/cpufeature.h | 1 + arch/riscv/kernel/cpufeature.c

[PATCH v4 01/11] dt-bindings: riscv: add Zca, Zcf, Zcd and Zcb ISA extension description

2024-04-29 Thread Clément Léger
-by: Clément Léger Reviewed-by: Conor Dooley --- .../devicetree/bindings/riscv/extensions.yaml | 78 +++ 1 file changed, 78 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml index 616370318a66

[PATCH v4 00/11] Add support for a few Zc* extensions as well as Zcmop

2024-04-29 Thread Clément Léger
s://lore.kernel.org/all/20240418124300.1387978-1-cle...@rivosinc.com/ v2: - Add Zc* dependencies validation in dt-bindings - v1: https://lore.kernel.org/lkml/20240410091106.749233-1-cle...@rivosinc.com/ Clément Léger (11): dt-bindings: riscv: add Zca, Zcf, Zcd and Zcb ISA extension descr

Re: [PATCH v3 02/11] riscv: add ISA extensions validation

2024-04-29 Thread Clément Léger
On 26/04/2024 16:23, Conor Dooley wrote: > On Tue, Apr 23, 2024 at 02:43:16PM +0200, Clément Léger wrote: >> Since a few extensions (Zicbom/Zicboz) already needs validation and >> future ones will need it as well (Zc*) add a validate() callback to >> struct riscv_isa_e

[PATCH v3 07/11] dt-bindings: riscv: add Zcmop ISA extension description

2024-04-23 Thread Clément Léger
Add description for the Zcmop (Compressed May-Be-Operations) ISA extension which was ratified in commit c732a4f39a4 ("Zcmop is ratified/1.0") of the riscv-isa-manual. Signed-off-by: Clément Léger Acked-by: Conor Dooley --- .../devicetree/bindings/riscv/extensions.yaml

[PATCH v3 11/11] KVM: riscv: selftests: Add Zcmop extension to get-reg-list test

2024-04-23 Thread Clément Léger
The KVM RISC-V allows Zcmop extension for Guest/VM so add this extension to get-reg-list test. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing

[PATCH v3 10/11] RISC-V: KVM: Allow Zcmop extension for Guest/VM

2024-04-23 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zcmop extension for Guest/VM. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_onereg.c | 2 ++ 2 files

[PATCH v3 09/11] riscv: hwprobe: export Zcmop ISA extension

2024-04-23 Thread Clément Léger
Export Zcmop ISA extension through hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 4 arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_hwprobe.c | 1 + 3 files changed, 6 insertions(+) diff --git a/Documentation/arch/riscv

[PATCH v3 08/11] riscv: add ISA extension parsing for Zcmop

2024-04-23 Thread Clément Léger
Add parsing for Zcmop ISA extension which was ratified in commit b854a709c00 ("Zcmop is ratified/1.0") of the riscv-isa-manual. Signed-off-by: Clément Léger --- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpufeature.c | 1 + 2 files changed, 2 insertions(+) diff --git a/

[PATCH v3 06/11] KVM: riscv: selftests: Add some Zc* extensions to get-reg-list test

2024-04-23 Thread Clément Léger
The KVM RISC-V allows Zca, Zcf, Zcd and Zcb extensions for Guest/VM so add these extensions to get-reg-list test. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 16 1 file changed, 16 insertions

[PATCH v3 05/11] RISC-V: KVM: Allow Zca, Zcf, Zcd and Zcb extensions for Guest/VM

2024-04-23 Thread Clément Léger
Extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zca, Zcf, Zcd and Zcb extensions for Guest/VM. Signed-off-by: Clément Léger Reviewed-by: Anup Patel Acked-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 4 arch/riscv/kvm/vcpu_onereg.c

[PATCH v3 04/11] riscv: hwprobe: export Zca, Zcf, Zcd and Zcb ISA extensions

2024-04-23 Thread Clément Léger
Export Zca, Zcf, Zcd and Zcb ISA extension through hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 20 arch/riscv/include/uapi/asm/hwprobe.h | 4 arch/riscv/kernel/sys_hwprobe.c | 4 3 files changed, 28 insertions(+) diff

[PATCH v3 03/11] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb

2024-04-23 Thread Clément Léger
The Zc* standard extension for code reduction introduces new extensions. This patch adds support for Zca, Zcf, Zcd and Zcb. Zce, Zcmt and Zcmp are left out of this patch since they are targeting microcontrollers/ embedded CPUs instead of application processors. Signed-off-by: Clément Léger

[PATCH v3 02/11] riscv: add ISA extensions validation

2024-04-23 Thread Clément Léger
m. Signed-off-by: Clément Léger --- arch/riscv/include/asm/cpufeature.h | 1 + arch/riscv/kernel/cpufeature.c | 201 2 files changed, 118 insertions(+), 84 deletions(-) diff --git a/arch/riscv/include/asm/cpufeature.h b/arch/riscv/include/asm/cpufeatu

[PATCH v3 01/11] dt-bindings: riscv: add Zca, Zcf, Zcd and Zcb ISA extension description

2024-04-23 Thread Clément Léger
-by: Clément Léger Reviewed-by: Conor Dooley --- .../devicetree/bindings/riscv/extensions.yaml | 78 +++ 1 file changed, 78 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml index 616370318a66

[PATCH v3 00/11] Add support for a few Zc* extensions as well as Zcmop

2024-04-23 Thread Clément Léger
0410091106.749233-1-cle...@rivosinc.com/ Clément Léger (11): dt-bindings: riscv: add Zca, Zcf, Zcd and Zcb ISA extension description riscv: add ISA extensions validation riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb riscv: hwprobe: export Zca, Zcf, Zcd and Zcb ISA extensions RISC-V: K

Re: [PATCH v2 04/12] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb

2024-04-22 Thread Clément Léger
On 22/04/2024 13:36, Conor Dooley wrote: > On Mon, Apr 22, 2024 at 01:14:26PM +0200, Clément Léger wrote: >> On 22/04/2024 11:35, Conor Dooley wrote: >>> On Mon, Apr 22, 2024 at 10:53:10AM +0200, Clément Léger wrote: >>>> On 19/04/2024 17:51, Conor Dooley wrote: &g

Re: [PATCH v2 03/12] dt-bindings: riscv: add Zc* extension rules implied by C extension

2024-04-22 Thread Clément Léger
On 22/04/2024 13:19, Conor Dooley wrote: > On Mon, Apr 22, 2024 at 10:53:04AM +0200, Clément Léger wrote: >> On 19/04/2024 17:49, Conor Dooley wrote: >>> On Thu, Apr 18, 2024 at 02:42:26PM +0200, Clément Léger wrote: >>>> As stated by Zc* spec: >>>>

Re: [PATCH v2 04/12] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb

2024-04-22 Thread Clément Léger
On 22/04/2024 11:35, Conor Dooley wrote: > On Mon, Apr 22, 2024 at 10:53:10AM +0200, Clément Léger wrote: >> On 19/04/2024 17:51, Conor Dooley wrote: >>> On Thu, Apr 18, 2024 at 02:42:27PM +0200, Clément Léger wrote: >>>> The Zc* standard extension for code reduc

Re: [PATCH v2 04/12] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb

2024-04-22 Thread Clément Léger
On 19/04/2024 17:51, Conor Dooley wrote: > On Thu, Apr 18, 2024 at 02:42:27PM +0200, Clément Léger wrote: >> The Zc* standard extension for code reduction introduces new extensions. >> This patch adds support for Zca, Zcf, Zcd and Zcb. Zce, Zcmt and Zcmp >> are left ou

Re: [PATCH v2 03/12] dt-bindings: riscv: add Zc* extension rules implied by C extension

2024-04-22 Thread Clément Léger
On 19/04/2024 17:49, Conor Dooley wrote: > On Thu, Apr 18, 2024 at 02:42:26PM +0200, Clément Léger wrote: >> As stated by Zc* spec: >> >> "As C defines the same instructions as Zca, Zcf and Zcd, the rule is that: >> - C always implies Zca >> - C+F implies

  1   2   >