qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v4 0/3] pcie: add check for ari capability of pcie devices
@ 2014-09-30 10:11 arei.gonglei
  2014-09-30 10:11 ` [Qemu-devel] [PATCH v4 1/3] qdev: Introduce a function to get qbus's parent arei.gonglei
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: arei.gonglei @ 2014-09-30 10:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: peter.crosthwaite, weidong.huang, mst, knut.omang, marcel.a,
	luonengjun, peter.huangpeng, armbru, Gonglei, imammedo, pbonzini,
	afaerber

From: Gonglei <arei.gonglei@huawei.com>

Changes since v3:
 - fix some typos in comments and commit message. (Michael)
 - rename pcie_cap_ari_check to pcie_cap_slot_check.

Changes since v2:
 - make patch 1/3 more simpler and safer.(Hu Tao)
 - change check logic from pci.c to pcie.c and change function's name
 - judge devices' ARI capability instead of PCIe ports' ARI Forwarding
   (Michael)
 - add trivial patch 3/3
 - update patch's commit messages and code comments.

Changes since v1:
 - using object_dynamic_cast() instead of simple string comparing (Paolo)
 - add ARI Forwarding enable bit check
 - using pcie_cap_get_type() instead of simple string comparing (Marcel)
 - fix some other comments.

Root ports and downstream ports of switches are the hot
pluggable ports in a PCI Express hierarchy.
PCI Express supports chip-to-chip interconnect, a PCIe link can
only connect one PCI device/Switch/EndPoint or PCI-bridge.

7.3. Configuration Transaction Rules (PCI Express specification 3.0)
7.3.1. Device Number

Downstream Ports that do not have ARI Forwarding enabled must
associate only Device 0 with the device attached to the Logical Bus
representing the Link from the Port.

In QEMU, ARI Forwarding is enabled default at emulation of PCIe
ports. ARI Forwarding enable setting at firmware/OS Control handoff.
If the bit is Set when a non-ARI Device is present, the non-ARI
Device can respond to Configuration Space accesses under what it
interprets as being different Device Numbers, and its Functions can
be aliased under multiple Device Numbers, generally leading to
undesired behavior.

So, for PCI devices attached in PCIe root ports or downstream pots,
we should assure that its slot is not non-zero. For PCIe devices, which
ARP capability is not enabled, we also should assure that its slot
is not non-zero.

Gonglei (3):
  qdev: Introduce a function to get qbus's parent
  pcie: add check for ari capability of pcie devices
  pcie: remove confused comments

 hw/core/qdev.c         |  9 ++++++++
 hw/pci/pci.c           |  4 ++++
 hw/pci/pcie.c          | 59 +++++++++++++++++++++++++++++++++++++++++++-------
 include/hw/pci/pcie.h  |  1 +
 include/hw/qdev-core.h |  1 +
 5 files changed, 66 insertions(+), 8 deletions(-)

-- 
1.7.12.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-10-08  3:25 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-30 10:11 [Qemu-devel] [PATCH v4 0/3] pcie: add check for ari capability of pcie devices arei.gonglei
2014-09-30 10:11 ` [Qemu-devel] [PATCH v4 1/3] qdev: Introduce a function to get qbus's parent arei.gonglei
2014-09-30 10:11 ` [Qemu-devel] [PATCH v4 2/3] pcie: add check for ari capability of pcie devices arei.gonglei
2014-09-30 11:59   ` Michael S. Tsirkin
2014-09-30 13:38     ` Gonglei
2014-09-30 13:58       ` Michael S. Tsirkin
2014-10-01  4:04         ` Gonglei
2014-10-01  5:26       ` Knut Omang
2014-10-01  7:15         ` Gonglei
2014-10-01 14:08         ` Marcel Apfelbaum
2014-10-03 11:22           ` Knut Omang
2014-10-03 14:30             ` Knut Omang
2014-10-08  3:23               ` Gonglei (Arei)
2014-09-30 10:11 ` [Qemu-devel] [PATCH v4 3/3] pcie: remove confused comments arei.gonglei
2014-09-30 12:46   ` Michael S. Tsirkin
2014-09-30 12:58     ` Gonglei

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).