From: Peter Xu <peterx@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, jan.kiszka@web.de,
rkrcmar@redhat.com, alex.williamson@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3] pci: fix pci_requester_id()
Date: Tue, 17 May 2016 16:00:47 +0800 [thread overview]
Message-ID: <20160517080047.GC3285@pxdev.xzpeter.org> (raw)
In-Reply-To: <20160517104414-mutt-send-email-mst@redhat.com>
On Tue, May 17, 2016 at 10:46:12AM +0300, Michael S. Tsirkin wrote:
> On Tue, May 17, 2016 at 02:45:07PM +0800, Peter Xu wrote:
> > This fix SID verification failure when IOMMU IR is enabled with PCI
> > bridges. Existing pci_requester_id() is more like getting BDF info
> > only. Renaming it to pci_get_bdf(). Meanwhile, we provide the correct
> > implementation to get requester ID. VT-d spec 5.1.1 is a good reference
> > to go, though it talks only about interrupt delivery, the rule works
> > exactly the same for non-interrupt cases.
> >
> > Currently, there are three use cases for pci_requester_id():
> >
> > - PCIX status bits: here we need BDF only, not requester ID. Replacing
> > with pci_get_bdf().
> > - PCIe Error injection and MSI delivery: for both these cases, we are
> > looking for requester IDs. Here we should use the new impl.
> >
> > To avoid a PCI walk every time we send MSI message, one requester_id
> > field is added to PCIDevice to cache the result when we use it the first
> > time. Here assumption is made that requester_id will never change
> > during device lifecycle.
>
> That's wrong though. It can change if bus number changes.
>
> That's why I said add a pointer to the actual requester,
> set it up during initialization, not on first use.
Ah... So finally we need one more field for that... Will fix in
v4. Thanks!
-- peterx
prev parent reply other threads:[~2016-05-17 8:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-17 6:45 [Qemu-devel] [PATCH v3] fix pci_requester_id() Peter Xu
2016-05-17 6:45 ` [Qemu-devel] [PATCH v3] pci: " Peter Xu
2016-05-17 7:46 ` Michael S. Tsirkin
2016-05-17 8:00 ` Peter Xu [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=20160517080047.GC3285@pxdev.xzpeter.org \
--to=peterx@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=jan.kiszka@web.de \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rkrcmar@redhat.com \
/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.