hw/usb/hcd-ehci.c: print diagnostics when cpage out of range
PATCH 1/1 hw/usb/hcd-ehci.c: print diagnostics when cpage out of range
Making it easier to diagnose what is going on when it happens
Signed-off-by Arnout Engelen <[email protected]>
--- hw/usb/hcd-ehci.c | 5 +++++ 1 file changed, 5 insertions(+)
hw/usb/hcd-ehci.c +5 -0
@@ -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 ; }
Signature · 1 line
2.35.3
Hi,
hw/usb/hcd-ehci.c static int ehci_init_transfer(EHCIPacket *p) · line 1202
Quoted 7 lines
if (cpage > 4) { fprintf(stderr, "cpage out of range (%u)\n", cpage);hw/usb/hcd-ehci.c +5
-0+ 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);
I think we should either drop it (you've successfully debugged the problem meanwhile, thanks for that), or turn it into a tracepoint. Simply printing to stderr is deprecated.
take care,
Gerd
Quoted 10 lines · Gerd Hoffmann
Hi,
hw/usb/hcd-ehci.c static int ehci_init_transfer(EHCIPacket *p) · line 1202
Quoted 7 lines
if (cpage > 4) { fprintf(stderr, "cpage out of range (%u)\n", cpage);hw/usb/hcd-ehci.c +5
-0+ 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);
Quoted 3 lines
I think we should either drop it (you've successfully debugged the problem meanwhile, thanks for that), or turn it into a tracepoint. Simply printing to stderr is deprecated.
Gotcha, I'm OK with dropping it. Thanks for the feedback & queue-ing the fix!
Kind regards,
Arnout