[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 4/6] hw/usb/hcd-xhci: Unimplemented/guest error logging for po
From: |
Phil Dennis-Jordan |
Subject: |
[PATCH v3 4/6] hw/usb/hcd-xhci: Unimplemented/guest error logging for port MMIO |
Date: |
Fri, 27 Dec 2024 13:13:34 +0100 |
The XHCI device code uses tracing rather than logging on various code
paths that are so far unimplemented. In some cases, these code paths
actually indicate faulty guest software. This patch switches instances
in the read and write handlers for the port MMIO region to use
qemu_log_mask() with LOG_UNIMP or LOG_GUEST_ERROR, as appropriate in
each case.
Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu>
---
hw/usb/hcd-xhci.c | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 011c445443..00d5bc3779 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -2814,9 +2814,15 @@ static uint64_t xhci_port_read(void *ptr, hwaddr reg,
unsigned size)
case 0x08: /* PORTLI */
ret = 0;
break;
- case 0x0c: /* reserved */
+ case 0x0c: /* PORTHLPMC */
+ ret = 0;
+ qemu_log_mask(LOG_UNIMP, "%s: read from port register PORTHLPMC",
+ __func__);
+ break;
default:
- trace_usb_xhci_unimplemented("port read", reg);
+ qemu_log_mask(LOG_GUEST_ERROR,
+ "%s: read from port offset 0x%" HWADDR_PRIx,
+ __func__, reg);
ret = 0;
}
@@ -2885,9 +2891,22 @@ static void xhci_port_write(void *ptr, hwaddr reg,
}
break;
case 0x04: /* PORTPMSC */
+ case 0x0c: /* PORTHLPMC */
+ qemu_log_mask(LOG_UNIMP,
+ "%s: write 0x%" PRIx64
+ " (%u bytes) to port register at offset 0x%" HWADDR_PRIx,
+ __func__, val, size, reg);
+ break;
case 0x08: /* PORTLI */
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Write to read-only PORTLI
register",
+ __func__);
+ break;
default:
- trace_usb_xhci_unimplemented("port write", reg);
+ qemu_log_mask(LOG_GUEST_ERROR,
+ "%s: write 0x%" PRIx64 " (%u bytes) to unknown port "
+ "register at offset 0x%" HWADDR_PRIx,
+ __func__, val, size, reg);
+ break;
}
}
--
2.39.5 (Apple Git-154)
- [PATCH v3 0/6] hw/usb/hcd-xhci: Fixes, improvements, and macOS workaround, Phil Dennis-Jordan, 2024/12/27
- [PATCH v3 5/6] hw/usb/hcd-xhci-pci: Adds property for disabling mapping in IRQ mode, Phil Dennis-Jordan, 2024/12/27
- [PATCH v3 3/6] hw/usb/hcd-xhci-pci: Use event ring 0 if mapping unsupported, Phil Dennis-Jordan, 2024/12/27
- [PATCH v3 1/6] hw/usb/hcd-xhci-pci: Use modulo to select MSI vector as per spec, Phil Dennis-Jordan, 2024/12/27
- [PATCH v3 2/6] hw/usb/hcd-xhci-pci: Move msi/msix properties from NEC to superclass, Phil Dennis-Jordan, 2024/12/27
- [PATCH v3 4/6] hw/usb/hcd-xhci: Unimplemented/guest error logging for port MMIO,
Phil Dennis-Jordan <=
- [PATCH v3 6/6] hw/vmapple: XHCI controller's interrupt mapping workaround for macOS, Phil Dennis-Jordan, 2024/12/27