qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Tomoyuki HIROSE <tomoyuki.hirose@igel.co.jp>,
	qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH 2/2] hw/usb/hcd-xhci.c: allow unaligned access to Capability Registers
Date: Mon, 18 Mar 2024 12:18:42 -0400	[thread overview]
Message-ID: <ZfhpYpHysSM1oA7_@x1n> (raw)
In-Reply-To: <CAFEAcA90fJgPGAjO0c4a=G+ge9bp1piVw40zt_rNHEoCTc_ngg@mail.gmail.com>

On Mon, Dec 11, 2023 at 01:57:42PM +0000, Peter Maydell wrote:
> On Mon, 11 Dec 2023 at 07:13, Tomoyuki HIROSE
> <tomoyuki.hirose@igel.co.jp> wrote:
> >
> > According to xHCI spec rev 1.2, unaligned access to xHCI Host
> > Controller Capability Registers is not prohibited. In Addition, the
> > limit of access size is also unspecified. Actually, some real devices
> > allow unaligned access and 8-byte access to these registers.
> > This commit makes it possible to unaligned access and 8-byte access
> > to Host Controller Capability Registers.
> 
> We should definitely look at fixing the unaligned access
> stuff, but the linked bug report is not trying to do an
> unaligned access -- it wants to do a 2-byte read from offset 2,
> which is aligned.

IIUC the issue is the xHCI xhci_cap_ops defines impl.min_access_size=4.
Then it'll be enlarged to 4 bytes read on offset 0x2.  IOW, I think it'll
also work if xhci_cap_ops can support impl.min_access_size=2, however I
don't know whether that can be more than that register, so that the memory
patch is still a more generic approach.

Thanks,

-- 
Peter Xu



  parent reply	other threads:[~2024-03-18 16:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11  7:12 [PATCH 0/2] support unaligned access for some xHCI registers Tomoyuki HIROSE
2023-12-11  7:12 ` [PATCH 1/2] system/memory.c: support unaligned access Tomoyuki HIROSE
2023-12-11 13:31   ` Cédric Le Goater
2023-12-15  0:11     ` Tomoyuki Hirose
2024-01-12 15:48   ` Peter Maydell
2024-01-18  6:43     ` Tomoyuki Hirose
2023-12-11  7:12 ` [PATCH 2/2] hw/usb/hcd-xhci.c: allow unaligned access to Capability Registers Tomoyuki HIROSE
2023-12-11 13:57   ` Peter Maydell
2023-12-12  1:43     ` Tomoyuki Hirose
2023-12-12 10:25       ` Peter Maydell
2023-12-18  9:50         ` Tomoyuki Hirose
2024-03-18 16:18     ` Peter Xu [this message]
2023-12-19  4:48 ` [PATCH 0/2] support unaligned access for some xHCI registers Tomoyuki Hirose
2023-12-19 11:26   ` Peter Maydell
2023-12-20  1:11     ` Tomoyuki Hirose

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=ZfhpYpHysSM1oA7_@x1n \
    --to=peterx@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=tomoyuki.hirose@igel.co.jp \
    /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).