hw/riscv/riscv-iommu: set cmd_ill IOFENCE.C rsvp bits are set
We're not setting RISCV_IOMMU_CQCSR_CMD_ILL if a reserved bit happens to
be set in an IOFENCE.C command.
Fixes: 0c54acb824 ("hw/riscv: add RISC-V IOMMU base emulation")
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3575
Signed-off-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260626170533.3562484-1-daniel.barboza@oss.qualcomm.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
committed by
Alistair Francis
parent
dcd0285177
commit
6ed77682d5
@@ -347,6 +347,7 @@ struct riscv_iommu_command {
|
||||
#define RISCV_IOMMU_CMD_IOFENCE_OPCODE 2
|
||||
#define RISCV_IOMMU_CMD_IOFENCE_FUNC_C 0
|
||||
#define RISCV_IOMMU_CMD_IOFENCE_AV BIT_ULL(10)
|
||||
#define RISCV_IOMMU_CMD_IOFENCE_RESERVED GENMASK_ULL(31, 14)
|
||||
#define RISCV_IOMMU_CMD_IOFENCE_DATA GENMASK_ULL(63, 32)
|
||||
|
||||
#define RISCV_IOMMU_CMD_IODIR_OPCODE 3
|
||||
|
||||
@@ -1880,6 +1880,10 @@ static void riscv_iommu_process_cq_tail(RISCVIOMMUState *s)
|
||||
switch (cmd_opcode) {
|
||||
case RISCV_IOMMU_CMD(RISCV_IOMMU_CMD_IOFENCE_FUNC_C,
|
||||
RISCV_IOMMU_CMD_IOFENCE_OPCODE):
|
||||
if (cmd.dword0 & RISCV_IOMMU_CMD_IOFENCE_RESERVED) {
|
||||
goto cmd_ill;
|
||||
}
|
||||
|
||||
res = riscv_iommu_iofence(s,
|
||||
cmd.dword0 & RISCV_IOMMU_CMD_IOFENCE_AV, cmd.dword1 << 2,
|
||||
get_field(cmd.dword0, RISCV_IOMMU_CMD_IOFENCE_DATA));
|
||||
|
||||
Reference in New Issue
Block a user