diff mbox series

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

Message ID 20231110173716.24423-1-palmer@rivosinc.com (mailing list archive)
State New, archived
Headers show
Series linux-user/riscv: Add Zicboz block size to hwprobe | expand

Commit Message

Palmer Dabbelt Nov. 10, 2023, 5:37 p.m. UTC
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.

Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
 linux-user/syscall.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Daniel Henrique Barboza Nov. 11, 2023, 8:14 a.m. UTC | #1
On 11/10/23 14:37, Palmer Dabbelt wrote:
> 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.
> 
> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
> ---

Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>


>   linux-user/syscall.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 65ac3ac796..7caacf43d6 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -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;
Alistair Francis Nov. 21, 2023, 3:31 a.m. UTC | #2
On Sat, Nov 11, 2023 at 3:52 AM Palmer Dabbelt <palmer@rivosinc.com> wrote:
>
> 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.
>
> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  linux-user/syscall.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 65ac3ac796..7caacf43d6 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -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
>
>
Alistair Francis Nov. 21, 2023, 3:34 a.m. UTC | #3
On Sat, Nov 11, 2023 at 3:52 AM Palmer Dabbelt <palmer@rivosinc.com> wrote:
>
> 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.
>
> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

Thanks!

Applied to riscv-to-apply.next

Alistair

> ---
>  linux-user/syscall.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 65ac3ac796..7caacf43d6 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -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
>
>
diff mbox series

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 65ac3ac796..7caacf43d6 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -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;