All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Julia Suvorova <jusual@redhat.com>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [RFC PATCH 1/5] hw/acpi/pcihp: Introduce find_host()
Date: Mon, 13 Jul 2020 11:37:30 +0200	[thread overview]
Message-ID: <20200713113730.3a8e850f@redhat.com> (raw)
In-Reply-To: <20200708224615.114077-2-jusual@redhat.com>

On Thu,  9 Jul 2020 00:46:11 +0200
Julia Suvorova <jusual@redhat.com> wrote:

> Returns the current host bus with ACPI PCI hot-plug support: q35 or i440fx.
> 
> Signed-off-by: Julia Suvorova <jusual@redhat.com>
> ---
>  hw/i386/acpi-build.h |  2 ++
>  hw/acpi/pcihp.c      | 13 +++++++++++++
>  hw/i386/acpi-build.c |  2 +-
>  3 files changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/i386/acpi-build.h b/hw/i386/acpi-build.h
> index 74df5fc612..0696b4e48d 100644
> --- a/hw/i386/acpi-build.h
> +++ b/hw/i386/acpi-build.h
> @@ -7,4 +7,6 @@ extern const struct AcpiGenericAddress x86_nvdimm_acpi_dsmio;
>  
>  void acpi_setup(void);
>  
> +Object *acpi_get_i386_pci_host(void);
> +
>  #endif
> diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
> index d42906ea19..3d4ee3af72 100644
> --- a/hw/acpi/pcihp.c
> +++ b/hw/acpi/pcihp.c
> @@ -33,10 +33,12 @@
>  #include "hw/acpi/acpi.h"
>  #include "exec/address-spaces.h"
>  #include "hw/pci/pci_bus.h"
> +#include "hw/pci/pci_host.h"
>  #include "migration/vmstate.h"
>  #include "qapi/error.h"
>  #include "qom/qom-qobject.h"
>  #include "trace.h"
> +#include "hw/i386/acpi-build.h"
>  
>  #define ACPI_PCIHP_ADDR 0xae00
>  #define ACPI_PCIHP_SIZE 0x0014
> @@ -86,6 +88,17 @@ static void *acpi_set_bsel(PCIBus *bus, void *opaque)
>      return bsel_alloc;
>  }
>  
> +static PCIBus *find_host(void)
> +{
> +    Object *obj = acpi_get_i386_pci_host();
> +
> +    if (obj) {
> +        return PCI_HOST_BRIDGE(obj)->bus;
> +    }
> +
> +    return NULL;
> +}

My guess you are adding it for 5/5, with a function name a bit off
compared to what you are doing (probably you've tried to reuse find_i440fx() idea)

I'd just make acpi_get_i386_pci_host() public, drop find_host and use

 host = acpi_get_i386_pci_host()
 bus = PCI_HOST_BRIDGE(pci_host)->bus

like it's done elsewhere

>  static void acpi_set_pci_info(void)
>  {
>      static bool bsel_is_set;
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 900f786d08..11c598f955 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -270,7 +270,7 @@ static void acpi_get_misc_info(AcpiMiscInfo *info)
>   * Because of the PXB hosts we cannot simply query TYPE_PCI_HOST_BRIDGE.
>   * On i386 arch we only have two pci hosts, so we can look only for them.
>   */
> -static Object *acpi_get_i386_pci_host(void)
> +Object *acpi_get_i386_pci_host(void)
>  {
>      PCIHostState *host;
>  



  reply	other threads:[~2020-07-13  9:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08 22:46 [RFC PATCH 0/5] Use ACPI PCI hot-plug for q35 Julia Suvorova
2020-07-08 22:46 ` [RFC PATCH 1/5] hw/acpi/pcihp: Introduce find_host() Julia Suvorova
2020-07-13  9:37   ` Igor Mammedov [this message]
2020-07-08 22:46 ` [RFC PATCH 2/5] hw/acpi/ich9: Trace ich9_gpe_readb()/writeb() Julia Suvorova
2020-07-13  9:39   ` Igor Mammedov
2020-07-08 22:46 ` [RFC PATCH 3/5] hw/i386/acpi-build: Add ACPI PCI hot-plug methods to q35 Julia Suvorova
2020-07-13 14:39   ` Igor Mammedov
2020-07-14  9:22     ` Michael S. Tsirkin
2020-07-14 14:57       ` Igor Mammedov
2020-07-15  6:57     ` Gerd Hoffmann
2020-07-15 13:17       ` Igor Mammedov
2020-07-15 14:02         ` Gerd Hoffmann
2020-07-08 22:46 ` [RFC PATCH 4/5] hw/i386/acpi-build: Turn off support of PCIe native hot-plug and SHPC in _OSC Julia Suvorova
2020-07-13 14:56   ` Igor Mammedov
2020-07-14  8:39     ` Michael S. Tsirkin
2020-07-15 13:23       ` Igor Mammedov
2020-07-08 22:46 ` [RFC PATCH 5/5] hw/acpi/ich9: Enable ACPI PCI hot-plug Julia Suvorova
2020-07-13 15:17   ` Igor Mammedov
2020-07-14  8:54     ` Michael S. Tsirkin
2020-07-15 13:33       ` Igor Mammedov
2020-07-08 23:29 ` [RFC PATCH 0/5] Use ACPI PCI hot-plug for q35 no-reply
2020-07-08 23:33 ` no-reply

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=20200713113730.3a8e850f@redhat.com \
    --to=imammedo@redhat.com \
    --cc=jusual@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 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.