qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: mst@redhat.com, ani@anisinha.ca, berrange@redhat.com
Subject: [PATCH 30/33] acpi: pci: move BSEL into build_append_pcihp_slots()
Date: Fri, 24 Feb 2023 16:38:09 +0100	[thread overview]
Message-ID: <20230224153812.4176226-31-imammedo@redhat.com> (raw)
In-Reply-To: <20230224153812.4176226-1-imammedo@redhat.com>

Generic PCI enumeration code doesn't really need access to
BSEL value, it is only used as means to decide if hotplug
enumerator should be called.

Use stateless object_property_find() to do that, and move
the rest of BSEL handling into build_append_pcihp_slots()
where it belongs.

This cleans up generic code a bit from hotplug stuff
and follow up patch will remove remaining call to
build_append_pcihp_slots() from generic code, making
it possible to use without ACPI PCI hotplug dependencies.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 hw/i386/acpi-build.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 6b51b7401d..d068b0507e 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -519,12 +519,14 @@ static bool is_devfn_ignored_hotplug(const int devfn, const PCIBus *bus)
     return false;
 }
 
-static void build_append_pcihp_slots(Aml *parent_scope, PCIBus *bus,
-                                     QObject *bsel)
+static void build_append_pcihp_slots(Aml *parent_scope, PCIBus *bus)
 {
     int devfn;
     Aml *dev, *notify_method = NULL, *method;
+    QObject *bsel = object_property_get_qobject(OBJECT(bus),
+                        ACPI_PCIHP_PROP_BSEL, NULL);
     uint64_t bsel_val = qnum_get_uint(qobject_to(QNum, bsel));
+    qobject_unref(bsel);
 
     aml_append(parent_scope, aml_name_decl("BSEL", aml_int(bsel_val)));
     notify_method = aml_method("DVNT", 2, AML_NOTSERIALIZED);
@@ -569,12 +571,9 @@ static void build_append_pcihp_slots(Aml *parent_scope, PCIBus *bus,
 
 void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus)
 {
-    QObject *bsel;
     int devfn;
     Aml *dev;
 
-    bsel = object_property_get_qobject(OBJECT(bus), ACPI_PCIHP_PROP_BSEL, NULL);
-
     for (devfn = 0; devfn < ARRAY_SIZE(bus->devices); devfn++) {
         /* ACPI spec: 1.0b: Table 6-2 _ADR Object Bus Types, PCI type */
         int adr = PCI_SLOT(devfn) << 16 | PCI_FUNC(devfn);
@@ -600,11 +599,9 @@ void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus)
         aml_append(parent_scope, dev);
     }
 
-    if (bsel) {
-        build_append_pcihp_slots(parent_scope, bus, bsel);
+    if (object_property_find(OBJECT(bus), ACPI_PCIHP_PROP_BSEL)) {
+        build_append_pcihp_slots(parent_scope, bus);
     }
-
-    qobject_unref(bsel);
 }
 
 static bool build_append_notfication_callback(Aml *parent_scope,
-- 
2.39.1



  parent reply	other threads:[~2023-02-24 15:46 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24 15:37 [PATCH 00/33] pci(pc/q35): acpi-index support on non-hotpluggable slots Igor Mammedov
2023-02-24 15:37 ` [PATCH 01/33] tests: acpi: whitelist new q35.noacpihp test and pc.hpbrroot Igor Mammedov
2023-02-24 15:37 ` [PATCH 02/33] tests: acpi: add test_acpi_q35_tcg_no_acpi_hotplug test and extend test_acpi_piix4_no_acpi_pci_hotplug Igor Mammedov
2023-02-24 15:37 ` [PATCH 03/33] tests: acpi: update expected blobs Igor Mammedov
2023-02-24 15:37 ` [PATCH 04/33] tests: acpi: whitelist q35/DSDT.multi-bridge before extending testcase Igor Mammedov
2023-02-24 15:37 ` [PATCH 05/33] tests: acpi: extend multi-bridge case with case 'root-port, id=HOHP, hotplug=off root-port, bus=NOHP' Igor Mammedov
2023-02-24 15:37 ` [PATCH 06/33] x86: pcihp: fix missing PCNT callchain when intermediate root-port has 'hotplug=off' set Igor Mammedov
2023-02-24 15:37 ` [PATCH 07/33] tests: acpi: whitelist pc/DSDT.hpbrroot and pc/DSDT.hpbridge tests Igor Mammedov
2023-02-24 15:37 ` [PATCH 08/33] x86: pcihp: fix missing bridge AML when intermediate root-port has 'hotplug=off' set Igor Mammedov
2023-02-24 15:37 ` [PATCH 09/33] tests: acpi: update expected blobs Igor Mammedov
2023-02-24 15:37 ` [PATCH 10/33] pcihp: piix4: do not redirect hotplug controller to piix4 when ACPI hotplug is disabled Igor Mammedov
2023-02-24 15:37 ` [PATCH 11/33] pci: fix 'hotplugglable' property behavior Igor Mammedov
2023-02-24 15:37 ` [PATCH 12/33] tests: acpi: whitelist DSDT blobs before isolating PCI _DSM func 0 prolog Igor Mammedov
2023-02-24 15:37 ` [PATCH 13/33] pcihp: move PCI _DSM function 0 prolog into separate function Igor Mammedov
2023-02-24 15:37 ` [PATCH 14/33] tests: acpi: update expected blobs Igor Mammedov
2023-03-02  0:27   ` Michael S. Tsirkin
2023-03-02 12:02     ` Igor Mammedov
2023-03-02 12:55       ` Fabiano Rosas
2023-03-02 14:57         ` Igor Mammedov
2023-03-02 15:43           ` Fabiano Rosas
2023-03-02 15:59             ` Igor Mammedov
2023-03-02  0:37   ` Michael S. Tsirkin
2023-02-24 15:37 ` [PATCH 15/33] tests: acpi: whitelist DSDT before adding EDSM method Igor Mammedov
2023-02-24 15:37 ` [PATCH 16/33] acpi: pci: add EDSM method to DSDT Igor Mammedov
2023-02-24 15:37 ` [PATCH 17/33] tests: acpi: update expected blobs Igor Mammedov
2023-02-24 15:37 ` [PATCH 18/33] tests: acpi: whitelist DSDT before adding device with acpi-index to testcases Igor Mammedov
2023-02-24 15:37 ` [PATCH 19/33] tests: acpi: add device with acpi-index on non-hotpluggble bus Igor Mammedov
2023-02-24 15:37 ` [PATCH 20/33] acpi: pci: support acpi-index for non-hotpluggable devices Igor Mammedov
2023-02-24 15:38 ` [PATCH 21/33] tests: acpi: update expected blobs Igor Mammedov
2023-02-24 15:38 ` [PATCH 22/33] tests: acpi: whitelist DSDT before exposing non zero functions Igor Mammedov
2023-02-24 15:38 ` [PATCH 23/33] acpi: pci: describe all functions on populated slots Igor Mammedov
2023-02-24 15:38 ` [PATCH 24/33] tests: acpi: update expected blobs Igor Mammedov
2023-02-24 15:38 ` [PATCH 25/33] tests: acpi: whitelist DSDT before adding non-0 function device with acpi-index to testcases Igor Mammedov
2023-02-24 15:38 ` [PATCH 26/33] tests: acpi: add non zero function device with acpi-index on non-hotpluggble bus Igor Mammedov
2023-02-24 15:38 ` [PATCH 27/33] tests: acpi: update expected blobs Igor Mammedov
2023-02-24 15:38 ` [PATCH 28/33] pci: move acpi-index uniqueness check to generic PCI device code Igor Mammedov
2023-02-24 15:38 ` [PATCH 29/33] acpi: pci: drop BSEL usage when deciding that device isn't hotpluggable Igor Mammedov
2023-02-24 15:38 ` Igor Mammedov [this message]
2023-02-24 15:38 ` [PATCH 31/33] acpi: pci: move out ACPI PCI hotplug generator from generic slot generator build_append_pci_bus_devices() Igor Mammedov
2023-02-24 15:38 ` [PATCH 32/33] pcihp: move fields enabling hotplug into AcpiPciHpState Igor Mammedov
2023-02-24 15:38 ` [PATCH 33/33] pcihp: add ACPI PCI hotplug specific is_hotpluggable_bus() callback Igor Mammedov
2023-03-02 10:59 ` [PATCH 00/33] pci(pc/q35): acpi-index support on non-hotpluggable slots Michael S. Tsirkin
2023-03-02 12:05   ` Jonathan Cameron via
2023-03-02 12:07   ` Igor Mammedov
2023-03-02 23:21     ` Michael S. Tsirkin
2023-03-06 10:49       ` Igor Mammedov

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=20230224153812.4176226-31-imammedo@redhat.com \
    --to=imammedo@redhat.com \
    --cc=ani@anisinha.ca \
    --cc=berrange@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).