All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: eperezma@redhat.com, qemu-devel@nongnu.org, peterx@redhat.com,
	qemu-stable@nongnu.org
Subject: Re: [PATCH] pci: advertise a page aligned ATS
Date: Thu, 15 Oct 2020 09:10:48 -0400	[thread overview]
Message-ID: <20201015091040-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <704323d4-8079-fbd2-3318-c67ebefa2525@redhat.com>

On Thu, Oct 15, 2020 at 03:47:09PM +0800, Jason Wang wrote:
> 
> On 2020/9/9 下午4:17, Jason Wang wrote:
> > After Linux kernel commit 61363c1474b1 ("iommu/vt-d: Enable ATS only
> > if the device uses page aligned address."), ATS will be only enabled
> > if device advertises a page aligned request.
> > 
> > Unfortunately, vhost-net is the only user and we don't advertise the
> > aligned request capability in the past since both vhost IOTLB and
> > address_space_get_iotlb_entry() can support non page aligned request.
> > 
> > Though it's not clear that if the above kernel commit makes
> > sense. Let's advertise a page aligned ATS here to make vhost device
> > IOTLB work with Intel IOMMU again.
> > 
> > Note that in the future we may extend pcie_ats_init() to accept
> > parameters like queue depth and page alignment.
> > 
> > Cc: qemu-stable@nongnu.org
> > Signed-off-by: Jason Wang <jasowang@redhat.com>
> > ---
> >   hw/pci/pcie.c | 5 +++--
> >   1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
> > index 5b48bae0f6..d4010cf8f3 100644
> > --- a/hw/pci/pcie.c
> > +++ b/hw/pci/pcie.c
> > @@ -971,8 +971,9 @@ void pcie_ats_init(PCIDevice *dev, uint16_t offset)
> >       dev->exp.ats_cap = offset;
> > -    /* Invalidate Queue Depth 0, Page Aligned Request 0 */
> > -    pci_set_word(dev->config + offset + PCI_ATS_CAP, 0);
> > +    /* Invalidate Queue Depth 0, Page Aligned Request 1 */
> > +    pci_set_word(dev->config + offset + PCI_ATS_CAP,
> > +                 PCI_ATS_CAP_PAGE_ALIGNED);
> >       /* STU 0, Disabled by default */
> >       pci_set_word(dev->config + offset + PCI_ATS_CTRL, 0);
> 
> 
> Ping, Michael, want to pick this patch?
> 
> Thanks

Tagged, thanks!



      reply	other threads:[~2020-10-15 13:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09  8:17 [PATCH] pci: advertise a page aligned ATS Jason Wang
2020-09-09 15:43 ` Peter Xu
2020-09-10  1:53   ` Jason Wang
2020-09-10 16:23     ` Peter Xu
2020-10-15  7:47 ` Jason Wang
2020-10-15 13:10   ` Michael S. Tsirkin [this message]

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=20201015091040-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.