aboutsummaryrefslogtreecommitdiff
path: root/hw/i386/amd_iommu.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2017-03-13 14:55:20 -0500
committerStefan Hajnoczi <stefanha@redhat.com>2017-03-24 09:21:42 +0000
commit0d3ef78829332f2fdc323d1b625b60fe9c89119c (patch)
treece750e37dc1615a77a3010bc3d5316b6f29c285d /hw/i386/amd_iommu.c
parentd17e744848cac9a96c827be1f244ef9266710d8f (diff)
downloadqemu-0d3ef78829332f2fdc323d1b625b60fe9c89119c.zip
qemu-0d3ef78829332f2fdc323d1b625b60fe9c89119c.tar.gz
qemu-0d3ef78829332f2fdc323d1b625b60fe9c89119c.tar.bz2
trace: Avoid abuse of amdvi_mmio_read
hw/i386/trace-events has an amdvi_mmio_read trace that is used for both normal reads (listing the register name, address, size, and offset) and for an error case (abusing the register name to show an error message, the address to show the maximum value supported, then shoehorning address and size into the size and offset parameters). The change from a wide address to a narrower size parameter could truncate a (rather-large) bogus read attempt, so it's better to create a separate dedicated trace with correct types, rather than abusing the trace mechanism. Broken since its introduction in commit d29a09c. [Change trace event argument type from hwaddr to uint64_t since user-defined types should not be used for trace events. This fixes a build failure with LTTng UST. --Stefan] Signed-off-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/i386/amd_iommu.c')
-rw-r--r--hw/i386/amd_iommu.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index e0732cc..f86a40a 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -572,8 +572,7 @@ static uint64_t amdvi_mmio_read(void *opaque, hwaddr addr, unsigned size)
uint64_t val = -1;
if (addr + size > AMDVI_MMIO_SIZE) {
- trace_amdvi_mmio_read("error: addr outside region: max ",
- (uint64_t)AMDVI_MMIO_SIZE, addr, size);
+ trace_amdvi_mmio_read_invalid(AMDVI_MMIO_SIZE, addr, size);
return (uint64_t)-1;
}