[Qemu-devel] [PATCH 26/36] uhci: Verify queue has not been changed by guest

2012-10-25 Thread Gerd Hoffmann
it is possible for a guest to re-use / restart the queue while we still see its old state. This patch adds a safety check for this, and "early" retires queues when they were changed by the guest. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hc

[Qemu-devel] [PATCH 14/36] usb: Add an int_req flag to USBPacket

2012-10-25 Thread Gerd Hoffmann
From: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb.h |3 ++- hw/usb/core.c |3 ++- hw/usb/hcd-ehci.c |6 -- hw/usb/hcd-musb.c |2 +- hw/usb/hcd-ohci.c |7 +-- hw/usb/hcd-uhci.c |3 ++- hw/usb/hcd-xhci.c | 16

[Qemu-devel] [PATCH 22/36] uhci: Add uhci_read_td() helper function

2012-10-25 Thread Gerd Hoffmann
From: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 21 +++-- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 7589a5b..6d2db7f 100644 --- a/hw/usb/hcd-uhci.c +++ b

[Qemu-devel] [PATCH 30/36] uhci: Retry to fill the queue while waiting for td completion

2012-10-25 Thread Gerd Hoffmann
-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 16 +--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index beeb3fd..a9e06ef 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -110,7 +110,7 @@ struct UHCIQueue

Re: [Qemu-devel] [PATCH v1 3/8] usb/ehci: seperate out PCIisms

2012-10-25 Thread Gerd Hoffmann
Hi, >> ... then you don't need to fiddle with the versions as the vmstate wire >> format doesn't change then. >> > > Does that work considering you have turned one layer of VMSD into two? > Can it equivocate machines saved with the old all-in-one vmsd with > this new one that is structured in t

[Qemu-devel] [PATCH 09/36] xhci: Add a xhci_ep_nuke_one_xfer helper function

2012-10-25 Thread Gerd Hoffmann
From: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 49 ++--- 1 files changed, 30 insertions(+), 19 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 37b3dbb..47d5702 100644

Re: [Qemu-devel] [PATCH v1 5/8] xilinx_zynq: add USB controllers

2012-10-25 Thread Gerd Hoffmann
On 10/25/12 14:56, Peter Crosthwaite wrote: > On Thu, Oct 25, 2012 at 10:16 PM, Peter Maydell > wrote: >> On 25 October 2012 13:12, Gerd Hoffmann wrote: >>>> +static inline void zynq_init_usb(uint32_t base_addr, qemu_irq irq) >>>> +{ >>>> +D

[Qemu-devel] [PATCH 05/36] ehci: Improve latency of interrupt delivery and async schedule scanning

2012-10-25 Thread Gerd Hoffmann
factor of 1.5 - 1.7 with input pipelining disabled, and by a factor of 1.8 with input pipelining enabled. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 10 ++ 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/u

[Qemu-devel] [PATCH 29/36] uhci: Always mark a queue valid when we encounter it

2012-10-25 Thread Gerd Hoffmann
the first time we issued it has been lost Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 15 +++ 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 592ad8d..beeb3fd 100644 --- a/hw/usb/hcd

[Qemu-devel] [PATCH 07/36] ehci: Detect going in circles when filling the queue

2012-10-25 Thread Gerd Hoffmann
for going in circles. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index d600f08..8bd87c7 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c

Re: [Qemu-devel] [PATCH v1 5/8] xilinx_zynq: add USB controllers

2012-10-25 Thread Gerd Hoffmann
Hi, >>> Yes I agree. Creating a now QOM definition for every variant of a >>> device is tedious. EHCI provides a nice abstraction which should not >>> have awareness of its particular implementations. >> >> Maybe "zynq" is the wrong abstraction and this should be named by the >> actual ehci chip

[Qemu-devel] [PATCH 06/36] ehci: Speed up the timer of raising int from the async schedule

2012-10-25 Thread Gerd Hoffmann
device by a factor of 1.15 on top of the "Improve latency of interrupt delivery" speed-ups, both with and without input pipelining enabled. I've not tested the speed-up of this patch without the "Improve latency of interrupt delivery" patch. Signed-off-by: Hans de Goede Sig

[Qemu-devel] [PATCH 25/36] uhci: Immediately free queues on device disconnect

2012-10-25 Thread Gerd Hoffmann
From: Hans de Goede There is no need to just cancel any in-flight packets, and then wait for validate-end to clean things up, we can simply clean things up immediately on device removal. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 13 - 1

[Qemu-devel] [PATCH 27/36] uhci: Detect guest td re-use

2012-10-25 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 33 - 1 files changed, 16 insertions(+), 17 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 0984bee..c4f2f98 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -319,28 +319,18

[Qemu-devel] [PATCH 36/36] xhci: fix usb name in caps

2012-10-25 Thread Gerd Hoffmann
Used to be "UTB" not "USB". Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 25b04cd..7b65741 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.

[Qemu-devel] [PATCH 04/36] ehci: Set int flag on a short input packet

2012-10-25 Thread Gerd Hoffmann
plete in an earlier packet. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 82f4dbd..8b4e3c8 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-e

Re: [Qemu-devel] [PATCH v1 5/8] xilinx_zynq: add USB controllers

2012-10-25 Thread Gerd Hoffmann
Hi, > I'll go try that to simplify uhci ... Seems to work ... cheers, Gerd diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index b6b972f..64442a4 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -88,6 +88,13 @@ enum { typedef struct UHCIState UHCIState; typedef struct UHCIAsy

[Qemu-devel] [PATCH 18/36] uhci: Don't retry on error

2012-10-25 Thread Gerd Hoffmann
into the generic error path. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 62 1 files changed, 19 insertions(+), 43 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 82dd5c2..eecd291 1

[Qemu-devel] [PATCH 08/36] ehci: Retry to fill the queue while waiting for td completion

2012-10-25 Thread Gerd Hoffmann
-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 8bd87c7..a02fe96 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -381,7 +381,7 @@ struct EHCIQueue { uint32_t

[Qemu-devel] [PATCH 15/36] usb: Enforce iso endpoints never returing USB_RET_ASYNC

2012-10-25 Thread Gerd Hoffmann
From: Hans de Goede ehci was already testing for this, and we depend in various places on no devices doing this, so lets move the check for this to the usb core. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/core.c |1 + hw/usb/hcd-ehci.c |1 - 2 files

[Qemu-devel] [PATCH 13/36] usb: Move short-not-ok handling to the core

2012-10-25 Thread Gerd Hoffmann
special handling in combination with pipelining, so disable pipleining for input endpoints (for now). Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb.h|4 +++- hw/usb/core.c |6 -- hw/usb/hcd-ehci.c |9 - hw/usb/hcd-musb.c

[Qemu-devel] [PATCH 03/36] ehci: Get rid of packet tbytes field

2012-10-25 Thread Gerd Hoffmann
From: Hans de Goede This field is used in some places to track the tbytes field of the token, but in other places the field is used directly, use it directly everywhere for consistency. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 20

[Qemu-devel] [PATCH 28/36] uhci: When the guest marks a pending td non-active, cancel the queue

2012-10-25 Thread Gerd Hoffmann
From: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index c4f2f98..592ad8d 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c

[Qemu-devel] [PATCH 24/36] uhci: Store ep in UHCIQueue

2012-10-25 Thread Gerd Hoffmann
From: Hans de Goede This avoids the need to repeatedly lookup the device, and ep. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 30 ++ 1 files changed, 14 insertions(+), 16 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb

[Qemu-devel] [PATCH 34/36] xhci: allow disabling interrupters

2012-10-25 Thread Gerd Hoffmann
For secondary interrupters this is explicitly allowed in the specs. For the primary interrupter behavior is undefined, lets be friendly and allow disabling too. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw

[Qemu-devel] [PATCH 33/36] xhci: flush endpoint context unconditinally

2012-10-25 Thread Gerd Hoffmann
Not updating the endpoint context in case the state didn't change is wrong. Other context fields might have changed, for example the dequeue pointer in response to a CR_SET_TR_DEQUEUE command. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c |3 --- 1 files changed, 0 insertions(

[Qemu-devel] [PATCH 32/36] xhci: fix function name in error message

2012-10-25 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index caa5f3e..8345fa3 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -2676,7 +2676,7 @@ static void xhci_runtime_write

[Qemu-devel] [PATCH 20/36] uhci: Move emptying of the queue's asyncs' queue to uhci_queue_free

2012-10-25 Thread Gerd Hoffmann
From: Hans de Goede Cleanup: all callers of uhci_queue_free first unconditionally cancel all remaining asyncs in the queue, so lets move this to uhci_queue_free(). Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 22 ++ 1 files changed

[Qemu-devel] [PULL 00/36] usb patch queue

2012-10-25 Thread Gerd Hoffmann
a8170e5e97ad17ca169c64ba87ae2f53850dab4c: Rename target_phys_addr_t to hwaddr (2012-10-23 08:58:25 -0500) are available in the git repository at: git://git.kraxel.org/qemu usb.68 Gerd Hoffmann (5): xhci: fix function name in error message xhci: flush endpoint context unconditinally xhci: allow

[Qemu-devel] [PATCH 02/36] uhci: Move checks to continue queuing to uhci_fill_queue()

2012-10-25 Thread Gerd Hoffmann
From: Hans de Goede Rather then having a special check to start queuing after the first packet, and then another check for the other packets in uhci_fill_queue(), simply check the previous packet beforehand in uhci_fill_queue() Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw

[Qemu-devel] [PATCH 35/36] xhci: make number of interrupters and slots configurable

2012-10-25 Thread Gerd Hoffmann
Add properties to tweak the numbers of available interrupters and slots. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 79 - 1 files changed, 48 insertions(+), 31 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index

[Qemu-devel] [PATCH 19/36] uhci: Drop unnecessary forward declaration of some static functions

2012-10-25 Thread Gerd Hoffmann
From: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index eecd291..7dfedef 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c

[Qemu-devel] [PATCH 31/36] uhci: Use only one queue for ctrl endpoints

2012-10-25 Thread Gerd Hoffmann
From: Hans de Goede ctrl endpoints use different pids for different phases of a control transfer, this patch makes us use only one queue for a ctrl ep, rather then 3. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c |9 +++-- 1 files changed, 7

[Qemu-devel] [PATCH 23/36] uhci: Make uhci_fill_queue() actually operate on an UHCIQueue

2012-10-25 Thread Gerd Hoffmann
From: Hans de Goede And move its calling point to handle_td, this removes the ep_ret ugliness, and prepates the way for further cleanups in the follow-up patches in this patch-set. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 31

[Qemu-devel] [PATCH 01/36] uhci: Properly unmap packets on cancel / invalid pid

2012-10-25 Thread Gerd Hoffmann
From: Hans de Goede Packets with an invalid pid, or which were cancelled have usb_packet_map() called on them on init, but not usb_packet_unmap() before being freed. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c |2 ++ 1 files changed, 2 insertions(+), 0

[Qemu-devel] [PATCH 10/36] usb: Rename __usb_packet_complete to usb_packet_complete_one

2012-10-25 Thread Gerd Hoffmann
From: Hans de Goede And make it available for use outside of core.c Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb.h |1 + hw/usb/core.c |8 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/usb.h b/hw/usb.h index 48c8926..01dd423

Re: [Qemu-devel] [PATCH v1 5/8] xilinx_zynq: add USB controllers

2012-10-25 Thread Gerd Hoffmann
Hi, >> @@ -1312,29 +1320,24 @@ static TypeInfo piix3_uhci_info = { >> .name = "piix3-usb-uhci", >> .parent= TYPE_PCI_DEVICE, >> .instance_size = sizeof(UHCIState), >> -.class_init= piix3_uhci_class_init, >> +.class_init= uhci_class_init, > > There

[Qemu-devel] [PATCH] uhci: dynamic type generation

2012-10-26 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 196 +++-- 1 files changed, 70 insertions(+), 126 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index b6b972f..925c738 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c

Re: [Qemu-devel] [RFC] Memory API and fine grained Memory Regions

2012-10-26 Thread Gerd Hoffmann
Hi, > For actually writing into the device registers, its just uses an array > index, no need to switch (ret = s->regs[addr]). However for my side > effects I will need to populate that switch. If we convert to fine > grained memory regions then the switch goes away and my side effect > become p

[Qemu-devel] [PATCH] trace: allow disabling events in events file

2012-10-26 Thread Gerd Hoffmann
Disable trace events prefixed with a '-'. Useful to enable a group of tracepoints with exceptions, like this: usb_xhci_port_* -usb_xhci_port_read which will enable all xhci port tracepoints except reads. Signed-off-by: Gerd Hoffmann --- trace/control.c |9 - 1 fil

Re: [Qemu-devel] [PATCH 0/2] xhci: Better spec conforming behaviour

2012-10-26 Thread Gerd Hoffmann
On 10/26/12 10:29, Sebastian Bauer wrote: > This tiny patch series fixes some things in the xhci hcd to behave more > spec compliant. > > The first patch ensures the correctness of the csc port status bit as > soon as the controller is switched to running mode. > > The second patch brings in the

Re: [Qemu-devel] [PATCH 1/2] When the XHCI host controller is switched to the running mode, set the ccs bit for each port, to which a device is already attached.

2012-10-26 Thread Gerd Hoffmann
On 10/26/12 10:29, Sebastian Bauer wrote: Wrong fix I think. Just moving "port->portsc |= PORTSC_CSC" out of the "if (running)" should do. usb-next already has a patch which fixes this: http://www.kraxel.org/cgit/qemu/commit/?h=rebase/usb-next&id=84f84686c701731964a515e9bbcfb475cfc1de8c cheers

Re: [Qemu-devel] [PATCH 2/2] Respond a set address command with CC_PARAMETER_ERROR, if the speed field of the input context is not valid.

2012-10-26 Thread Gerd Hoffmann
Looks ok, but please add the description & spec reference from the cover letter to the commit message. thanks, Gerd

Re: [Qemu-devel] [PATCH v2 05/11] usb/ehci: seperate out PCIisms

2012-10-26 Thread Gerd Hoffmann
Hi, > +typedef struct EHCItfState { > +union { > +PCIDevice pcidev; > +}; > +struct EHCIState ehci; > +} EHCIItfState; I still think we should have EHCIPCIState here, then add a EHCISysbusState variant for sysbus. Everybody else does it this way (ohci, esp, serial, ...) and

Re: [Qemu-devel] [PATCH v2 08/11] xilinx_zynq: add USB controllers

2012-10-26 Thread Gerd Hoffmann
> diff --git a/hw/xilinx_zynq.c b/hw/xilinx_zynq.c > index c55dafb..154e397 100644 > --- a/hw/xilinx_zynq.c > +++ b/hw/xilinx_zynq.c > @@ -150,6 +150,9 @@ static void zynq_init(QEMUMachineInitArgs *args) > zynq_init_spi_flashes(0xE0006000, pic[58-IRQ_OFFSET]); > zynq_init_spi_flashes(0xE0

Re: [Qemu-devel] [PATCH v2 11/11] usb/ehci: Put RAM in undefined MMIO regions

2012-10-26 Thread Gerd Hoffmann
On 10/26/12 07:47, Peter Crosthwaite wrote: > Just put RAM regions in the unimplemented spaces in the MMIO region. These > regions have undefined behaviour, but this at least stops QEMU from > segfaulting > when the guest bangs on these registers (and sucessfully fakes reading and > writing the re

[Qemu-devel] [PATCH] uhci: stick irq routing info into UHCIInfo too.

2012-10-26 Thread Gerd Hoffmann
Kills the ugly "switch (device_id) { ... }" struct and makes it easier to figure what the differences between the uhci variants are. Need our own DeviceClass struct for that so we can allocate some space to store UHCIInfo. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhc

Re: [Qemu-devel] q35: usb keyboard trouble

2012-10-29 Thread Gerd Hoffmann
Hi, > +for (i = 0; i < 3; i++) { > +usb = pci_create_multifunction( > +host_bus, PCI_DEVFN(ICH9_USB_DEV, ICH9_USB_UHCI1_FUNC + i), > +true, "ich9-usb-uhci1"); ich9-usb-uhci1,ich9-usb-uhci2,ich9-usb-uhci3 cheers, Gerd

Re: [Qemu-devel] [PATCH v2 05/11] usb/ehci: seperate out PCIisms

2012-10-29 Thread Gerd Hoffmann
Hi, > There still has to be a way to share the Property[] array (currently > contains maxframes). Duplicating the properties array to all > definitions is verbose and fragile. If I want to add a new properties > to EHCI i need to put it in the props array of every subclass. serial > has this pro

Re: [Qemu-devel] [PATCH v2 11/11] usb/ehci: Put RAM in undefined MMIO regions

2012-10-29 Thread Gerd Hoffmann
bb54ec53974414 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 29 Oct 2012 08:32:47 +0100 Subject: [PATCH] ehci: set extended capability pointer on pci only Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/hw/u

Re: [Qemu-devel] [PATCH v3 0/8] Sysbus EHCI + Zynq USB.

2012-10-29 Thread Gerd Hoffmann
On 10/29/12 02:34, Peter Crosthwaite wrote: > Added Sysbus variant of EHCI and attached it to Xilinx Zynq. The EHCI stuff > is going to useful for Tegra too. Patch series added to usb patch queue. thanks, Gerd

Re: [Qemu-devel] [PATCH v3 0/8] Sysbus EHCI + Zynq USB.

2012-10-29 Thread Gerd Hoffmann
On 10/29/12 09:53, Andreas Färber wrote: > Am 29.10.2012 08:48, schrieb Gerd Hoffmann: >> On 10/29/12 02:34, Peter Crosthwaite wrote: >>> Added Sysbus variant of EHCI and attached it to Xilinx Zynq. The EHCI stuff >>> is going to useful for Tegra too. >> >>

Re: [Qemu-devel] [PATCH v1 12/13] q35: fill in usb pci slots with -usb

2012-10-29 Thread Gerd Hoffmann
Hi, > +uhci_devname[sizeof(uhci_devname) - 2] = ((char)'1') + i; snprintf(devname, sizeof(devname), "...%d", i) is more readable. > +qdev_prop_set_string(usb_qdev, "masterbus", "ich9-usb-bus.0"); Any reason why you rename the usb bus? cheers, Gerd

Re: [Qemu-devel] [PATCH v1 0/8] Sysbus EHCI + Zynq USB.

2012-10-30 Thread Gerd Hoffmann
On 10/29/12 15:08, Peter Crosthwaite wrote: > Ping! > > This is the first version of the EHCI sysbus series which takes a > property based approach rather than the dynamic class approach. > > No refactoring of the PCI stuff is done here (introduced v2) but > following on from the discussion on IR

[Qemu-devel] [PATCH] update pci-ids.txt

2012-10-30 Thread Gerd Hoffmann
Add virtio-scsi and non-virtio devices. Signed-off-by: Gerd Hoffmann --- pci-ids.txt | 17 - 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/pci-ids.txt b/pci-ids.txt index 73125a8..a2bf6f7 100644 --- a/pci-ids.txt +++ b/pci-ids.txt @@ -20,8 +20,9 @@ VirtIO

Re: [Qemu-devel] [PATCH v1 0/8] Sysbus EHCI + Zynq USB.

2012-10-30 Thread Gerd Hoffmann
On 10/30/12 09:24, Peter Crosthwaite wrote: > On Tue, Oct 30, 2012 at 5:20 PM, Gerd Hoffmann wrote: >> On 10/29/12 15:08, Peter Crosthwaite wrote: >>> Ping! >>> >>> This is the first version of the EHCI sysbus series which takes a >>> property based ap

[Qemu-devel] [RfC PATCH 2/5] usb/ehci: Abstract away PCI DMA API

2012-10-30 Thread Gerd Hoffmann
From: Peter Crosthwaite Pull the DMAContext for the PCI DMA out at device init time and put it into the device state. Use dma_memory_read/write() instead of pci specific versions. Signed-off-by: Peter Crosthwaite Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 13 - 1

[Qemu-devel] [RfC PATCH 0/5] ehci pci splitup

2012-10-30 Thread Gerd Hoffmann
Hi, Based on Peters series, not tested much yet, sysfs dropped but adding back in should be as easy as adding a hcd-ehci-sysbus.c file simliar to the pci variant. No changes in ehci core should be needed. Comments? cheers, Gerd Gerd Hoffmann (1): usb/ehci: split into multiple source

[Qemu-devel] [RfC PATCH 3/5] usb/ehci: seperate out PCIisms

2012-10-30 Thread Gerd Hoffmann
ned-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 124 +++-- 1 files changed, 72 insertions(+), 52 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 28890b5..59580fc 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -38

[Qemu-devel] [RfC PATCH 4/5] usb/ehci: Guard definition of EHCI_DEBUG

2012-10-30 Thread Gerd Hoffmann
From: Peter Crosthwaite Guard against re-definition of EHCI_DEBUG. Allows for turning on of debug info from configure (using --qemu-extra-cflags="-DEHCI_DEBUG=1") rather than source code hacking. Signed-off-by: Peter Crosthwaite Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c |

[Qemu-devel] [RfC PATCH 5/5] usb/ehci: split into multiple source files

2012-10-30 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/Makefile.objs |2 +- hw/usb/hcd-ehci-pci.c | 138 hw/usb/hcd-ehci.c | 426 + hw/usb/hcd-ehci.h | 320 + 4 files changed, 462 insertions

[Qemu-devel] [RfC PATCH 1/5] usb/ehci: parameterise the register region offsets

2012-10-30 Thread Gerd Hoffmann
From: Peter Crosthwaite The capabilities register and operational register offsets can vary from one EHCI implementation to the next. Parameterise accordingly. Signed-off-by: Peter Crosthwaite Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 68

Re: [Qemu-devel] [RfC PATCH 0/5] ehci pci splitup

2012-10-30 Thread Gerd Hoffmann
On 10/30/12 14:13, Peter Crosthwaite wrote: > On Tue, Oct 30, 2012 at 9:28 PM, Gerd Hoffmann wrote: >> Hi, >> >> Based on Peters series, not tested much yet, sysfs dropped but adding >> back in should be as easy as adding a hcd-ehci-sysbus.c file simliar >> to

[Qemu-devel] [PATCH 04/22] xhci: add xhci_port_notify

2012-10-30 Thread Gerd Hoffmann
Create a function to notify the guest about port status changes and put it into use. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 31 +-- 1 files changed, 17 insertions(+), 14 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 62cca90

[Qemu-devel] [PATCH 03/22] xhci: add xhci_port_have_device

2012-10-30 Thread Gerd Hoffmann
Factor out the code which checks whenever a usb device is attached to the port in question. No functional change. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 14 -- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c

[Qemu-devel] [PATCH 06/22] xhci: set pls in xhci_port_update & xhci_port_reset

2012-10-30 Thread Gerd Hoffmann
Set the port link state to the correct values in xhci_port_update and xhci_port_reset functions. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 26 -- 1 files changed, 24 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index

[Qemu-devel] [PATCH 15/22] uhci: dynamic type generation

2012-10-30 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 196 +++-- 1 files changed, 70 insertions(+), 126 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index b6b972f..925c738 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c

[Qemu-devel] [PATCH 14/22] usb/ehci: add sysbus variant

2012-10-30 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/Makefile.objs |2 +- hw/usb/hcd-ehci-sysbus.c | 77 ++ 2 files changed, 78 insertions(+), 1 deletions(-) create mode 100644 hw/usb/hcd-ehci-sysbus.c diff --git a/hw/usb/Makefile.objs b/hw/usb

[Qemu-devel] [PATCH 11/22] usb/ehci: seperate out PCIisms

2012-10-30 Thread Gerd Hoffmann
ned-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 124 +++-- 1 files changed, 72 insertions(+), 52 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 28890b5..59580fc 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -38

[Qemu-devel] [PATCH 09/22] usb/ehci: parameterise the register region offsets

2012-10-30 Thread Gerd Hoffmann
From: Peter Crosthwaite The capabilities register and operational register offsets can vary from one EHCI implementation to the next. Parameterise accordingly. Signed-off-by: Peter Crosthwaite Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 68

[Qemu-devel] [PATCH 17/22] uhci: add ich9 00:1a.* variants

2012-10-30 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 27 --- 1 files changed, 24 insertions(+), 3 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 27046b6..71263fe 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -1340,26 +1340,47

[Qemu-devel] [PATCH 21/22] [RfC] usb: mtp filesharing

2012-10-30 Thread Gerd Hoffmann
evice but fails to fetch files, seems to expect some PTP-specific command being supported. * more tests to be done. Known issues: * Burns CPU like mad with Win7 guest, in ehci periodic schedule emulation, due to Win7 polling the event endpoint. Signed-off-by: Gerd Hoffmann --- h

[Qemu-devel] [PATCH 20/22] usb/ehci-pci: add helper to create ich9 usb controllers

2012-10-30 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb.h |2 + hw/usb/hcd-ehci-pci.c | 53 + 2 files changed, 55 insertions(+), 0 deletions(-) diff --git a/hw/usb.h b/hw/usb.h index 3a6cc84..1837bf7 100644 --- a/hw/usb.h +++ b/hw/usb.h

[Qemu-devel] [PATCH 22/22] trace: allow disabling events in events file

2012-10-30 Thread Gerd Hoffmann
Disable trace events prefixed with a '-'. Useful to enable a group of tracepoints with exceptions, like this: usb_xhci_port_* -usb_xhci_port_read which will enable all xhci port tracepoints except reads. Signed-off-by: Gerd Hoffmann --- trace/control.c |9 - 1 fil

[Qemu-devel] [PATCH 00/22] usb patch queue

2012-10-30 Thread Gerd Hoffmann
g: moving target ] cheers, Gerd Gerd Hoffmann (18): xhci: add {get,set}_field macros & enum for pls xhci: s/xhci_update_port/xhci_port_update/ xhci: add xhci_port_have_device xhci: add xhci_port_notify xhci: add xhci_port_reset xhci: set pls in xhci_port_update & xhci_port_rese

[Qemu-devel] [PATCH 16/22] uhci: stick irq routing info into UHCIInfo too.

2012-10-30 Thread Gerd Hoffmann
Kills the ugly "switch (device_id) { ... }" struct and makes it easier to figure what the differences between the uhci variants are. Need our own DeviceClass struct for that so we can allocate some space to store UHCIInfo. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhc

[Qemu-devel] [PATCH 08/22] xhci: allow address slot being called multiple times

2012-10-30 Thread Gerd Hoffmann
win8 guests do that for some reason ... Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 3259638..900abf5 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c

[Qemu-devel] [PATCH 01/22] xhci: add {get, set}_field macros & enum for pls

2012-10-30 Thread Gerd Hoffmann
Add {get,set}_field macros (simliar to ehci) to read and update some bits of a word. Put them into use for updating pls (port link state) values. Also add a enum for pls values. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 39 +++ 1 files changed

[Qemu-devel] [PATCH 19/22] usb/ehci-pci: add ich9 00:1a.* variant

2012-10-30 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci-pci.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c index df137cc..79bc276 100644 --- a/hw/usb/hcd-ehci-pci.c +++ b/hw/usb/hcd-ehci-pci.c @@ -116,10 +116,15 @@ static

[Qemu-devel] [PATCH 18/22] usb/ehci-pci: dynamic type generation

2012-10-30 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci-pci.c | 66 ++--- 1 files changed, 35 insertions(+), 31 deletions(-) diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c index daac41d..df137cc 100644 --- a/hw/usb/hcd-ehci-pci.c +++ b/hw/usb

[Qemu-devel] [PATCH 12/22] usb/ehci: Guard definition of EHCI_DEBUG

2012-10-30 Thread Gerd Hoffmann
From: Peter Crosthwaite Guard against re-definition of EHCI_DEBUG. Allows for turning on of debug info from configure (using --qemu-extra-cflags="-DEHCI_DEBUG=1") rather than source code hacking. Signed-off-by: Peter Crosthwaite Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c |

[Qemu-devel] [PATCH 05/22] xhci: add xhci_port_reset

2012-10-30 Thread Gerd Hoffmann
Move port reset logic to its own function. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 13 + 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 3af4639..1db803c 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c

[Qemu-devel] [PATCH 13/22] usb/ehci: split into multiple source files

2012-10-30 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/Makefile.objs |2 +- hw/usb/hcd-ehci-pci.c | 138 hw/usb/hcd-ehci.c | 426 + hw/usb/hcd-ehci.h | 320 + 4 files changed, 462 insertions

[Qemu-devel] [PATCH 10/22] usb/ehci: Abstract away PCI DMA API

2012-10-30 Thread Gerd Hoffmann
From: Peter Crosthwaite Pull the DMAContext for the PCI DMA out at device init time and put it into the device state. Use dma_memory_read/write() instead of pci specific versions. Signed-off-by: Peter Crosthwaite Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 13 - 1

[Qemu-devel] [PATCH 02/22] xhci: s/xhci_update_port/xhci_port_update/

2012-10-30 Thread Gerd Hoffmann
Rename the function for xhci_port_* naming scheme, also drop the xhci parameter as port carries a pointer to xhci anyway. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c

[Qemu-devel] [PATCH 07/22] xhci: add port trace points

2012-10-30 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c |6 +- trace-events |2 ++ 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 84d1b26..3259638 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -2391,12 +2391,14

Re: [Qemu-devel] [PATCH v1 12/13] q35: fill in usb pci slots with -usb

2012-10-30 Thread Gerd Hoffmann
On 10/30/12 16:19, Jason Baron wrote: > On Tue, Oct 30, 2012 at 07:34:26AM +0100, Gerd Hoffmann wrote: >> Hi, >> >>> +uhci_devname[sizeof(uhci_devname) - 2] = ((char)'1') + i; >> >> snprintf(devname, sizeof(d

Re: [Qemu-devel] [PATCH 07/13] usb: Convert usb_packet_{map, unmap} to universal DMA helpers

2012-06-19 Thread Gerd Hoffmann
Hi, > Note that usb_packet_map() invokes dma_memory_map() with a NULL invalidate > callback function. When IOMMU support is added, this will mean that > usb_packet_map() and the corresponding usb_packet_unmap() must be called in > close proximity without dropping the qemu device lock Well, tha

Re: [Qemu-devel] [PATCH 07/13] usb: Convert usb_packet_{map, unmap} to universal DMA helpers

2012-06-19 Thread Gerd Hoffmann
Hi, >> Like with any other device, it's hard ... what would happen on real >> hardware is that the USB controller will get a target abort, which will >> result in the controller reporting an error (typically in the PCI status >> register) and stopping. Not that hard, code to cancel in-flight tr

Re: [Qemu-devel] [PATCH 07/13] usb: Convert usb_packet_{map, unmap} to universal DMA helpers

2012-06-20 Thread Gerd Hoffmann
he initial merge is perfectly fine with me, just wanted to know what dragons might be lurking there ;) Oh, and: Acked-by: Gerd Hoffmann cheers, Gerd

[Qemu-devel] [PATCH 0/4] usb attached scsi

2012-06-20 Thread Gerd Hoffmann
series includes a bunch of ehci bugfixes too. Patch #4 is not ready for merge yet, I still have to think about a better way to fix the issue described in the commit log. Reviews & comments are welcome. cheers, Gerd Gerd Hoffmann (4): ehci: fix ehci_qh_do_overlay ehci: fix td writeback

[Qemu-devel] [PATCH 3/4] usb: add usb attached scsi emulation

2012-06-20 Thread Gerd Hoffmann
icely without having to touch a single line of scsi code. Signed-off-by: Gerd Hoffmann --- docs/usb-storage.txt | 38 +++ hw/usb/Makefile.objs |1 + hw/usb/dev-uas.c | 792 ++ trace-events | 14 + 4 files changed, 845 insertio

[Qemu-devel] [PATCH 1/4] ehci: fix ehci_qh_do_overlay

2012-06-20 Thread Gerd Hoffmann
Use ehci_flush_qh to make sure we touch inly the fields the hc is allowed to touch. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 37 ++--- 1 files changed, 18 insertions(+), 19 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index

[Qemu-devel] [PATCH 2/4] ehci: fix td writeback

2012-06-20 Thread Gerd Hoffmann
Only write back the dwords the hc is supposed to update. Should not make a difference in theory as the guest must not touch the td while it is active to avoid races. But it is still more correct. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c |6 -- 1 files changed, 4 insertions

[Qemu-devel] [PATCH 4/4] [wip] ehci: don't flush cache on dorbell rings.

2012-06-20 Thread Gerd Hoffmann
mplen 512, eps 2, ep 1, dev 2 Simply not zapping queue heads on doorbell rings fixes the issue, but of course re-introduces the risk of using cached but stale information. Cc: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c |2 ++ 1 files changed, 2 insertions(+), 0 deletio

[Qemu-devel] [PULL 0/6] usb patch queue.

2012-06-20 Thread Gerd Hoffmann
d via hardware (2012-06-19 13:36:56 -0500) are available in the git repository at: git://git.kraxel.org/qemu usb.54 Gerd Hoffmann (6): ehci: add live migration support usb: restore USBDevice->attached on vmload ehci: tracing improvements usb-host: attach only to runni

[Qemu-devel] [PATCH 1/6] ehci: add live migration support

2012-06-20 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 62 +++- 1 files changed, 56 insertions(+), 6 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 5298204..45b774d 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c

[Qemu-devel] [PATCH 4/6] usb-host: attach only to running guest

2012-06-20 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/host-linux.c | 32 +--- 1 files changed, 17 insertions(+), 15 deletions(-) diff --git a/hw/usb/host-linux.c b/hw/usb/host-linux.c index a95b0ed..06b6ed3 100644 --- a/hw/usb/host-linux.c +++ b/hw/usb/host-linux.c @@ -1737,25

[Qemu-devel] [PATCH 2/6] usb: restore USBDevice->attached on vmload

2012-06-20 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/usb/bus.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/hw/usb/bus.c b/hw/usb/bus.c index f87cc5f..b649360 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -37,10 +37,23 @@ static const TypeInfo usb_bus_info = { static

[Qemu-devel] [PATCH] Add vgabios build rules to roms/Makefile

2012-06-20 Thread Gerd Hoffmann
abios testing for those who want to play with it. Signed-off-by: Gerd Hoffmann --- roms/Makefile | 17 + roms/config.vga.cirrus |3 +++ roms/config.vga.isavga |3 +++ roms/config.vga.qxl|6 ++ roms/config.vga.stdvga |3 +++ roms/config.vga.vmware |

<    1   2   3   4   5   6   7   8   9   10   >