Skip to content

Commit

Permalink
linux-user/riscv: Add Zicboz block size to hwprobe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
palmer-dabbelt authored and alistair23 committed Nov 22, 2023
1 parent 8fa3791 commit 301c65f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions linux-user/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 301c65f

Please sign in to comment.