[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 17/49] hw/pci: ensure that only PCI/PCIe bridges can
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 17/49] hw/pci: ensure that only PCI/PCIe bridges can be attached to pxb/pxb-pcie devices |
Date: |
Thu, 4 Feb 2016 23:52:04 +0200 |
From: Marcel Apfelbaum <address@hidden>
PCI devices can't be plugged directly into PCI extra root bridges
because their resources can't be computed by firmware before the ACPI
tables are loaded.
Signed-off-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/pci/pci.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index d940f79..b282120 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -851,6 +851,13 @@ static PCIDevice *do_pci_register_device(PCIDevice
*pci_dev, PCIBus *bus,
DeviceState *dev = DEVICE(pci_dev);
pci_dev->bus = bus;
+ /* Only pci bridges can be attached to extra PCI root buses */
+ if (pci_bus_is_root(bus) && bus->parent_dev && !pc->is_bridge) {
+ error_setg(errp,
+ "PCI: Only PCI/PCIe bridges can be plugged into %s",
+ bus->parent_dev->name);
+ return NULL;
+ }
if (devfn < 0) {
for(devfn = bus->devfn_min ; devfn < ARRAY_SIZE(bus->devices);
--
MST
- Re: [Qemu-devel] [PULL 06/49] virtio: move allocation to virtqueue_pop/vring_pop, (continued)
- [Qemu-devel] [PULL 08/49] virtio: introduce virtqueue_alloc_element, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 09/49] virtio: slim down allocation of VirtQueueElements, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 10/49] vring: slim down allocation of VirtQueueElements, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 11/49] virtio: combine the read of a descriptor, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 12/49] virtio: cache used_idx in a VirtQueue field, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 13/49] virtio: read avail_idx from VQ only when necessary, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 15/49] hw/pxb: add pxb devices to the bridge category, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 16/49] vhost-user-test: use correct ROM to speed up and avoid spurious failures, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 17/49] hw/pci: ensure that only PCI/PCIe bridges can be attached to pxb/pxb-pcie devices,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 18/49] ipmi: replace goto by a return statement, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 19/49] ipmi: replace *_MAXCMD defines, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 20/49] ipmi: cleanup error_report messages, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 21/49] ipmi: fix SDR length value, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 22/49] ipmi: introduce a struct ipmi_sdr_compact, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 23/49] ipmi: add get and set SENSOR_TYPE commands, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 24/49] ipmi: add GET_SYS_RESTART_CAUSE chassis command, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 25/49] ipmi: add ACPI power and GUID commands, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 26/49] pc: Move PcGuestInfo declaration to top of file, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 27/49] pc: Eliminate struct PcGuestInfoState, Michael S. Tsirkin, 2016/02/04