From: David Hoppenbrouwers <[email protected]>
According to the AMD I/O Virtualization Technology (IOMMU) Specification
(Rev 3.10), Section 2.4 Commands, the Generic Command Buffer Entry Format
encodes the opcode in bits [63:60] of the command buffer.
When handling illegal opcodes, the traces for unhandled commands and event
log info extract the opcode from an incorrect offset in the command buffer.
Fix this issue to avoid potential confusion with mismatched opcodes in
traces and unlikely errors in guest event processing.
Fixes: d29a09ca68428 ("hw/i386: Introduce AMD IOMMU")
Signed-off-by: David Hoppenbrouwers <[email protected]>
Reviewed-by: Sairaj Kodilkar <[email protected]>
Acked-by: Igor Mammedov <[email protected]>
Signed-off-by: Alejandro Jimenez <[email protected]>
---
Sending v2 to the list for visibility before inclusion in 11.1.
v2 changes:
- Edit title and commit message with IOMMU spec reference.
- Add Reviewed-by and Acked-by from v1.
hw/i386/amd_iommu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index 79216fb305..05b7c638f4 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -1509,9 +1509,9 @@ static void amdvi_cmdbuf_exec(AMDVIState *s)
amdvi_inval_all(s, cmd);
break;
default:
- trace_amdvi_unhandled_command(extract64(cmd[1], 60, 4));
+ trace_amdvi_unhandled_command(extract64(cmd[0], 60, 4));
/* log illegal command */
- amdvi_log_illegalcom_error(s, extract64(cmd[1], 60, 4),
+ amdvi_log_illegalcom_error(s, extract64(cmd[0], 60, 4),
s->cmdbuf + s->cmdbuf_head);
}
}
base-commit: 608ad9307d5b4797d2254ee3a4bad2bc8c8bcbae
--
2.47.3