qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] hw/usb/hcd-ehci.c: print diagnostics when cpage out of range


From: Arnout Engelen
Subject: [PATCH] hw/usb/hcd-ehci.c: print diagnostics when cpage out of range
Date: Sat, 30 Apr 2022 10:25:56 +0200

Making it easier to diagnose what is going on when it happens

Signed-off-by: Arnout Engelen <arnout@bzzt.net>
---
 hw/usb/hcd-ehci.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 33a8a377bd..8e2f6578c2 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1195,6 +1195,11 @@ static int ehci_init_transfer(EHCIPacket *p)
     while (bytes > 0) {
         if (cpage > 4) {
             fprintf(stderr, "cpage out of range (%u)\n", cpage);
+            bytes  = get_field(p->qtd.token, QTD_TOKEN_TBYTES);
+            offset = p->qtd.bufptr[0] & ~QTD_BUFPTR_MASK;
+            cpage  = get_field(p->qtd.token, QTD_TOKEN_CPAGE);
+            fprintf(stderr, "reading %u bytes from offset %u at page %u\n",
+                    bytes, offset, cpage);
             qemu_sglist_destroy(&p->sgl);
             return -1;
         }
-- 
2.35.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]