qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Marcel Apfelbaum <marcel@redhat.com>, qemu-devel@nongnu.org
Cc: mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH] hw/pci: ensure that only PCI/PCIe bridges can be attached to pxb/pxb-pcie devices
Date: Mon, 18 Jan 2016 19:02:38 +0100	[thread overview]
Message-ID: <569D28BE.90808@redhat.com> (raw)
In-Reply-To: <1453130846-14064-1-git-send-email-marcel@redhat.com>

On 01/18/16 16:27, Marcel Apfelbaum wrote:
> PCI devices can't be plugged directly into PCI extra root bridges
> because their resources can't be computed by firmware before the ACPI
> tables are loaded.
> 
> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
> ---
> 
> Hi,
> 
> This patch follows the discussion:
> https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg01484.html
> 
> Thanks,
> Marcel
>     
>  hw/pci/pci.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index 168b9cc..584f504 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -850,6 +850,13 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
>      DeviceState *dev = DEVICE(pci_dev);
>  
>      pci_dev->bus = bus;
> +    /* Only pci bridges can be attached to extra PCI root buses */
> +    if (pci_bus_is_root(bus) && bus->parent_dev && !pc->is_bridge) {
> +        error_setg(errp,
> +                   "PCI: Only PCI/PCIe bridges can be plugged into %s",
> +                    bus->parent_dev->name);
> +        return NULL;
> +    }
>  
>      if (devfn < 0) {
>          for(devfn = bus->devfn_min ; devfn < ARRAY_SIZE(bus->devices);
> 

Looks sensible to me (and the commit message actually enlightens me a
bit :)), but you could very easily trick me in this area, so I'll leave
formal review to others. :)

Laszlo

  reply	other threads:[~2016-01-18 18:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-18 15:27 [Qemu-devel] [PATCH] hw/pci: ensure that only PCI/PCIe bridges can be attached to pxb/pxb-pcie devices Marcel Apfelbaum
2016-01-18 18:02 ` Laszlo Ersek [this message]
2016-01-18 18:08 ` Peter Maydell
2016-01-18 18:16   ` Laszlo Ersek
2016-01-18 18:27     ` Peter Maydell
2016-01-19  8:04     ` Marcel Apfelbaum
2016-02-02 12:09       ` Marcel Apfelbaum

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=569D28BE.90808@redhat.com \
    --to=lersek@redhat.com \
    --cc=marcel@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).