Skip to contentSkip to conversation

riscv: hwprobe: export Zicntr and Zihpm extensions

PATCH Superseded Miquel Sabaté Solà 4 participants 9 messages Aug 17, 2024 – Sep 9, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: hwprobe: export Zicntr and Zihpm extensions

Export Zicntr and Zihpm ISA extensions through the hwprobe syscall.

---
 Documentation/arch/riscv/hwprobe.rst  | 6 ++++++
 arch/riscv/include/uapi/asm/hwprobe.h | 2 ++
 arch/riscv/kernel/sys_hwprobe.c       | 2 ++
 3 files changed, 10 insertions(+)
Documentation/arch/riscv/hwprobe.rst +6 -0
index 3db60a0911df..5bb69c985cce 100644
@@ -188,10 +188,16 @@ The following keys are defined:
        manual starting from commit 95cf1f9 ("Add changes requested by Ved
        during signoff")
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZICNTR`: The Zicntr extension version 2.0
+       is supported as defined in the RISC-V ISA manual.
+
   * :c:macro:`RISCV_HWPROBE_EXT_ZIHINTPAUSE`: The Zihintpause extension is
        supported as defined in the RISC-V ISA manual starting from commit
        d8ab5c78c207 ("Zihintpause is ratified").
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZIHPM`: The Zihpm extension version 2.0
+       is supported as defined in the RISC-V ISA manual.
+
   * :c:macro:`RISCV_HWPROBE_EXT_ZVE32X`: The Vector sub-extension Zve32x is
     supported, as defined by version 1.0 of the RISC-V Vector extension manual.
 
arch/riscv/include/uapi/asm/hwprobe.h +2 -0
index b706c8e47b02..098a815b3fd4 100644
@@ -72,6 +72,8 @@ struct riscv_hwprobe {
 #define		RISCV_HWPROBE_EXT_ZCF		(1ULL << 46)
 #define		RISCV_HWPROBE_EXT_ZCMOP		(1ULL << 47)
 #define		RISCV_HWPROBE_EXT_ZAWRS		(1ULL << 48)
+#define		RISCV_HWPROBE_EXT_ZICNTR	(1ULL << 49)
+#define		RISCV_HWPROBE_EXT_ZIHPM		(1ULL << 50)
 #define RISCV_HWPROBE_KEY_CPUPERF_0	5
 #define		RISCV_HWPROBE_MISALIGNED_UNKNOWN	(0 << 0)
 #define		RISCV_HWPROBE_MISALIGNED_EMULATED	(1 << 0)
arch/riscv/kernel/sys_hwprobe.c +2 -0
index 8d1b5c35d2a7..30aede1c90ff 100644
@@ -118,6 +118,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
 		EXT_KEY(ZKSH);
 		EXT_KEY(ZKT);
 		EXT_KEY(ZTSO);
+		EXT_KEY(ZICNTR);
+		EXT_KEY(ZIHPM);
 
 		/*
 		 * All the following extensions must depend on the kernel
Signature · 1 line
2.46.0
Acked-by on v1 1/1
#1 lore raw
Quoted 49 lines · Miquel Sabaté Solà

Export Zicntr and Zihpm ISA extensions through the hwprobe syscall.

---
 Documentation/arch/riscv/hwprobe.rst  | 6 ++++++
 arch/riscv/include/uapi/asm/hwprobe.h | 2 ++
 arch/riscv/kernel/sys_hwprobe.c       | 2 ++
 3 files changed, 10 insertions(+)
Documentation/arch/riscv/hwprobe.rst +6 -0
index 3db60a0911df..5bb69c985cce 100644
@@ -188,10 +188,16 @@ The following keys are defined:
        manual starting from commit 95cf1f9 ("Add changes requested by Ved
        during signoff")
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZICNTR`: The Zicntr extension version 2.0
+       is supported as defined in the RISC-V ISA manual.
+
   * :c:macro:`RISCV_HWPROBE_EXT_ZIHINTPAUSE`: The Zihintpause extension is
        supported as defined in the RISC-V ISA manual starting from commit
        d8ab5c78c207 ("Zihintpause is ratified").
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZIHPM`: The Zihpm extension version 2.0
+       is supported as defined in the RISC-V ISA manual.
+
   * :c:macro:`RISCV_HWPROBE_EXT_ZVE32X`: The Vector sub-extension Zve32x is
     supported, as defined by version 1.0 of the RISC-V Vector extension manual.
 
arch/riscv/include/uapi/asm/hwprobe.h +2 -0
index b706c8e47b02..098a815b3fd4 100644
@@ -72,6 +72,8 @@ struct riscv_hwprobe {
 #define                RISCV_HWPROBE_EXT_ZCF           (1ULL << 46)
 #define                RISCV_HWPROBE_EXT_ZCMOP         (1ULL << 47)
 #define                RISCV_HWPROBE_EXT_ZAWRS         (1ULL << 48)
+#define                RISCV_HWPROBE_EXT_ZICNTR        (1ULL << 49)
+#define                RISCV_HWPROBE_EXT_ZIHPM         (1ULL << 50)
 #define RISCV_HWPROBE_KEY_CPUPERF_0    5
 #define                RISCV_HWPROBE_MISALIGNED_UNKNOWN        (0 << 0)
 #define                RISCV_HWPROBE_MISALIGNED_EMULATED       (1 << 0)
arch/riscv/kernel/sys_hwprobe.c +0 -0
index 8d1b5c35d2a7..30aede1c90ff 100644

arch/riscv/kernel/sys_hwprobe.c static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, · line 122

Quoted 5 lines
arch/riscv/kernel/sys_hwprobe.c +2 -0
@@ -118,6 +118,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
                EXT_KEY(ZKSH);
                EXT_KEY(ZKT);
                EXT_KEY(ZTSO);
+               EXT_KEY(ZICNTR);
+               EXT_KEY(ZIHPM);

Conor, do we care about ordering?

Quoted 11 lines
arch/riscv/kernel/sys_hwprobe.c +0 -1
                /*
                 * All the following extensions must depend on the kernel
--

2.46.0

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#2 lore raw
Quoted 32 lines · Jesse Taube
Quoted 31 lines · Miquel Sabaté Solà

Export Zicntr and Zihpm ISA extensions through the hwprobe syscall.

---
 Documentation/arch/riscv/hwprobe.rst  | 6 ++++++
 arch/riscv/include/uapi/asm/hwprobe.h | 2 ++
 arch/riscv/kernel/sys_hwprobe.c       | 2 ++
 3 files changed, 10 insertions(+)
Documentation/arch/riscv/hwprobe.rst +6 -0
index 3db60a0911df..5bb69c985cce 100644
@@ -188,10 +188,16 @@ The following keys are defined:
        manual starting from commit 95cf1f9 ("Add changes requested by Ved
        during signoff")
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZICNTR`: The Zicntr extension version 2.0
+       is supported as defined in the RISC-V ISA manual.
+
   * :c:macro:`RISCV_HWPROBE_EXT_ZIHINTPAUSE`: The Zihintpause extension is
        supported as defined in the RISC-V ISA manual starting from commit
        d8ab5c78c207 ("Zihintpause is ratified").
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZIHPM`: The Zihpm extension version 2.0
+       is supported as defined in the RISC-V ISA manual.
+
   * :c:macro:`RISCV_HWPROBE_EXT_ZVE32X`: The Vector sub-extension Zve32x is
     supported, as defined by version 1.0 of the RISC-V Vector extension manual.
 
Quoted 13 lines

arch/riscv/include/uapi/asm/hwprobe.h struct riscv_hwprobe { · line 79

Quoted 13 lines
arch/riscv/include/uapi/asm/hwprobe.h +2 -0
index b706c8e47b02..098a815b3fd4 100644
@@ -72,6 +72,8 @@ struct riscv_hwprobe {
 #define                RISCV_HWPROBE_EXT_ZCF           (1ULL << 46)
 #define                RISCV_HWPROBE_EXT_ZCMOP         (1ULL << 47)
 #define                RISCV_HWPROBE_EXT_ZAWRS         (1ULL << 48)
+#define                RISCV_HWPROBE_EXT_ZICNTR        (1ULL << 49)
+#define                RISCV_HWPROBE_EXT_ZIHPM         (1ULL << 50)
 #define RISCV_HWPROBE_KEY_CPUPERF_0    5
 #define                RISCV_HWPROBE_MISALIGNED_UNKNOWN        (0 << 0)
 #define                RISCV_HWPROBE_MISALIGNED_EMULATED       (1 << 0)

The sort here, by number, is fine.

Quoted 4 lines
Quoted 4 lines
arch/riscv/kernel/sys_hwprobe.c +0 -0
index 8d1b5c35d2a7..30aede1c90ff 100644
Quoted 8 lines

arch/riscv/kernel/sys_hwprobe.c static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, · line 122

Quoted 6 lines
arch/riscv/kernel/sys_hwprobe.c +2 -0
@@ -118,6 +118,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
                EXT_KEY(ZKSH);
                EXT_KEY(ZKT);
                EXT_KEY(ZTSO);
+               EXT_KEY(ZICNTR);
+               EXT_KEY(ZIHPM);

Conor, do we care about ordering?

I would rather that they were sorted alphabetically. Adding to the end is nothing but a conflict generator and makes it harder to see what is and what is not in the list. IIRC Palmer applied the patch I sent a few weeks ago that sorted the entries in all of these EXT_KEY() lists.

#3 lore raw
Quoted 62 lines · Jesse Taube
Quoted 32 lines · Miquel Sabaté Solà
Quoted 31 lines

Export Zicntr and Zihpm ISA extensions through the hwprobe syscall.

---
 Documentation/arch/riscv/hwprobe.rst  | 6 ++++++
 arch/riscv/include/uapi/asm/hwprobe.h | 2 ++
 arch/riscv/kernel/sys_hwprobe.c       | 2 ++
 3 files changed, 10 insertions(+)
Documentation/arch/riscv/hwprobe.rst +6 -0
index 3db60a0911df..5bb69c985cce 100644
@@ -188,10 +188,16 @@ The following keys are defined:
        manual starting from commit 95cf1f9 ("Add changes requested by Ved
        during signoff")
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZICNTR`: The Zicntr extension version 2.0
+       is supported as defined in the RISC-V ISA manual.
+
   * :c:macro:`RISCV_HWPROBE_EXT_ZIHINTPAUSE`: The Zihintpause extension is
        supported as defined in the RISC-V ISA manual starting from commit
        d8ab5c78c207 ("Zihintpause is ratified").
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZIHPM`: The Zihpm extension version 2.0
+       is supported as defined in the RISC-V ISA manual.
+
   * :c:macro:`RISCV_HWPROBE_EXT_ZVE32X`: The Vector sub-extension Zve32x is
     supported, as defined by version 1.0 of the RISC-V Vector extension manual.
 
Quoted 13 lines

arch/riscv/include/uapi/asm/hwprobe.h struct riscv_hwprobe { · line 79

Quoted 13 lines
arch/riscv/include/uapi/asm/hwprobe.h +2 -0
index b706c8e47b02..098a815b3fd4 100644
@@ -72,6 +72,8 @@ struct riscv_hwprobe {
 #define                RISCV_HWPROBE_EXT_ZCF           (1ULL << 46)
 #define                RISCV_HWPROBE_EXT_ZCMOP         (1ULL << 47)
 #define                RISCV_HWPROBE_EXT_ZAWRS         (1ULL << 48)
+#define                RISCV_HWPROBE_EXT_ZICNTR        (1ULL << 49)
+#define                RISCV_HWPROBE_EXT_ZIHPM         (1ULL << 50)
 #define RISCV_HWPROBE_KEY_CPUPERF_0    5
 #define                RISCV_HWPROBE_MISALIGNED_UNKNOWN        (0 << 0)
 #define                RISCV_HWPROBE_MISALIGNED_EMULATED       (1 << 0)

The sort here, by number, is fine.

Quoted 4 lines
Quoted 4 lines
arch/riscv/kernel/sys_hwprobe.c +0 -0
index 8d1b5c35d2a7..30aede1c90ff 100644
Quoted 8 lines

arch/riscv/kernel/sys_hwprobe.c static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, · line 122

Quoted 6 lines
arch/riscv/kernel/sys_hwprobe.c +2 -0
@@ -118,6 +118,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
                EXT_KEY(ZKSH);
                EXT_KEY(ZKT);
                EXT_KEY(ZTSO);
+               EXT_KEY(ZICNTR);
+               EXT_KEY(ZIHPM);

Conor, do we care about ordering?

Quoted 4 lines

I would rather that they were sorted alphabetically. Adding to the end is nothing but a conflict generator and makes it harder to see what is and what is not in the list. IIRC Palmer applied the patch I sent a few weeks ago that sorted the entries in all of these EXT_KEY() lists.

Makes a lot of sense. Let me send a new version of the patch with they keys sorted.

#4 lore raw

PATCH v2 1/1 riscv: hwprobe: export Zicntr and Zihpm extensions

In reply to Miquel Sabaté Solà

Export Zicntr and Zihpm ISA extensions through the hwprobe syscall.

---
 Documentation/arch/riscv/hwprobe.rst  | 6 ++++++
 arch/riscv/include/uapi/asm/hwprobe.h | 2 ++
 arch/riscv/kernel/sys_hwprobe.c       | 2 ++
 3 files changed, 10 insertions(+)
Documentation/arch/riscv/hwprobe.rst +6 -0
index 3db60a0911df..cfd2929d0562 100644
@@ -183,6 +183,9 @@ The following keys are defined:
        defined in the Atomic Compare-and-Swap (CAS) instructions manual starting
        from commit 5059e0ca641c ("update to ratified").
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZICNTR`: The Zicntr extension version 2.0
+       is supported as defined in the RISC-V ISA manual.
+
   * :c:macro:`RISCV_HWPROBE_EXT_ZICOND`: The Zicond extension is supported as
        defined in the RISC-V Integer Conditional (Zicond) operations extension
        manual starting from commit 95cf1f9 ("Add changes requested by Ved
@@ -192,6 +195,9 @@ The following keys are defined:
        supported as defined in the RISC-V ISA manual starting from commit
        d8ab5c78c207 ("Zihintpause is ratified").
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZIHPM`: The Zihpm extension version 2.0
+       is supported as defined in the RISC-V ISA manual.
+
   * :c:macro:`RISCV_HWPROBE_EXT_ZVE32X`: The Vector sub-extension Zve32x is
     supported, as defined by version 1.0 of the RISC-V Vector extension manual.
 
arch/riscv/include/uapi/asm/hwprobe.h +2 -0
index b706c8e47b02..098a815b3fd4 100644
@@ -72,6 +72,8 @@ struct riscv_hwprobe {
 #define		RISCV_HWPROBE_EXT_ZCF		(1ULL << 46)
 #define		RISCV_HWPROBE_EXT_ZCMOP		(1ULL << 47)
 #define		RISCV_HWPROBE_EXT_ZAWRS		(1ULL << 48)
+#define		RISCV_HWPROBE_EXT_ZICNTR	(1ULL << 49)
+#define		RISCV_HWPROBE_EXT_ZIHPM		(1ULL << 50)
 #define RISCV_HWPROBE_KEY_CPUPERF_0	5
 #define		RISCV_HWPROBE_MISALIGNED_UNKNOWN	(0 << 0)
 #define		RISCV_HWPROBE_MISALIGNED_EMULATED	(1 << 0)
arch/riscv/kernel/sys_hwprobe.c +2 -0
index 8d1b5c35d2a7..910b41b6a7ab 100644
@@ -107,9 +107,11 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
 		EXT_KEY(ZCB);
 		EXT_KEY(ZCMOP);
 		EXT_KEY(ZICBOZ);
+		EXT_KEY(ZICNTR);
 		EXT_KEY(ZICOND);
 		EXT_KEY(ZIHINTNTL);
 		EXT_KEY(ZIHINTPAUSE);
+		EXT_KEY(ZIHPM);
 		EXT_KEY(ZIMOP);
 		EXT_KEY(ZKND);
 		EXT_KEY(ZKNE);

base-commit: dc1c8034e31b14a2e5e212104ec508aec44ce1b9

Signature · 1 line
2.46.0
#5 lore raw
Quoted 63 lines · Miquel Sabaté Solà

Export Zicntr and Zihpm ISA extensions through the hwprobe syscall.

---
 Documentation/arch/riscv/hwprobe.rst  | 6 ++++++
 arch/riscv/include/uapi/asm/hwprobe.h | 2 ++
 arch/riscv/kernel/sys_hwprobe.c       | 2 ++
 3 files changed, 10 insertions(+)
Documentation/arch/riscv/hwprobe.rst +6 -0
index 3db60a0911df..cfd2929d0562 100644
@@ -183,6 +183,9 @@ The following keys are defined:
        defined in the Atomic Compare-and-Swap (CAS) instructions manual starting
        from commit 5059e0ca641c ("update to ratified").
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZICNTR`: The Zicntr extension version 2.0
+       is supported as defined in the RISC-V ISA manual.
+
   * :c:macro:`RISCV_HWPROBE_EXT_ZICOND`: The Zicond extension is supported as
        defined in the RISC-V Integer Conditional (Zicond) operations extension
        manual starting from commit 95cf1f9 ("Add changes requested by Ved
@@ -192,6 +195,9 @@ The following keys are defined:
        supported as defined in the RISC-V ISA manual starting from commit
        d8ab5c78c207 ("Zihintpause is ratified").
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZIHPM`: The Zihpm extension version 2.0
+       is supported as defined in the RISC-V ISA manual.
+
   * :c:macro:`RISCV_HWPROBE_EXT_ZVE32X`: The Vector sub-extension Zve32x is
     supported, as defined by version 1.0 of the RISC-V Vector extension manual.
 
arch/riscv/include/uapi/asm/hwprobe.h +2 -0
index b706c8e47b02..098a815b3fd4 100644
@@ -72,6 +72,8 @@ struct riscv_hwprobe {
 #define		RISCV_HWPROBE_EXT_ZCF		(1ULL << 46)
 #define		RISCV_HWPROBE_EXT_ZCMOP		(1ULL << 47)
 #define		RISCV_HWPROBE_EXT_ZAWRS		(1ULL << 48)
+#define		RISCV_HWPROBE_EXT_ZICNTR	(1ULL << 49)
+#define		RISCV_HWPROBE_EXT_ZIHPM		(1ULL << 50)
 #define RISCV_HWPROBE_KEY_CPUPERF_0	5
 #define		RISCV_HWPROBE_MISALIGNED_UNKNOWN	(0 << 0)
 #define		RISCV_HWPROBE_MISALIGNED_EMULATED	(1 << 0)
arch/riscv/kernel/sys_hwprobe.c +2 -0
index 8d1b5c35d2a7..910b41b6a7ab 100644
@@ -107,9 +107,11 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
 		EXT_KEY(ZCB);
 		EXT_KEY(ZCMOP);
 		EXT_KEY(ZICBOZ);
+		EXT_KEY(ZICNTR);
 		EXT_KEY(ZICOND);
 		EXT_KEY(ZIHINTNTL);
 		EXT_KEY(ZIHINTPAUSE);
+		EXT_KEY(ZIHPM);
 		EXT_KEY(ZIMOP);
 		EXT_KEY(ZKND);
 		EXT_KEY(ZKNE);
Quoted 1 line

base-commit: dc1c8034e31b14a2e5e212104ec508aec44ce1b9

Hello,

Can I get a review on this version of this patchset?

Thanks,
Miquel

Reviewed-by
#6 lore raw
Quoted 65 lines · Miquel Sabaté Solà
Quoted 63 lines · Miquel Sabaté Solà

Export Zicntr and Zihpm ISA extensions through the hwprobe syscall.

---
 Documentation/arch/riscv/hwprobe.rst  | 6 ++++++
 arch/riscv/include/uapi/asm/hwprobe.h | 2 ++
 arch/riscv/kernel/sys_hwprobe.c       | 2 ++
 3 files changed, 10 insertions(+)
Documentation/arch/riscv/hwprobe.rst +6 -0
index 3db60a0911df..cfd2929d0562 100644
@@ -183,6 +183,9 @@ The following keys are defined:
        defined in the Atomic Compare-and-Swap (CAS) instructions manual starting
        from commit 5059e0ca641c ("update to ratified").
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZICNTR`: The Zicntr extension version 2.0
+       is supported as defined in the RISC-V ISA manual.
+
   * :c:macro:`RISCV_HWPROBE_EXT_ZICOND`: The Zicond extension is supported as
        defined in the RISC-V Integer Conditional (Zicond) operations extension
        manual starting from commit 95cf1f9 ("Add changes requested by Ved
@@ -192,6 +195,9 @@ The following keys are defined:
        supported as defined in the RISC-V ISA manual starting from commit
        d8ab5c78c207 ("Zihintpause is ratified").
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZIHPM`: The Zihpm extension version 2.0
+       is supported as defined in the RISC-V ISA manual.
+
   * :c:macro:`RISCV_HWPROBE_EXT_ZVE32X`: The Vector sub-extension Zve32x is
     supported, as defined by version 1.0 of the RISC-V Vector extension manual.
 
arch/riscv/include/uapi/asm/hwprobe.h +2 -0
index b706c8e47b02..098a815b3fd4 100644
@@ -72,6 +72,8 @@ struct riscv_hwprobe {
 #define		RISCV_HWPROBE_EXT_ZCF		(1ULL << 46)
 #define		RISCV_HWPROBE_EXT_ZCMOP		(1ULL << 47)
 #define		RISCV_HWPROBE_EXT_ZAWRS		(1ULL << 48)
+#define		RISCV_HWPROBE_EXT_ZICNTR	(1ULL << 49)
+#define		RISCV_HWPROBE_EXT_ZIHPM		(1ULL << 50)
 #define RISCV_HWPROBE_KEY_CPUPERF_0	5
 #define		RISCV_HWPROBE_MISALIGNED_UNKNOWN	(0 << 0)
 #define		RISCV_HWPROBE_MISALIGNED_EMULATED	(1 << 0)
arch/riscv/kernel/sys_hwprobe.c +2 -0
index 8d1b5c35d2a7..910b41b6a7ab 100644
@@ -107,9 +107,11 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
 		EXT_KEY(ZCB);
 		EXT_KEY(ZCMOP);
 		EXT_KEY(ZICBOZ);
+		EXT_KEY(ZICNTR);
 		EXT_KEY(ZICOND);
 		EXT_KEY(ZIHINTNTL);
 		EXT_KEY(ZIHINTPAUSE);
+		EXT_KEY(ZIHPM);
 		EXT_KEY(ZIMOP);
 		EXT_KEY(ZKND);
 		EXT_KEY(ZKNE);
Quoted 5 lines
Quoted 1 line

base-commit: dc1c8034e31b14a2e5e212104ec508aec44ce1b9

Hello,

Can I get a review on this version of this patchset?

By the way, I totally missed this first time around because the v2 was sent as a reply to v1 - it's pretty common for people to view their mailbox sorted by thread, and sending new versions as a reply will bury it.

Cheers,
Conor.

#7 lore raw
Quoted 74 lines · Conor Dooley
Quoted 65 lines · Miquel Sabaté Solà
Quoted 63 lines · Miquel Sabaté Solà

Export Zicntr and Zihpm ISA extensions through the hwprobe syscall.

---
 Documentation/arch/riscv/hwprobe.rst  | 6 ++++++
 arch/riscv/include/uapi/asm/hwprobe.h | 2 ++
 arch/riscv/kernel/sys_hwprobe.c       | 2 ++
 3 files changed, 10 insertions(+)
Documentation/arch/riscv/hwprobe.rst +6 -0
index 3db60a0911df..cfd2929d0562 100644
@@ -183,6 +183,9 @@ The following keys are defined:
        defined in the Atomic Compare-and-Swap (CAS) instructions manual starting
        from commit 5059e0ca641c ("update to ratified").
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZICNTR`: The Zicntr extension version 2.0
+       is supported as defined in the RISC-V ISA manual.
+
   * :c:macro:`RISCV_HWPROBE_EXT_ZICOND`: The Zicond extension is supported as
        defined in the RISC-V Integer Conditional (Zicond) operations extension
        manual starting from commit 95cf1f9 ("Add changes requested by Ved
@@ -192,6 +195,9 @@ The following keys are defined:
        supported as defined in the RISC-V ISA manual starting from commit
        d8ab5c78c207 ("Zihintpause is ratified").
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZIHPM`: The Zihpm extension version 2.0
+       is supported as defined in the RISC-V ISA manual.
+
   * :c:macro:`RISCV_HWPROBE_EXT_ZVE32X`: The Vector sub-extension Zve32x is
     supported, as defined by version 1.0 of the RISC-V Vector extension manual.
 
arch/riscv/include/uapi/asm/hwprobe.h +2 -0
index b706c8e47b02..098a815b3fd4 100644
@@ -72,6 +72,8 @@ struct riscv_hwprobe {
 #define		RISCV_HWPROBE_EXT_ZCF		(1ULL << 46)
 #define		RISCV_HWPROBE_EXT_ZCMOP		(1ULL << 47)
 #define		RISCV_HWPROBE_EXT_ZAWRS		(1ULL << 48)
+#define		RISCV_HWPROBE_EXT_ZICNTR	(1ULL << 49)
+#define		RISCV_HWPROBE_EXT_ZIHPM		(1ULL << 50)
 #define RISCV_HWPROBE_KEY_CPUPERF_0	5
 #define		RISCV_HWPROBE_MISALIGNED_UNKNOWN	(0 << 0)
 #define		RISCV_HWPROBE_MISALIGNED_EMULATED	(1 << 0)
arch/riscv/kernel/sys_hwprobe.c +2 -0
index 8d1b5c35d2a7..910b41b6a7ab 100644
@@ -107,9 +107,11 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
 		EXT_KEY(ZCB);
 		EXT_KEY(ZCMOP);
 		EXT_KEY(ZICBOZ);
+		EXT_KEY(ZICNTR);
 		EXT_KEY(ZICOND);
 		EXT_KEY(ZIHINTNTL);
 		EXT_KEY(ZIHINTPAUSE);
+		EXT_KEY(ZIHPM);
 		EXT_KEY(ZIMOP);
 		EXT_KEY(ZKND);
 		EXT_KEY(ZKNE);
Quoted 5 lines
Quoted 1 line

base-commit: dc1c8034e31b14a2e5e212104ec508aec44ce1b9

Hello,

Can I get a review on this version of this patchset?

Quoted 7 lines

By the way, I totally missed this first time around because the v2 was sent as a reply to v1 - it's pretty common for people to view their mailbox sorted by thread, and sending new versions as a reply will bury it.

Cheers,
Conor.

Thanks for the review!

This is my first contribution to the Linux kernel, as you can tell :) Will keep in mind next time!

Thanks,
Miquel

#8 lore raw
Quoted 9 lines · Miquel Sabaté Solà
Quoted 7 lines · Conor Dooley
Quoted 1 line · Miquel Sabaté Solà

On dt., d’ag. 20 2024, Miquel Sabaté Solà wrote:

By the way, I totally missed this first time around because the v2 was sent as a reply to v1 - it's pretty common for people to view their mailbox sorted by thread, and sending new versions as a reply will bury it.

Quoted 4 lines

Thanks for the review!

This is my first contribution to the Linux kernel, as you can tell :) Will keep in mind next time!

No worries & welcome.
It did end up in patchwork, so it was unlikely to get permanently lost:
https://patchwork.kernel.org/project/linux-riscv/patch/[email protected]/