diff options
author | Palmer Dabbelt <palmer@rivosinc.com> | 2023-11-10 09:37:16 -0800 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2023-11-29 16:14:17 +0300 |
commit | 8d0b8fead4c85addce1b0fa6132c9c8fc08fe06e (patch) | |
tree | 95d9f820ca5432001eba86c2f19effd3543ccb5b /linux-user | |
parent | 8328d7962106709fcb4f48e20a43291ffa872b55 (diff) |
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.
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20231110173716.24423-1-palmer@rivosinc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
(cherry picked from commit 301c65f49f9602f39b9f3ce0ad9ff70d4bda7226)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(Mjt: fixup linux-user/syscall.c to before v8.1.0-2602-ge57039ddab
"target/riscv: rename ext_icboz to ext_zicboz")
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/syscall.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 9353268cc1..bd0c99859d 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -9058,6 +9058,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; @@ -9102,6 +9104,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_icboz ? cfg->cboz_blocksize : 0; + __put_user(value, &pair->value); + break; default: __put_user(-1, &pair->key); break; |