From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 0/8] Add system_powerdown support on ARM for ACPI and DT
Date: Tue, 1 Dec 2015 14:43:44 +0100 [thread overview]
Message-ID: <20151201144344.27d27a0e@nial.brq.redhat.com> (raw)
In-Reply-To: <1447680189-2128-1-git-send-email-shannon.zhao@linaro.org>
On Mon, 16 Nov 2015 21:23:01 +0800
shannon.zhao@linaro.org wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
>
> ACPI SPEC 5.0 defines GPIO-signaled ACPI Events for Hardware-reduced
> platforms(like ARM). It uses GPIO pin to trigger an event to the guest.
> For QEMU, here we add PL061 GPIO controller and use PIN 3 for
> system_powerdown, reserving PIN 0, 1, 2 for PCI hotplug, CPU hotplug and
> memory hotplug.
>
> This patchset adds system_powerdown support on ARM through both ACPI and
> DT ways. It adds a GPIO controller(here is PL061) in machine virt and
> uses GPIO-singled event for ACPI while gpio-keys for DT. It can be
> fetched from [1] and has been tested for the guests starting by ACPI or
> DT while guests use systemd or acpid.
>
> a) ACPI way. Since Graeme send a patchset to make ACPI on ARM64 support
> amba device[2], it could use PL061 directly without modification to its
> kernel driver code. In addition, we should use ACPI to start VM,
> referring to below script. QEMU_EFI.fd can be fetched from [3].
I'd rearrange/merge ACPI related patches in following order:
1. put new aml_foo() patches before adding any DSDT bits
2. add PWRB device as it doesn't have any dependencies
3. merge all GP00 patches in one and add it to DSDT,
that way it's easier to read what patches do
[...]
> Guest internal setup:
> If your guest FS uses systemd, you should check file
> /lib/udev/rules.d/70-power-switch.rules and add the following line in it
> if it doesn't exist.
>
> SUBSYSTEM=="input", KERNEL=="event*", SUBSYSTEMS=="platform",
> ATTRS{keys}=="116", TAG+="power-switch"
Could you tell me, what method is used to power off QEMU?
From ACPI SPEC it should be possible to use
SLEEP_{CONTROL|STATUS}_REG and \_S5 for hw-reduced mode to
implement shutdown in a standard way but QEMU doesn't implement it
for ARM target and I'm not sure if linux kernel would support it either.
>
> If your guest FS uses acpid, you should check it has
> /etc/acpi/powerbtn.sh and /etc/acpi/events/powerbtn. Refer to [4] for
> the setup of acpid.
>
> Thanks,
> Shannon
>
> [1] https://git.linaro.org/people/shannon.zhao/qemu.git/shortlog/refs/heads/PowerButton_v2
> [2] https://lkml.org/lkml/2015/9/30/392
> [3] http://people.linaro.org/~shannon.zhao/ACPI_ARM/QEMU_EFI.fd
> [4] https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/GPIOPowerButton
>
> Changes since v2:
> * rebased on upstream QEMU
> * adjust irq signalling for PowerButton of PATCH 7/8 (Peter Maydell)
> * Add several Reviewed-bys and Tested-bys from Wei Huang, thanks!
>
> Changes since v1:
> * rewrite GPIO Connection Descriptor (Michael)
>
> Shannon Zhao (8):
> hw/arm/virt: Add a GPIO controller
> hw/arm/virt-acpi-build: Add GPIO controller in ACPI DSDT table
> hw/arm/virt-acpi-build: Add power button device in ACPI DSDT table
> hw/acpi/aml-build: Add GPIO Connection Descriptor
> hw/acpi/aml-build: Add a wrapper for GPIO Interrupt Connection
> hw/arm/virt-acpi-build: Add _E03 for Power Button
> hw/arm/virt: Add QEMU powerdown notifier and hook it to GPIO Pin 3
> hw/arm/virt: Add gpio-keys node for Poweroff using DT
>
> hw/acpi/aml-build.c | 79 +++++++++++++++++++++++++++++++++++++++++++++
> hw/arm/virt-acpi-build.c | 45 ++++++++++++++++++++++++++
> hw/arm/virt.c | 59 +++++++++++++++++++++++++++++++++
> include/hw/acpi/aml-build.h | 26 +++++++++++++++
> include/hw/arm/virt.h | 1 +
> 5 files changed, 210 insertions(+)
>
prev parent reply other threads:[~2015-12-01 13:43 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-16 13:23 [Qemu-devel] [PATCH v3 0/8] Add system_powerdown support on ARM for ACPI and DT shannon.zhao
2015-11-16 13:23 ` [Qemu-devel] [PATCH v3 1/8] hw/arm/virt: Add a GPIO controller shannon.zhao
2015-12-01 13:21 ` Igor Mammedov
2015-12-01 13:49 ` Peter Maydell
2015-12-01 14:48 ` Pavel Fedin
2015-12-01 15:25 ` Shannon Zhao
2015-12-01 15:29 ` Wei Huang
2015-12-02 9:39 ` [Qemu-devel] [Qemu-arm] " Pavel Fedin
2015-11-16 13:23 ` [Qemu-devel] [PATCH v3 2/8] hw/arm/virt-acpi-build: Add GPIO controller in ACPI DSDT table shannon.zhao
2015-11-16 13:23 ` [Qemu-devel] [PATCH v3 3/8] hw/arm/virt-acpi-build: Add power button device " shannon.zhao
2015-12-01 11:41 ` Igor Mammedov
2015-12-01 12:43 ` Shannon Zhao
2015-12-01 13:05 ` Igor Mammedov
2015-12-01 13:12 ` Shannon Zhao
2015-11-16 13:23 ` [Qemu-devel] [PATCH v3 4/8] hw/acpi/aml-build: Add GPIO Connection Descriptor shannon.zhao
2015-12-03 15:15 ` Igor Mammedov
2015-11-16 13:23 ` [Qemu-devel] [PATCH v3 5/8] hw/acpi/aml-build: Add a wrapper for GPIO Interrupt Connection shannon.zhao
2015-12-03 15:34 ` Igor Mammedov
2015-12-03 15:37 ` Igor Mammedov
2015-11-16 13:23 ` [Qemu-devel] [PATCH v3 6/8] hw/arm/virt-acpi-build: Add _E03 for Power Button shannon.zhao
2015-12-04 14:10 ` Igor Mammedov
2015-12-07 7:10 ` Shannon Zhao
2015-11-16 13:23 ` [Qemu-devel] [PATCH v3 7/8] hw/arm/virt: Add QEMU powerdown notifier and hook it to GPIO Pin 3 shannon.zhao
2015-11-16 13:23 ` [Qemu-devel] [PATCH v3 8/8] hw/arm/virt: Add gpio-keys node for Poweroff using DT shannon.zhao
2015-11-27 17:16 ` Peter Maydell
2015-11-28 3:06 ` Shannon Zhao
2015-11-17 1:37 ` [Qemu-devel] [PATCH v3 0/8] Add system_powerdown support on ARM for ACPI and DT Shannon Zhao
2015-12-01 13:43 ` Igor Mammedov [this message]
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=20151201144344.27d27a0e@nial.brq.redhat.com \
--to=imammedo@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).