From: Arnout Engelen <arnout@bzzt.net>
To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org, kraxel@redhat.com
Cc: Arnout Engelen <arnout@bzzt.net>
Subject: [PATCH] hw/usb/hcd-ehci.c: print diagnostics when cpage out of range
Date: Sat, 30 Apr 2022 10:25:56 +0200 [thread overview]
Message-ID: <20220430082556.271627-1-arnout@bzzt.net> (raw)
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
next reply other threads:[~2022-04-30 14:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-30 8:25 Arnout Engelen [this message]
2022-06-09 10:09 ` [PATCH] hw/usb/hcd-ehci.c: print diagnostics when cpage out of range Gerd Hoffmann
2022-06-09 10:13 ` Arnout Engelen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220430082556.271627-1-arnout@bzzt.net \
--to=arnout@bzzt.net \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).