mbox series

[0/6] usb: fix some guest-triggerable asserts

Message ID 20201105134112.25119-1-kraxel@redhat.com
Headers show
Series usb: fix some guest-triggerable asserts | expand

Message

Gerd Hoffmann Nov. 5, 2020, 1:41 p.m. UTC
Also kill DPRINTF in usb-storage.c

Gerd Hoffmann (6):
  usb-storage: switch trace events
  usb-storage: add commandlog property
  usb-storage: use bool for removable property
  usb-storage: fill csw on cancel
  xhci: fix guest triggerable assert
  xhci: move sanity checks

 hw/usb/dev-storage.c | 60 +++++++++++++++++++++-----------------------
 hw/usb/hcd-xhci.c    | 11 +++++---
 hw/usb/trace-events  | 12 +++++++++
 3 files changed, 48 insertions(+), 35 deletions(-)

-- 
2.27.0

Comments

Philippe Mathieu-Daudé Nov. 5, 2020, 2:26 p.m. UTC | #1
On 11/5/20 2:41 PM, Gerd Hoffmann wrote:
> Replace most DPRINTF macros with trace events.
> Drop some DPRINTF macros.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/usb/dev-storage.c | 42 +++++++++++++++++-------------------------
>  hw/usb/trace-events  | 12 ++++++++++++
>  2 files changed, 29 insertions(+), 25 deletions(-)
...

> diff --git a/hw/usb/trace-events b/hw/usb/trace-events
> index a3292d46248f..38e05fc7f4db 100644
> --- a/hw/usb/trace-events
> +++ b/hw/usb/trace-events
> @@ -252,6 +252,18 @@ usb_hub_attach(int addr, int nr) "dev %d, port %d"
>  usb_hub_detach(int addr, int nr) "dev %d, port %d"
>  usb_hub_status_report(int addr, int status) "dev %d, status 0x%x"
>  
> +# dev-storage.c
> +usb_msd_reset(void) ""
> +usb_msd_maxlun(unsigned maxlun) "%d"
> +usb_msd_send_status(unsigned status, unsigned tag, size_t size) "status %d, tag 0x%x, len %zd"
> +usb_msd_data_in(unsigned packet, unsigned remaining, unsigned total) "%d/%d (scsi %d)"
> +usb_msd_data_out(unsigned packet, unsigned remaining) "%d/%d"
> +usb_msd_packet_async(void) ""
> +usb_msd_packet_complete(void) ""
> +usb_msd_cmd_submit(unsigned lun, unsigned tag, unsigned flags, unsigned len, unsigned data_len) "lun %u, tag 0x%x, flags 0x%08x, len %d, data-len %d"
> +usb_msd_cmd_complete(unsigned status, unsigned tag) "status %d, tag 0x%x"

Using '%u' format for unsigned type:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Philippe Mathieu-Daudé Nov. 5, 2020, 2:27 p.m. UTC | #2
On 11/5/20 2:41 PM, Gerd Hoffmann wrote:
> Add property so scsi command logging can be switched
> at runtime instead of compile time.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/usb/dev-storage.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>