Commit 51859dcf2b for qemu.org

commit 51859dcf2b76b77092d7c88561e85c119c3bd1e5
Author: Philippe Mathieu-Daudé <philmd@linaro.org>
Date:   Wed Feb 25 10:20:14 2026 +0100

    hw/pci/pcie: Remove QEMU_PCIE_EXTCAP_INIT definition

    QEMU_PCIE_EXTCAP_INIT was only used by the hw_compat_2_8[]
    array, via the 'x-pcie-extcap-init=off' property. We removed
    all machines using that array, let's remove all the code around
    QEMU_PCIE_EXTCAP_INIT.

    Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Message-ID: <20250501210456.89071-8-philmd@linaro.org>
    [thuth: Don't remove pci_set_long(), execute it always instead]
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Message-ID: <20260225092024.794595-7-thuth@redhat.com>

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 90d6d71efd..6399ebd41c 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -84,8 +84,6 @@ static const Property pci_props[] = {
                     QEMU_PCI_CAP_MULTIFUNCTION_BITNR, false),
     DEFINE_PROP_BIT("x-pcie-lnksta-dllla", PCIDevice, cap_present,
                     QEMU_PCIE_LNKSTA_DLLLA_BITNR, true),
-    DEFINE_PROP_BIT("x-pcie-extcap-init", PCIDevice, cap_present,
-                    QEMU_PCIE_EXTCAP_INIT_BITNR, true),
     DEFINE_PROP_STRING("failover_pair_id", PCIDevice,
                        failover_pair_id),
     DEFINE_PROP_UINT32("acpi-index",  PCIDevice, acpi_index, 0),
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index cae5061e69..4622c75e48 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -250,10 +250,8 @@ int pcie_cap_init(PCIDevice *dev, uint8_t offset,

     pci_set_word(dev->wmask + pos + PCI_EXP_DEVCTL2, PCI_EXP_DEVCTL2_EETLPPB);

-    if (dev->cap_present & QEMU_PCIE_EXTCAP_INIT) {
-        /* read-only to behave like a 'NULL' Extended Capability Header */
-        pci_set_long(dev->wmask + PCI_CONFIG_SPACE_SIZE, 0);
-    }
+    /* read-only to behave like a 'NULL' Extended Capability Header */
+    pci_set_long(dev->wmask + PCI_CONFIG_SPACE_SIZE, 0);

     return pos;
 }
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index d9835dfd0d..64141e92fe 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -219,8 +219,6 @@ enum {
     /* Link active status in endpoint capability is always set */
 #define QEMU_PCIE_LNKSTA_DLLLA_BITNR 8
     QEMU_PCIE_LNKSTA_DLLLA = (1 << QEMU_PCIE_LNKSTA_DLLLA_BITNR),
-#define QEMU_PCIE_EXTCAP_INIT_BITNR 9
-    QEMU_PCIE_EXTCAP_INIT = (1 << QEMU_PCIE_EXTCAP_INIT_BITNR),
 #define QEMU_PCIE_CXL_BITNR 10
     QEMU_PCIE_CAP_CXL = (1 << QEMU_PCIE_CXL_BITNR),
 #define QEMU_PCIE_ERR_UNC_MASK_BITNR 11