All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Cc: qemu-devel@nongnu.org, "Daniel P. Berrangé" <berrange@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Thomas Huth" <thuth@redhat.com>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Peter Maydell" <peter.maydell@linaro.org>
Subject: Re: [PATCH 3/3] hw/pci: Consider reserved slots mask when checking PCI bus is full
Date: Tue, 7 Jul 2026 06:20:12 -0400	[thread overview]
Message-ID: <20260707061902-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20260707084050.32137-4-philmd@oss.qualcomm.com>

On Tue, Jul 07, 2026 at 10:40:50AM +0200, Philippe Mathieu-Daudé wrote:
> Do not consider reserved slots as available.
>

Philippe this is not how commit logs are supposed to look,
just repeating what the patch does with no explanation.
You know that.
 
> Fixes: 8b8849844fd ("pci: add reserved slot check to do_pci_register_device")

especially if it's supposedly a regression?

> Reported-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  hw/pci/pci.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index b04e94a150b..2e5412137b3 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -62,6 +62,7 @@ static char *pcibus_get_dev_path(DeviceState *dev);
>  static char *pcibus_get_fw_dev_path(DeviceState *dev);
>  static void pcibus_reset_hold(Object *obj, ResetType type);
>  static bool pcie_has_upstream_port(PCIDevice *dev);
> +static bool pci_bus_is_full(const BusState *qbus);
>  
>  static void prop_pci_busnr_get(Object *obj, Visitor *v, const char *name,
>                                 void *opaque, Error **errp)
> @@ -293,6 +294,7 @@ static void pci_bus_class_init(ObjectClass *klass, const void *data)
>      k->print_dev = pcibus_dev_print;
>      k->get_dev_path = pcibus_get_dev_path;
>      k->get_fw_dev_path = pcibus_get_fw_dev_path;
> +    k->is_full = pci_bus_is_full;
>      k->realize = pci_bus_realize;
>      k->unrealize = pci_bus_unrealize;
>  
> @@ -1329,6 +1331,21 @@ void pci_bus_clear_slot_reserved_mask(PCIBus *bus, uint32_t mask)
>      bus->slot_reserved_mask &= ~mask;
>  }
>  
> +static bool pci_bus_is_full(const BusState *qbus)
> +{
> +    const PCIBus *bus = PCI_BUS(qbus);
> +
> +    for (int i = 0; i < PCI_DEVFN_MAX; i += PCI_FUNC_MAX) {
> +        if (pci_bus_devfn_reserved(bus, i)) {
> +            continue;
> +        }
> +        if (pci_bus_devfn_available(bus, i)) {
> +            return false;
> +        }
> +    }
> +    return true;
> +}
> +
>  /* -1 for devfn means auto assign */
>  static PCIDevice *do_pci_register_device(PCIDevice *pci_dev,
>                                           const char *name, int devfn,
> -- 
> 2.53.0



  reply	other threads:[~2026-07-07 10:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-07  8:40 [PATCH 0/3] hw/pci: Consider reserved slots mask when checking PCI bus is full Philippe Mathieu-Daudé
2026-07-07  8:40 ` [PATCH 1/3] hw/pci: Have various pci_bus*() methods take a const PCIBus argument Philippe Mathieu-Daudé
2026-07-07  9:11   ` Thomas Huth
2026-07-07  8:40 ` [PATCH 2/3] hw/qdev: Introduce BusClass::is_full() handler Philippe Mathieu-Daudé
2026-07-07  8:40 ` [PATCH 3/3] hw/pci: Consider reserved slots mask when checking PCI bus is full Philippe Mathieu-Daudé
2026-07-07 10:20   ` Michael S. Tsirkin [this message]
2026-07-07 12:53     ` Philippe Mathieu-Daudé
2026-07-07 13:43       ` Michael S. Tsirkin
2026-07-07 22:05 ` [PATCH 0/3] " Mark Cave-Ayland

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=20260707061902-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=atar4qemu@gmail.com \
    --cc=berrange@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.