qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Julia Suvorova <jusual@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>,
	David Gibson <dgibson@redhat.com>,
	qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v6 2/6] hw/acpi/ich9: Enable ACPI PCI hot-plug
Date: Tue, 13 Jul 2021 14:09:59 +1000	[thread overview]
Message-ID: <YO0SF+gPFYc6OYn6@yekko> (raw)
In-Reply-To: <20210713004205.775386-3-jusual@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2739 bytes --]

On Tue, Jul 13, 2021 at 02:42:01AM +0200, Julia Suvorova wrote:
> Add acpi_pcihp to ich9_pm as part of
> 'acpi-pci-hotplug-with-bridge-support' option. Set default to false.
> 
> Signed-off-by: Julia Suvorova <jusual@redhat.com>
> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
> Reviewed-by: Igor Mammedov <imammedo@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

Since it looks safe, however I think there are a couple of unnecessary
changes here:


[snip]
> @@ -103,6 +105,7 @@ static void *acpi_set_bsel(PCIBus *bus, void *opaque)
>  static void acpi_set_pci_info(void)
>  {
>      static bool bsel_is_set;
> +    Object *host = acpi_get_i386_pci_host();
>      PCIBus *bus;
>      unsigned bsel_alloc = ACPI_PCIHP_BSEL_DEFAULT;
>  
> @@ -111,7 +114,11 @@ static void acpi_set_pci_info(void)
>      }
>      bsel_is_set = true;
>  
> -    bus = find_i440fx(); /* TODO: Q35 support */
> +    if (!host) {

AFAICT acpi_get_i386_pci_host() still can't return NULL, so I'm not
sure this test is necessary.

[snip]
> -static Object *acpi_get_i386_pci_host(void)
> +Object *acpi_get_i386_pci_host(void)
>  {
>      PCIHostState *host;
>  
> @@ -320,7 +320,10 @@ static void acpi_get_pci_holes(Range *hole, Range *hole64)
>      Object *pci_host;
>  
>      pci_host = acpi_get_i386_pci_host();
> -    g_assert(pci_host);
> +
> +    if (!pci_host) {
> +        return;
> +    }

Likewise this change.

>  
>      range_set_bounds1(hole,
>                        object_property_get_uint(pci_host,
> @@ -1765,6 +1768,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
>          PCIBus *bus = NULL;
>  
>          pci_host = acpi_get_i386_pci_host();
> +
>          if (pci_host) {
>              bus = PCI_HOST_BRIDGE(pci_host)->bus;
>          }
> @@ -2321,7 +2325,9 @@ static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg)
>      QObject *o;
>  
>      pci_host = acpi_get_i386_pci_host();
> -    g_assert(pci_host);
> +    if (!pci_host) {
> +        return false;
> +    }

And this one.

>  
>      o = object_property_get_qobject(pci_host, PCIE_HOST_MCFG_BASE, NULL);
>      if (!o) {
> @@ -2351,7 +2357,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
>      AcpiPmInfo pm;
>      AcpiMiscInfo misc;
>      AcpiMcfgInfo mcfg;
> -    Range pci_hole, pci_hole64;
> +    Range pci_hole = {}, pci_hole64 = {};
>      uint8_t *u;
>      size_t aml_len = 0;
>      GArray *tables_blob = tables->table_data;

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-07-13  4:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13  0:41 [PATCH v6 0/6] Use ACPI PCI hot-plug for Q35 Julia Suvorova
2021-07-13  0:42 ` [PATCH v6 1/6] hw/i386/acpi-build: Add ACPI PCI hot-plug methods to Q35 Julia Suvorova
2021-07-13  4:02   ` David Gibson
2021-07-13  0:42 ` [PATCH v6 2/6] hw/acpi/ich9: Enable ACPI PCI hot-plug Julia Suvorova
2021-07-13  4:09   ` David Gibson [this message]
2021-07-13 10:02     ` Marcel Apfelbaum
2021-07-13  0:42 ` [PATCH v6 3/6] hw/pci/pcie: Do not set HPC flag if acpihp is used Julia Suvorova
2021-07-13  0:42 ` [PATCH v6 4/6] bios-tables-test: Allow changes in DSDT ACPI tables Julia Suvorova
2021-07-13  0:42 ` [PATCH v6 5/6] hw/acpi/ich9: Set ACPI PCI hot-plug as default on Q35 Julia Suvorova
2021-07-13  4:11   ` David Gibson
2021-07-13  7:59   ` Igor Mammedov
2021-07-13 10:23     ` Marcel Apfelbaum
2021-07-13 15:17     ` Michael S. Tsirkin
2021-07-13  0:42 ` [PATCH v6 6/6] bios-tables-test: Update golden binaries Julia Suvorova

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=YO0SF+gPFYc6OYn6@yekko \
    --to=david@gibson.dropbear.id.au \
    --cc=dgibson@redhat.com \
    --cc=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 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).