From: Igor Mammedov <imammedo@redhat.com>
To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
Cc: "peter.maydell@linaro.org" <peter.maydell@linaro.org>,
"sameo@linux.intel.com" <sameo@linux.intel.com>,
"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Linuxarm <linuxarm@huawei.com>,
"shannon.zhaosl@gmail.com" <shannon.zhaosl@gmail.com>,
"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
"xuwei \(O\)" <xuwei5@huawei.com>,
"sebastien.boeuf@intel.com" <sebastien.boeuf@intel.com>,
"lersek@redhat.com" <lersek@redhat.com>,
"eric.auger@redhat.com" <eric.auger@redhat.com>
Subject: Re: [Qemu-devel] [PATCH-for-4.2 v7 09/10] hw/arm: Use GED for system_powerdown event
Date: Tue, 23 Jul 2019 14:46:50 +0200 [thread overview]
Message-ID: <20190723144650.4644ffb5@redhat.com> (raw)
In-Reply-To: <5FC3163CFD30C246ABAA99954A238FA83F310A72@lhreml524-mbs.china.huawei.com>
On Mon, 22 Jul 2019 14:15:17 +0000
Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com> wrote:
> > -----Original Message-----
> > From: Qemu-devel
> > [mailto:qemu-devel-bounces+shameerali.kolothum.thodi=huawei.com@nongn
> > u.org] On Behalf Of Igor Mammedov
> > Sent: 18 July 2019 14:03
> > To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
> > Cc: peter.maydell@linaro.org; sameo@linux.intel.com;
> > shannon.zhaosl@gmail.com; ard.biesheuvel@linaro.org;
> > qemu-devel@nongnu.org; xuwei (O) <xuwei5@huawei.com>; Linuxarm
> > <linuxarm@huawei.com>; eric.auger@redhat.com; qemu-arm@nongnu.org;
> > sebastien.boeuf@intel.com; lersek@redhat.com
> > Subject: Re: [Qemu-devel] [PATCH-for-4.2 v7 09/10] hw/arm: Use GED for
> > system_powerdown event
> >
> > On Tue, 16 Jul 2019 16:38:15 +0100
> > Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> wrote:
> >
> > > Use GED for system_powerdown event instead of GPIO for ACPI.
> > > Guest boot with DT still uses GPIO.
> >
> >
> > I'd hate to keep ACPI GPIO around but taking in account migration
> > wouldn't this patch break ACPI GPIO based button on 4.0 and older where
> > GED is not available and guest was booted as ACPI one and then rebooted on
> > new QEMU?
>
> Hmm..That looks like a valid case unfortunately :(. I will keep the GPIO then.
yep, keep it for old machine types. New ones should use GED.
>
> Thanks,
> Shameer
>
> >
> > > Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
> > > Reviewed-by: Eric Auger <eric.auger@redhat.com>
> > > ---
> > > hw/arm/virt-acpi-build.c | 37 +------------------------------------
> > > hw/arm/virt.c | 6 +++---
> > > 2 files changed, 4 insertions(+), 39 deletions(-)
> > >
> > > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> > > index 75657caa36..9178ca8e40 100644
> > > --- a/hw/arm/virt-acpi-build.c
> > > +++ b/hw/arm/virt-acpi-build.c
> > > @@ -49,7 +49,6 @@
> > > #include "kvm_arm.h"
> > >
> > > #define ARM_SPI_BASE 32
> > > -#define ACPI_POWER_BUTTON_DEVICE "PWRB"
> > >
> > > static void acpi_dsdt_add_cpus(Aml *scope, int smp_cpus)
> > > {
> > > @@ -328,37 +327,6 @@ static void acpi_dsdt_add_pci(Aml *scope, const
> > MemMapEntry *memmap,
> > > aml_append(scope, dev);
> > > }
> > >
> > > -static void acpi_dsdt_add_gpio(Aml *scope, const MemMapEntry
> > *gpio_memmap,
> > > - uint32_t gpio_irq)
> > > -{
> > > - Aml *dev = aml_device("GPO0");
> > > - aml_append(dev, aml_name_decl("_HID", aml_string("ARMH0061")));
> > > - aml_append(dev, aml_name_decl("_ADR", aml_int(0)));
> > > - aml_append(dev, aml_name_decl("_UID", aml_int(0)));
> > > -
> > > - Aml *crs = aml_resource_template();
> > > - aml_append(crs, aml_memory32_fixed(gpio_memmap->base,
> > gpio_memmap->size,
> > > - AML_READ_WRITE));
> > > - aml_append(crs, aml_interrupt(AML_CONSUMER, AML_LEVEL,
> > AML_ACTIVE_HIGH,
> > > - AML_EXCLUSIVE, &gpio_irq, 1));
> > > - aml_append(dev, aml_name_decl("_CRS", crs));
> > > -
> > > - Aml *aei = aml_resource_template();
> > > - /* Pin 3 for power button */
> > > - const uint32_t pin_list[1] = {3};
> > > - aml_append(aei, aml_gpio_int(AML_CONSUMER, AML_EDGE,
> > AML_ACTIVE_HIGH,
> > > - AML_EXCLUSIVE, AML_PULL_UP, 0,
> > pin_list, 1,
> > > - "GPO0", NULL, 0));
> > > - aml_append(dev, aml_name_decl("_AEI", aei));
> > > -
> > > - /* _E03 is handle for power button */
> > > - Aml *method = aml_method("_E03", 0, AML_NOTSERIALIZED);
> > > - aml_append(method,
> > aml_notify(aml_name(ACPI_POWER_BUTTON_DEVICE),
> > > - aml_int(0x80)));
> > > - aml_append(dev, method);
> > > - aml_append(scope, dev);
> > > -}
> > > -
> > > static void acpi_dsdt_add_power_button(Aml *scope)
> > > {
> > > Aml *dev = aml_device(ACPI_POWER_BUTTON_DEVICE);
> > > @@ -739,9 +707,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
> > VirtMachineState *vms)
> > > (irqmap[VIRT_MMIO] + ARM_SPI_BASE),
> > NUM_VIRTIO_TRANSPORTS);
> > > acpi_dsdt_add_pci(scope, memmap, (irqmap[VIRT_PCIE] +
> > ARM_SPI_BASE),
> > > vms->highmem, vms->highmem_ecam);
> > > - acpi_dsdt_add_gpio(scope, &memmap[VIRT_GPIO],
> > > - (irqmap[VIRT_GPIO] + ARM_SPI_BASE));
> > > if (vms->acpi_dev) {
> > > + acpi_dsdt_add_power_button(scope);
> > > build_ged_aml(scope, "\\_SB."GED_DEVICE,
> > > HOTPLUG_HANDLER(vms->acpi_dev),
> > > irqmap[VIRT_ACPI_GED] + ARM_SPI_BASE,
> > AML_SYSTEM_MEMORY);
> > > @@ -752,8 +719,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
> > VirtMachineState *vms)
> > > AML_SYSTEM_MEMORY);
> > > }
> > >
> > > - acpi_dsdt_add_power_button(scope);
> > > -
> > > aml_append(dsdt, scope);
> > >
> > > /* copy AML table into ACPI tables blob and patch header there */
> > > diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> > > index ffcccc05ad..6e55c25c5f 100644
> > > --- a/hw/arm/virt.c
> > > +++ b/hw/arm/virt.c
> > > @@ -528,7 +528,7 @@ static inline DeviceState
> > *create_acpi_ged(VirtMachineState *vms, qemu_irq *pic)
> > > {
> > > DeviceState *dev;
> > > int irq = vms->irqmap[VIRT_ACPI_GED];
> > > - uint32_t event = ACPI_GED_MEM_HOTPLUG_EVT;
> > > + uint32_t event = ACPI_GED_MEM_HOTPLUG_EVT |
> > ACPI_GED_PWR_DOWN_EVT;
> > >
> > > dev = DEVICE(object_new(TYPE_ACPI_GED));
> > > qdev_prop_set_uint64(dev, "memhp-base",
> > > @@ -1718,10 +1718,10 @@ static void machvirt_init(MachineState
> > *machine)
> > >
> > > create_pcie(vms, pic);
> > >
> > > - create_gpio(vms, pic);
> > > -
> > > if (!vmc->no_acpi_dev && aarch64 && firmware_loaded &&
> > acpi_enabled) {
> > > vms->acpi_dev = create_acpi_ged(vms, pic);
> > > + } else {
> > > + create_gpio(vms, pic);
> > > }
> > >
> > > /* Create mmio transports, so the user can create virtio backends
next prev parent reply other threads:[~2019-07-23 12:47 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-16 15:38 [Qemu-devel] [PATCH-for-4.2 v7 00/10] ARM virt: ACPI memory hotplug support Shameer Kolothum
2019-07-16 15:38 ` [Qemu-devel] [PATCH-for-4.2 v7 01/10] hw/acpi: Make ACPI IO address space configurable Shameer Kolothum
2019-07-16 15:38 ` [Qemu-devel] [PATCH-for-4.2 v7 02/10] hw/acpi: Do not create memory hotplug method when handler is not defined Shameer Kolothum
2019-07-16 15:38 ` [Qemu-devel] [PATCH-for-4.2 v7 03/10] hw/acpi: Add ACPI Generic Event Device Support Shameer Kolothum
2019-07-17 14:32 ` Igor Mammedov
2019-07-18 10:52 ` Shameerali Kolothum Thodi
2019-07-18 12:30 ` Igor Mammedov
2019-07-22 14:13 ` Shameerali Kolothum Thodi
2019-07-16 15:38 ` [Qemu-devel] [PATCH-for-4.2 v7 04/10] hw/arm/virt: Add memory hotplug framework Shameer Kolothum
2019-07-17 14:40 ` Igor Mammedov
2019-07-16 15:38 ` [Qemu-devel] [PATCH-for-4.2 v7 05/10] hw/arm/virt: Add 4.2 machine type Shameer Kolothum
2019-07-17 14:51 ` Igor Mammedov
2019-07-16 15:38 ` [Qemu-devel] [PATCH-for-4.2 v7 06/10] hw/arm/virt: Enable device memory cold/hot plug with ACPI boot Shameer Kolothum
2019-07-18 12:41 ` Igor Mammedov
2019-07-16 15:38 ` [Qemu-devel] [PATCH-for-4.2 v7 07/10] hw/arm/virt-acpi-build: Add PC-DIMM in SRAT Shameer Kolothum
2019-07-16 15:38 ` [Qemu-devel] [PATCH-for-4.2 v7 08/10] hw/acpi: Add system power down support to GED Shameer Kolothum
2019-07-18 13:07 ` Igor Mammedov
2019-07-16 15:38 ` [Qemu-devel] [PATCH-for-4.2 v7 09/10] hw/arm: Use GED for system_powerdown event Shameer Kolothum
2019-07-18 13:03 ` Igor Mammedov
2019-07-22 14:15 ` Shameerali Kolothum Thodi
2019-07-23 12:46 ` Igor Mammedov [this message]
2019-07-16 15:38 ` [Qemu-devel] [PATCH-for-4.2 v7 10/10] tests: Update DSDT ACPI table for arm/virt board with PCDIMM related changes Shameer Kolothum
2019-07-18 13:13 ` Igor Mammedov
2019-07-22 14:51 ` Shameerali Kolothum Thodi
2019-07-23 12:58 ` 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=20190723144650.4644ffb5@redhat.com \
--to=imammedo@redhat.com \
--cc=ard.biesheuvel@linaro.org \
--cc=eric.auger@redhat.com \
--cc=lersek@redhat.com \
--cc=linuxarm@huawei.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sameo@linux.intel.com \
--cc=sebastien.boeuf@intel.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=shannon.zhaosl@gmail.com \
--cc=xuwei5@huawei.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 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).