All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Aleksandr Bezzubikov <zuban32s@gmail.com>
Cc: qemu-devel@nongnu.org, marcel@redhat.com, imammedo@redhat.com,
	pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com
Subject: Re: [Qemu-devel] [PATCH RFC 6/6] hw/ich9: enable acpi pci hotplug
Date: Fri, 30 Jun 2017 02:31:17 +0300	[thread overview]
Message-ID: <20170630023053-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1498773362-18675-7-git-send-email-zuban32s@gmail.com>

On Fri, Jun 30, 2017 at 12:56:02AM +0300, Aleksandr Bezzubikov wrote:
> Signed-off-by: Aleksandr Bezzubikov <zuban32s@gmail.com>

This commit log is where you describe what works and
what doesn't so people can figure it out from git log.

> ---
>  hw/acpi/ich9.c         | 31 +++++++++++++++++++++++++++++++
>  hw/isa/lpc_ich9.c      | 12 ++++++++++++
>  include/hw/acpi/ich9.h |  4 ++++
>  include/hw/i386/pc.h   |  7 ++++++-
>  4 files changed, 53 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
> index 5c279bb..25339eb 100644
> --- a/hw/acpi/ich9.c
> +++ b/hw/acpi/ich9.c
> @@ -258,6 +258,7 @@ static void pm_reset(void *opaque)
>      }
>      pm->smi_en_wmask = ~0;
>  
> +    acpi_pcihp_reset(&pm->acpi_pci_hotplug);
>      acpi_update_sci(&pm->acpi_regs, pm->irq);
>  }
>  
> @@ -301,6 +302,10 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
>      pm->powerdown_notifier.notify = pm_powerdown_req;
>      qemu_register_powerdown_notifier(&pm->powerdown_notifier);
>  
> +    acpi_pcihp_init(OBJECT(lpc_pci), &pm->acpi_pci_hotplug, lpc_pci->bus,
> +                    pci_address_space_io(lpc_pci),
> +                    pm->use_acpi_pci_hotplug);
> +
>      legacy_acpi_cpu_hotplug_init(pci_address_space_io(lpc_pci),
>          OBJECT(lpc_pci), &pm->gpe_cpu, ICH9_CPU_HOTPLUG_IO_BASE);
>  
> @@ -335,6 +340,21 @@ static void ich9_pm_set_memory_hotplug_support(Object *obj, bool value,
>      s->pm.acpi_memory_hotplug.is_enabled = value;
>  }
>  
> +static bool ich9_pm_get_acpi_pci_hotplug_support(Object *obj, Error **errp)
> +{
> +    ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
> +
> +    return s->pm.use_acpi_pci_hotplug;
> +}
> +
> +static void ich9_pm_set_acpi_pci_hotplug_support(Object *obj, bool value,
> +                                                 Error **errp)
> +{
> +    ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
> +
> +    s->pm.use_acpi_pci_hotplug = value;
> +}
> +
>  static bool ich9_pm_get_cpu_hotplug_legacy(Object *obj, Error **errp)
>  {
>      ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
> @@ -446,6 +466,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp)
>  {
>      static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN;
>      pm->acpi_memory_hotplug.is_enabled = true;
> +    pm->use_acpi_pci_hotplug = true;
>      pm->cpu_hotplug_legacy = true;
>      pm->disable_s3 = 0;
>      pm->disable_s4 = 0;
> @@ -462,6 +483,10 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp)
>                               ich9_pm_get_memory_hotplug_support,
>                               ich9_pm_set_memory_hotplug_support,
>                               NULL);
> +    object_property_add_bool(obj, "acpi-pci-hotplug-with-bridge-support",
> +                             ich9_pm_get_acpi_pci_hotplug_support,
> +                             ich9_pm_set_acpi_pci_hotplug_support,
> +                             NULL);
>      object_property_add_bool(obj, "cpu-hotplug-legacy",
>                               ich9_pm_get_cpu_hotplug_legacy,
>                               ich9_pm_set_cpu_hotplug_legacy,
> @@ -497,6 +522,9 @@ void ich9_pm_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,
>              acpi_memory_plug_cb(hotplug_dev, &lpc->pm.acpi_memory_hotplug,
>                                  dev, errp);
>          }
> +    } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) {
> +        acpi_pcihp_device_plug_cb(hotplug_dev, &lpc->pm.acpi_pci_hotplug,
> +                                  dev, errp);
>      } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) {
>          if (lpc->pm.cpu_hotplug_legacy) {
>              legacy_acpi_cpu_plug_cb(hotplug_dev, &lpc->pm.gpe_cpu, dev, errp);
> @@ -519,6 +547,9 @@ void ich9_pm_device_unplug_request_cb(HotplugHandler *hotplug_dev,
>          acpi_memory_unplug_request_cb(hotplug_dev,
>                                        &lpc->pm.acpi_memory_hotplug, dev,
>                                        errp);
> +    } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) {
> +        acpi_pcihp_device_unplug_cb(hotplug_dev, &lpc->pm.acpi_pci_hotplug,
> +                                    dev, errp);
>      } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU) &&
>                 !lpc->pm.cpu_hotplug_legacy) {
>          acpi_cpu_unplug_request_cb(hotplug_dev, &lpc->pm.cpuhp_state,
> diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
> index e2215dc..13574d0 100644
> --- a/hw/isa/lpc_ich9.c
> +++ b/hw/isa/lpc_ich9.c
> @@ -33,6 +33,7 @@
>  #include "hw/hw.h"
>  #include "qapi/visitor.h"
>  #include "qemu/range.h"
> +#include "qapi/error.h"
>  #include "hw/isa/isa.h"
>  #include "hw/sysbus.h"
>  #include "hw/i386/pc.h"
> @@ -574,6 +575,15 @@ static const MemoryRegionOps rcrb_mmio_ops = {
>      .endianness = DEVICE_LITTLE_ENDIAN,
>  };
>  
> +static void ich9_update_bus_hotplug(PCIBus *pci_bus, void *opaque)
> +{
> +    ICH9LPCState *s = opaque;
> +
> +    if (!pci_bus_is_express(pci_bus)) {
> +        qbus_set_hotplug_handler(BUS(pci_bus), DEVICE(s), &error_abort);
> +    }
> +}
> +
>  static void ich9_lpc_machine_ready(Notifier *n, void *opaque)
>  {
>      ICH9LPCState *s = container_of(n, ICH9LPCState, machine_ready);
> @@ -597,6 +607,8 @@ static void ich9_lpc_machine_ready(Notifier *n, void *opaque)
>          /* floppy */
>          pci_conf[0x82] |= 0x08;
>      }
> +
> +    pci_for_each_bus(s->d.bus, ich9_update_bus_hotplug, s);
>  }
>  
>  /* reset control */
> diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
> index a352c94..e1df363 100644
> --- a/include/hw/acpi/ich9.h
> +++ b/include/hw/acpi/ich9.h
> @@ -22,6 +22,7 @@
>  #define HW_ACPI_ICH9_H
>  
>  #include "hw/acpi/acpi.h"
> +#include "hw/acpi/pcihp.h"
>  #include "hw/acpi/cpu_hotplug.h"
>  #include "hw/acpi/cpu.h"
>  #include "hw/acpi/memory_hotplug.h"
> @@ -55,6 +56,9 @@ typedef struct ICH9LPCPMRegs {
>  
>      MemHotplugState acpi_memory_hotplug;
>  
> +    AcpiPciHpState acpi_pci_hotplug;
> +    bool use_acpi_pci_hotplug;
> +
>      uint8_t disable_s3;
>      uint8_t disable_s4;
>      uint8_t s4_val;
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index e447f5d..0d4e8b2 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -464,7 +464,12 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
>      },
>  
>  #define PC_COMPAT_2_5 \
> -    HW_COMPAT_2_5
> +    HW_COMPAT_2_5 \
> +    {\
> +        .driver   = "ICH9-LPC",\
> +        .property = "acpi-pci-hotplug-with-bridge-support",\
> +        .value    = "off",\
> +    },
>  
>  /* Helper for setting model-id for CPU models that changed model-id
>   * depending on QEMU versions up to QEMU 2.4.
> -- 
> 2.7.4

  reply	other threads:[~2017-06-29 23:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29 21:55 [Qemu-devel] [PATCH RFC 0/6] q35: add acpi pci hotplug support Aleksandr Bezzubikov
2017-06-29 21:55 ` [Qemu-devel] [PATCH RFC 1/6] hw/acpi: remove dead acpi code Aleksandr Bezzubikov
2017-06-29 23:27   ` Michael S. Tsirkin
2017-07-03 11:52     ` Igor Mammedov
2017-06-29 21:55 ` [Qemu-devel] [PATCH RFC 2/6] hw/acpi: simplify dsdt building code Aleksandr Bezzubikov
2017-06-29 21:55 ` [Qemu-devel] [PATCH RFC 3/6] hw/acpi: fix pcihp io initialization Aleksandr Bezzubikov
2017-06-29 23:22   ` Michael S. Tsirkin
2017-06-29 21:56 ` [Qemu-devel] [PATCH RFC 4/6] hw/acpi: prepare pci hotplug IO for ich9 Aleksandr Bezzubikov
2017-06-29 23:28   ` Michael S. Tsirkin
2017-06-29 21:56 ` [Qemu-devel] [PATCH RFC 5/6] hw/acpi: extend acpi pci hotplug support for pci express Aleksandr Bezzubikov
2017-06-29 23:30   ` Michael S. Tsirkin
2017-06-29 21:56 ` [Qemu-devel] [PATCH RFC 6/6] hw/ich9: enable acpi pci hotplug Aleksandr Bezzubikov
2017-06-29 23:31   ` Michael S. Tsirkin [this message]
2017-06-29 23:17 ` [Qemu-devel] [PATCH RFC 0/6] q35: add acpi pci hotplug support Michael S. Tsirkin
2017-06-30  7:25   ` Marcel Apfelbaum
2017-06-30 19:19     ` Michael S. Tsirkin
2017-07-03 12:27     ` Igor Mammedov
2017-07-03 13:58       ` Alexander Bezzubikov
2017-07-03 14:41         ` Alexander Bezzubikov
2017-07-03 16:37           ` Michael S. Tsirkin
2017-07-03 16:34       ` Michael S. Tsirkin
2017-07-03 18:26         ` Marcel Apfelbaum
2017-07-03 18:29           ` Michael S. Tsirkin
2017-07-03 22:06             ` Alexander Bezzubikov
2017-07-04  1:00               ` Alexander Bezzubikov
2017-07-04 12:18                 ` Marcel Apfelbaum
2017-07-04 13:12         ` Igor Mammedov

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=20170630023053-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=marcel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=zuban32s@gmail.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.