<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From 0c7c9e8ab378dd755506b496b0eaf890cd2f7039 Mon Sep 17 00:00:00 2001
From: Marcel Apfelbaum &lt;marcel@redhat.com&gt;
Date: Sun, 31 Jul 2016 18:03:05 +0200
Subject: [PATCH 03/99] hw/acpi: fix a DSDT table issue when a pxb is present.

RH-Author: Marcel Apfelbaum &lt;marcel@redhat.com&gt;
Message-id: &lt;1469988187-20816-4-git-send-email-marcel@redhat.com&gt;
Patchwork-id: 71530
O-Subject: [RHEL-7.3 qemu-kvm-rhev PATCH 3/5] hw/acpi: fix a DSDT table issue when a pxb is present.
Bugzilla: 1323976
RH-Acked-by: Thomas Huth &lt;thuth@redhat.com&gt;
RH-Acked-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
RH-Acked-by: Igor Mammedov &lt;imammedo@redhat.com&gt;

PXBs do not support hotplug so they don't have a PCNT function.
Since the PXB's PCI root-bus is a child bus of bus 0, the
build_dsdt code will add a call to the corresponding PCNT function.

Fix this by skipping the PCNT call for the above case.
While at it skip also PCIe child buses.

Reported-by: Igor Mammedov &lt;imammedo@redhat.com&gt;
Signed-off-by: Marcel Apfelbaum &lt;marcel@redhat.com&gt;
Tested-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Reviewed-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
(cherry picked from commit c99cb18eeb8bca145ee260a507ccce6775a6d260)
Signed-off-by: Marcel Apfelbaum &lt;marcel@redhat.com&gt;
Signed-off-by: Miroslav Rezanina &lt;mrezanin@redhat.com&gt;
---
 hw/i386/acpi-build.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index e2f3d8f..e09154d 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -586,6 +586,10 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
         QLIST_FOREACH(sec, &amp;bus-&gt;child, sibling) {
             int32_t devfn = sec-&gt;parent_dev-&gt;devfn;
 
+            if (pci_bus_is_root(sec) || pci_bus_is_express(sec)) {
+                continue;
+            }
+
             aml_append(method, aml_name("^S%.02X.PCNT", devfn));
         }
     }
-- 
1.8.3.1

</pre></body></html>