qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: mst@redhat.com, pbonzini@redhat.com, jan.kiszka@web.de,
	rkrcmar@redhat.com, alex.williamson@redhat.com,
	peterx@redhat.com
Subject: [Qemu-devel] [PATCH v3] fix pci_requester_id()
Date: Tue, 17 May 2016 14:45:06 +0800	[thread overview]
Message-ID: <1463467507-13358-1-git-send-email-peterx@redhat.com> (raw)

This is v3 to fix pci_requester_id() issue.

I avoided detecting root bus type since it seems not matter much if
we will directly drop them for non-pcie cases.

Also, I used zero to indicate uncached requester_id (assuming that
BDF 0x0000 is never used by any device).

v3 changes:
- add empty line after local var defines
- enhance comments to explain reason than what is done, also fix
  some english errors in comments
- add requester_id cache: Here I didn't cache the PCI device but
  requester ID directly, since for pcie-to-pci case we are not
  returning BDF but (secondary bus num, 0) pair. So if to cache with
  device, we need one more field, which is complicated. This is
  based on the assumption that requester_id will not change for a
  device lifecycle (is it possible that guest kernel modify
  bus number during runtime?). Anyway, please let me know if I am
  wrong.

Test done: IOMMU IR v7 (not yet posted) work with pci-pci bridges.

Thanks,

Peter Xu (1):
  pci: fix pci_requester_id()

 hw/i386/kvm/pci-assign.c |  2 +-
 hw/pci/pci.c             | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 include/hw/pci/pci.h     | 11 +++++++++--
 3 files changed, 56 insertions(+), 3 deletions(-)

-- 
2.4.11

             reply	other threads:[~2016-05-17  6:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-17  6:45 Peter Xu [this message]
2016-05-17  6:45 ` [Qemu-devel] [PATCH v3] pci: fix pci_requester_id() Peter Xu
2016-05-17  7:46   ` Michael S. Tsirkin
2016-05-17  8:00     ` Peter Xu

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=1463467507-13358-1-git-send-email-peterx@redhat.com \
    --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 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).