target/riscv: Raise exceptions on wrs.nto
authorAndrew Jones <ajones@ventanamicro.com>
Wed, 24 Apr 2024 14:28:09 +0000 (16:28 +0200)
committerAlistair Francis <alistair.francis@wdc.com>
Mon, 3 Jun 2024 01:12:11 +0000 (11:12 +1000)
commitb62e0ce76098d53c875f0aff70776f08418ccb58
treeea08d27f6fd180070d1b619ee00980ee35be6b1c
parent86997772fa807f3961e5aeed97af7738adec1b43
target/riscv: Raise exceptions on wrs.nto

Implementing wrs.nto to always just return is consistent with the
specification, as the instruction is permitted to terminate the
stall for any reason, but it's not useful for virtualization, where
we'd like the guest to trap to the hypervisor in order to allow
scheduling of the lock holding VCPU. Change to always immediately
raise exceptions when the appropriate conditions are present,
otherwise continue to just return. Note, immediately raising
exceptions is also consistent with the specification since the
time limit that should expire prior to the exception is
implementation-specific.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Christoph Müllner <christoph.muellner@vrull.eu>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20240424142808.62936-2-ajones@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/helper.h
target/riscv/insn_trans/trans_rvzawrs.c.inc
target/riscv/op_helper.c