Re: [PATCH v1] usb: Add read support for HCIVERSION register to XHCI

2020-04-06 Thread Cameron Esfahani via
I had a look at this failing test case after running applying Cedric's patch (https://github.com/legoater/qemu/commit/d57ac950c4be47a2bafd6c6a96dec2922c2ecd65). It looks like this is just a bug in the test case. The test case is attempting to verify that the CNF registers are programmed

Re: [PATCH v1] usb: Add read support for HCIVERSION register to XHCI

2020-04-02 Thread Andrew Jeffery
On Wed, 1 Apr 2020, at 21:53, Cédric Le Goater wrote: > Hello, > > On 3/31/20 1:02 PM, Philippe Mathieu-Daudé wrote: > > On 3/31/20 11:57 AM, Cameron Esfahani wrote: > >> Philippe - > >>  From what I've seen, access size has nothing to do with alignment. > > > > Yes, I was wondering if you

Re: [PATCH v1] usb: Add read support for HCIVERSION register to XHCI

2020-04-01 Thread Cédric Le Goater
Hello, On 3/31/20 1:02 PM, Philippe Mathieu-Daudé wrote: > On 3/31/20 11:57 AM, Cameron Esfahani wrote: >> Philippe - >>  From what I've seen, access size has nothing to do with alignment. > > Yes, I was wondering if you were using unaligned accesses. > > I *think* the correct fix is in the

Re: [PATCH v1] usb: Add read support for HCIVERSION register to XHCI

2020-03-31 Thread Gerd Hoffmann
On Tue, Mar 31, 2020 at 02:57:56AM -0700, Cameron Esfahani wrote: > Philippe - > From what I've seen, access size has nothing to do with alignment. > > What the code in access_with_adjusted_size() will do is make sure that "size" > is >= min_access_size and <= max_access_size. > > So reading

Re: [PATCH v1] usb: Add read support for HCIVERSION register to XHCI

2020-03-31 Thread Philippe Mathieu-Daudé
On 3/31/20 11:57 AM, Cameron Esfahani wrote: Philippe - From what I've seen, access size has nothing to do with alignment. Yes, I was wondering if you were using unaligned accesses. I *think* the correct fix is in the "memory: Support unaligned accesses on aligned-only models" patch from

Re: [PATCH v1] usb: Add read support for HCIVERSION register to XHCI

2020-03-31 Thread Cameron Esfahani via
Actually, reading the specification a little more, the only fields which are documented as being smaller than 4-bytes are CAPLENGTH (1-byte) and HCIVERSION (2-bytes). So maybe change impl.min_access_size to 1 and rely on the fact that traditionally callers haven't read less than 4-bytes for

Re: [PATCH v1] usb: Add read support for HCIVERSION register to XHCI

2020-03-31 Thread Cameron Esfahani via
Philippe - From what I've seen, access size has nothing to do with alignment. What the code in access_with_adjusted_size() will do is make sure that "size" is >= min_access_size and <= max_access_size. So reading 2-bytes from address 2 turns into reading 4-bytes from address 2: xhci_cap_read()

Re: [PATCH v1] usb: Add read support for HCIVERSION register to XHCI

2020-03-31 Thread Philippe Mathieu-Daudé
On 3/30/20 11:44 PM, Cameron Esfahani via wrote: macOS will read HCIVERSION separate from CAPLENGTH. Add a distinct handler for that register. Apparently a fix for https://bugs.launchpad.net/qemu/+bug/1693050. Signed-off-by: Cameron Esfahani --- hw/usb/hcd-xhci.c | 3 +++ 1 file

[PATCH v1] usb: Add read support for HCIVERSION register to XHCI

2020-03-30 Thread Cameron Esfahani via
macOS will read HCIVERSION separate from CAPLENGTH. Add a distinct handler for that register. Signed-off-by: Cameron Esfahani --- hw/usb/hcd-xhci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index b330e36fe6..061f8438de 100644 ---