[Qemu-devel] [RFC 0/3] pci_expander_brdige: Put pxb host bridge into separate pci domain

Zihan Yang posted 3 patches 5 years, 10 months ago
Failed in applying to current master (apply log)
hw/i386/acpi-build.c                        | 83 ++++++++++++++++++-------
hw/i386/pc.c                                |  5 ++
hw/pci-bridge/pci_expander_bridge.c         | 96 ++++++++++++++++++++++++++++-
hw/pci/pci.c                                |  9 +--
include/hw/pci-bridge/pci_expander_bridge.h |  7 +++
include/hw/pci/pci_host.h                   |  2 +-
6 files changed, 175 insertions(+), 27 deletions(-)
create mode 100644 include/hw/pci-bridge/pci_expander_bridge.h
[Qemu-devel] [RFC 0/3] pci_expander_brdige: Put pxb host bridge into separate pci domain
Posted by Zihan Yang 5 years, 10 months ago
Currently only q35 host bridge is allocated an item in MCFG table, all pxb
host bridges stay within pci domain 0. This series of patches put each pxb
host bridge in separate pci domain, allocating a new MCFG table item for it.

The pxb host does not have an mch in it, as q35 host already has one. All
pxb host bridges just serve as expander bridges in QEMU, which makes them
a little simpler than q35 host bridge.

NOTE: These patches are just initial proof of concept, asking for suggestions.
      The aml part and seabios part are not finished at all. This means it
      still behaves like before, that all pci expander bridges stay in the
      same pci domain as a35 host.

Zihan Yang (3):
  pci_expander_bridge: reserve enough mcfg space for pxb host
  pci: Link pci_host_bridges with QTAILQ
  acpi-build: allocate mcfg for multiple host bridges

 hw/i386/acpi-build.c                        | 83 ++++++++++++++++++-------
 hw/i386/pc.c                                |  5 ++
 hw/pci-bridge/pci_expander_bridge.c         | 96 ++++++++++++++++++++++++++++-
 hw/pci/pci.c                                |  9 +--
 include/hw/pci-bridge/pci_expander_bridge.h |  7 +++
 include/hw/pci/pci_host.h                   |  2 +-
 6 files changed, 175 insertions(+), 27 deletions(-)
 create mode 100644 include/hw/pci-bridge/pci_expander_bridge.h

-- 
2.7.4


Re: [Qemu-devel] [RFC 0/3] pci_expander_brdige: Put pxb host bridge into separate pci domain
Posted by Marcel Apfelbaum 5 years, 10 months ago
Hi Zihan

On 05/20/2018 10:28 AM, Zihan Yang wrote:

You do have patch 0, sorry for not seeing it, please disregard my prev 
comment.

> Currently only q35 host bridge is allocated an item in MCFG table, all pxb
> host bridges stay within pci domain 0. This series of patches put each pxb
> host bridge in separate pci domain, allocating a new MCFG table item for it.

Maybe we should add a parameter to the pxb-pci device specifying the PCI 
domain
instead of adding it on the fly. It will help ensuring the PCI domain 
will not change over
time due to code changes.In this case "bus sharing" should be off. For 
the moment
the pxb devices get the bus range from the same PCI domain.
> The pxb host does not have an mch in it, as q35 host already has one. All
> pxb host bridges just serve as expander bridges in QEMU, which makes them
> a lit
> tle simpler than q35 host bridge.
Agreed

> NOTE: These patches are just initial proof of concept, asking for suggestions.
>        The aml part and seabios part are not finished at all. This means it
>        still behaves like before, that all pci expander bridges stay in the
>        same pci domain as a35 host.

Looks promising!

Thanks,
Marcel

> Zihan Yang (3):
>    pci_expander_bridge: reserve enough mcfg space for pxb host
>    pci: Link pci_host_bridges with QTAILQ
>    acpi-build: allocate mcfg for multiple host bridges
>
>   hw/i386/acpi-build.c                        | 83 ++++++++++++++++++-------
>   hw/i386/pc.c                                |  5 ++
>   hw/pci-bridge/pci_expander_bridge.c         | 96 ++++++++++++++++++++++++++++-
>   hw/pci/pci.c                                |  9 +--
>   include/hw/pci-bridge/pci_expander_bridge.h |  7 +++
>   include/hw/pci/pci_host.h                   |  2 +-
>   6 files changed, 175 insertions(+), 27 deletions(-)
>   create mode 100644 include/hw/pci-bridge/pci_expander_bridge.h
>


Re: [Qemu-devel] [RFC 0/3] pci_expander_brdige: Put pxb host bridge into separate pci domain
Posted by Zihan Yang 5 years, 10 months ago
> Maybe we should add a parameter to the pxb-pci device specifying the PCI
domain
> instead of adding it on the fly. It will help ensuring the PCI domain
will not change over
> time due to code changes.In this case "bus sharing" should be off. For
the moment
> the pxb devices get the bus range from the same PCI domain.

That's good advice. I'll do that in v2.

Thanks,
Zihan