diff options
author | Daniel Henrique Barboza <dbarboza@ventanamicro.com> | 2023-07-06 07:17:23 -0300 |
---|---|---|
committer | Alistair Francis <alistair.francis@wdc.com> | 2023-07-10 22:29:15 +1000 |
commit | d6a427e2c0b249bc8d3e0b4d7c5150f829d0907a (patch) | |
tree | 28bca38db56850220efacc6a827a5f84b9bfa4ff /target/riscv/XVentanaCondOps.decode | |
parent | a1863ad368d32b53153bf417a83f01c85bb9d82c (diff) | |
download | qemu-d6a427e2c0b249bc8d3e0b4d7c5150f829d0907a.zip qemu-d6a427e2c0b249bc8d3e0b4d7c5150f829d0907a.tar.gz qemu-d6a427e2c0b249bc8d3e0b4d7c5150f829d0907a.tar.bz2 |
target/riscv/cpu.c: restrict 'marchid' value
'marchid' shouldn't be set to a different value as previously set for
named CPUs.
For all other CPUs it shouldn't be freely set either - the spec requires
that 'marchid' can't have the MSB (most significant bit) set and every
other bit set to zero, i.e. 0x80000000 is an invalid 'marchid' value for
32 bit CPUs.
As with 'mimpid', setting a default value based on the current QEMU
version is not a good idea because it implies that the CPU
implementation changes from one QEMU version to the other. Named CPUs
should set 'marchid' to a meaningful value instead, and generic CPUs can
set to any valid value.
For the 'veyron-v1' CPU this is the error thrown if 'marchid' is set to
a different val:
$ ./build/qemu-system-riscv64 -M virt -nographic -cpu veyron-v1,marchid=0x80000000
qemu-system-riscv64: can't apply global veyron-v1-riscv-cpu.marchid=0x80000000:
Unable to change veyron-v1-riscv-cpu marchid (0x8000000000010000)
And, for generics CPUs, this is the error when trying to set to an
invalid val:
$ ./build/qemu-system-riscv64 -M virt -nographic -cpu rv64,marchid=0x8000000000000000
qemu-system-riscv64: can't apply global rv64-riscv-cpu.marchid=0x8000000000000000:
Unable to set marchid with MSB (64) bit set and the remaining bits zero
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20230706101738.460804-6-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'target/riscv/XVentanaCondOps.decode')
0 files changed, 0 insertions, 0 deletions