Skip to contentSkip to conversation

linux-user/riscv: Add Zicboz block size to hwprobe

PATCH Applied Palmer Dabbelt 3 participants 4 messages Nov 10, 2023 – Nov 21, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user/riscv: Add Zicboz block size to hwprobe

Support for probing the Zicboz block size landed in Linux 6.6, which was released a few weeks ago. This provides the user-configured block size when Zicboz is enabled.

---
 linux-user/syscall.c | 6 ++++++
 1 file changed, 6 insertions(+)
linux-user/syscall.c +6 -0
index 65ac3ac796..7caacf43d6 100644
@@ -8808,6 +8808,8 @@ static int do_getdents64(abi_long dirfd, abi_long arg2, abi_long count)
 #define     RISCV_HWPROBE_MISALIGNED_UNSUPPORTED (4 << 0)
 #define     RISCV_HWPROBE_MISALIGNED_MASK        (7 << 0)
 
+#define RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE 6
+
 struct riscv_hwprobe {
     abi_llong  key;
     abi_ullong value;
@@ -8860,6 +8862,10 @@ static void risc_hwprobe_fill_pairs(CPURISCVState *env,
         case RISCV_HWPROBE_KEY_CPUPERF_0:
             __put_user(RISCV_HWPROBE_MISALIGNED_FAST, &pair->value);
             break;
+        case RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE:
+            value = cfg->ext_zicboz ? cfg->cboz_blocksize : 0;
+            __put_user(value, &pair->value);
+            break;
         default:
             __put_user(-1, &pair->key);
             break;
Signature · 1 line
2.42.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Palmer Dabbelt

Support for probing the Zicboz block size landed in Linux 6.6, which was released a few weeks ago. This provides the user-configured block size when Zicboz is enabled.

---

Quoted 27 lines
  linux-user/syscall.c | 6 ++++++
  1 file changed, 6 insertions(+)
linux-user/syscall.c +6 -0
index 65ac3ac796..7caacf43d6 100644
@@ -8808,6 +8808,8 @@ static int do_getdents64(abi_long dirfd, abi_long arg2, abi_long count)
  #define     RISCV_HWPROBE_MISALIGNED_UNSUPPORTED (4 << 0)
  #define     RISCV_HWPROBE_MISALIGNED_MASK        (7 << 0)
 
+#define RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE 6
+
  struct riscv_hwprobe {
      abi_llong  key;
      abi_ullong value;
@@ -8860,6 +8862,10 @@ static void risc_hwprobe_fill_pairs(CPURISCVState *env,
          case RISCV_HWPROBE_KEY_CPUPERF_0:
              __put_user(RISCV_HWPROBE_MISALIGNED_FAST, &pair->value);
              break;
+        case RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE:
+            value = cfg->ext_zicboz ? cfg->cboz_blocksize : 0;
+            __put_user(value, &pair->value);
+            break;
          default:
              __put_user(-1, &pair->key);
              break;
Reviewed-by on v1 1/1
#2 lore raw
In reply to Palmer Dabbelt
Quoted 6 lines · Palmer Dabbelt

Support for probing the Zicboz block size landed in Linux 6.6, which was released a few weeks ago. This provides the user-configured block size when Zicboz is enabled.

Alistair

Quoted 32 lines
---
 linux-user/syscall.c | 6 ++++++
 1 file changed, 6 insertions(+)
linux-user/syscall.c +6 -1
index 65ac3ac796..7caacf43d6 100644
@@ -8808,6 +8808,8 @@ static int do_getdents64(abi_long dirfd, abi_long arg2, abi_long count)
 #define     RISCV_HWPROBE_MISALIGNED_UNSUPPORTED (4 << 0)
 #define     RISCV_HWPROBE_MISALIGNED_MASK        (7 << 0)
 
+#define RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE 6
+
 struct riscv_hwprobe {
     abi_llong  key;
     abi_ullong value;
@@ -8860,6 +8862,10 @@ static void risc_hwprobe_fill_pairs(CPURISCVState *env,
         case RISCV_HWPROBE_KEY_CPUPERF_0:
             __put_user(RISCV_HWPROBE_MISALIGNED_FAST, &pair->value);
             break;
+        case RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE:
+            value = cfg->ext_zicboz ? cfg->cboz_blocksize : 0;
+            __put_user(value, &pair->value);
+            break;
         default:
             __put_user(-1, &pair->key);
             break;
--

2.42.1

#3 lore raw
In reply to Palmer Dabbelt
Quoted 6 lines · Palmer Dabbelt

Support for probing the Zicboz block size landed in Linux 6.6, which was released a few weeks ago. This provides the user-configured block size when Zicboz is enabled.

Thanks!

Applied to riscv-to-apply.next

Alistair

Quoted 32 lines
---
 linux-user/syscall.c | 6 ++++++
 1 file changed, 6 insertions(+)
linux-user/syscall.c +6 -1
index 65ac3ac796..7caacf43d6 100644
@@ -8808,6 +8808,8 @@ static int do_getdents64(abi_long dirfd, abi_long arg2, abi_long count)
 #define     RISCV_HWPROBE_MISALIGNED_UNSUPPORTED (4 << 0)
 #define     RISCV_HWPROBE_MISALIGNED_MASK        (7 << 0)
 
+#define RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE 6
+
 struct riscv_hwprobe {
     abi_llong  key;
     abi_ullong value;
@@ -8860,6 +8862,10 @@ static void risc_hwprobe_fill_pairs(CPURISCVState *env,
         case RISCV_HWPROBE_KEY_CPUPERF_0:
             __put_user(RISCV_HWPROBE_MISALIGNED_FAST, &pair->value);
             break;
+        case RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE:
+            value = cfg->ext_zicboz ? cfg->cboz_blocksize : 0;
+            __put_user(value, &pair->value);
+            break;
         default:
             __put_user(-1, &pair->key);
             break;
--

2.42.1