diff mbox series

[07/18] hw/pci/pcie: Remove QEMU_PCIE_EXTCAP_INIT definition

Message ID 20250501210456.89071-8-philmd@linaro.org
State New
Headers show
Series hw/i386/pc: Remove deprecated 2.8 and 2.9 PC machines | expand

Commit Message

Philippe Mathieu-Daudé May 1, 2025, 9:04 p.m. UTC
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, lets remove all the code around
QEMU_PCIE_EXTCAP_INIT.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/pci/pci.h | 2 --
 hw/pci/pci.c         | 2 --
 hw/pci/pcie.c        | 5 -----
 3 files changed, 9 deletions(-)

Comments

Igor Mammedov June 5, 2025, 3:14 p.m. UTC | #1
On Thu,  1 May 2025 23:04:45 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> 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, lets remove all the code around
> QEMU_PCIE_EXTCAP_INIT.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  include/hw/pci/pci.h | 2 --
>  hw/pci/pci.c         | 2 --
>  hw/pci/pcie.c        | 5 -----
>  3 files changed, 9 deletions(-)
> 
> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
> index c2fe6caa2c6..6c72a61c4b6 100644
> --- a/include/hw/pci/pci.h
> +++ b/include/hw/pci/pci.h
> @@ -210,8 +210,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
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index fe38c4c0287..36206c77b7c 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -90,8 +90,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 1b12db6fa29..a3969423bd3 100644
> --- a/hw/pci/pcie.c
> +++ b/hw/pci/pcie.c
> @@ -245,11 +245,6 @@ 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) {

so this one is true by default, and with knob removed
anything inside block should be called unconditionally (i.e. not like diff below),
aren't it?

> -        /* read-only to behave like a 'NULL' Extended Capability Header */
> -        pci_set_long(dev->wmask + PCI_CONFIG_SPACE_SIZE, 0);
> -    }
> -
>      return pos;
>  }
>
diff mbox series

Patch

diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index c2fe6caa2c6..6c72a61c4b6 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -210,8 +210,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
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index fe38c4c0287..36206c77b7c 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -90,8 +90,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 1b12db6fa29..a3969423bd3 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -245,11 +245,6 @@  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);
-    }
-
     return pos;
 }