On Thu, 1 May 2025 23:04:47 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> VIRTIO_PCI_FLAG_INIT_LNKCTL was only used by the hw_compat_2_8[]
> array, via the 'x-pcie-lnkctl-init=off' property. We removed all
> machines using that array, lets remove all the code around
> VIRTIO_PCI_FLAG_INIT_LNKCTL (see commit 9a4c0e220d8 for similar
> VIRTIO_PCI_FLAG_* enum removal).
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> include/hw/virtio/virtio-pci.h | 4 ----
> hw/virtio/virtio-pci.c | 8 ++------
> 2 files changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio/virtio-pci.h
> index ed142932f7b..a8dd613ffbc 100644
> --- a/include/hw/virtio/virtio-pci.h
> +++ b/include/hw/virtio/virtio-pci.h
> @@ -34,7 +34,6 @@ enum {
> VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT,
> VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT,
> VIRTIO_PCI_FLAG_ATS_BIT,
> - VIRTIO_PCI_FLAG_INIT_LNKCTL_BIT,
> VIRTIO_PCI_FLAG_INIT_PM_BIT,
> VIRTIO_PCI_FLAG_INIT_FLR_BIT,
> VIRTIO_PCI_FLAG_AER_BIT,
> @@ -61,9 +60,6 @@ enum {
> /* address space translation service */
> #define VIRTIO_PCI_FLAG_ATS (1 << VIRTIO_PCI_FLAG_ATS_BIT)
>
> -/* Init Link Control register */
> -#define VIRTIO_PCI_FLAG_INIT_LNKCTL (1 << VIRTIO_PCI_FLAG_INIT_LNKCTL_BIT)
> -
> /* Init Power Management */
> #define VIRTIO_PCI_FLAG_INIT_PM (1 << VIRTIO_PCI_FLAG_INIT_PM_BIT)
>
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index 0075ae590db..5b86a9a447c 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -2218,10 +2218,8 @@ static void virtio_pci_realize(PCIDevice *pci_dev, Error **errp)
> /* Init error enabling flags */
> pcie_cap_deverr_init(pci_dev);
>
> - if (proxy->flags & VIRTIO_PCI_FLAG_INIT_LNKCTL) {
> - /* Init Link Control Register */
> - pcie_cap_lnkctl_init(pci_dev);
> - }
> + /* Init Link Control Register */
> + pcie_cap_lnkctl_init(pci_dev);
>
> if (proxy->flags & VIRTIO_PCI_FLAG_PM_NO_SOFT_RESET) {
> pci_set_word(pci_dev->config + pos + PCI_PM_CTRL,
> @@ -2347,8 +2345,6 @@ static const Property virtio_pci_properties[] = {
> VIRTIO_PCI_FLAG_ATS_BIT, false),
> DEFINE_PROP_BIT("x-ats-page-aligned", VirtIOPCIProxy, flags,
> VIRTIO_PCI_FLAG_ATS_PAGE_ALIGNED_BIT, true),
> - DEFINE_PROP_BIT("x-pcie-lnkctl-init", VirtIOPCIProxy, flags,
> - VIRTIO_PCI_FLAG_INIT_LNKCTL_BIT, true),
> DEFINE_PROP_BIT("x-pcie-pm-init", VirtIOPCIProxy, flags,
> VIRTIO_PCI_FLAG_INIT_PM_BIT, true),
> DEFINE_PROP_BIT("x-pcie-pm-no-soft-reset", VirtIOPCIProxy, flags,