From: Igor Mammedov <imammedo@redhat.com>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: qemu-devel@nongnu.org, Ani Sinha <anisinha@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Song Gao <gaosong@loongson.cn>,
Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
Eduardo Habkost <eduardo@habkost.net>,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
Sergio Lopez <slp@redhat.com>
Subject: Re: [PATCH 2/3] hw/loongarch/virt: Wire up S3 and S4 sleep
Date: Thu, 25 Jul 2024 10:26:43 +0200 [thread overview]
Message-ID: <20240725102643.498a0192@imammedo.users.ipa.redhat.com> (raw)
In-Reply-To: <20240613-loongarch64-sleep-v1-2-d2ef0aaa543a@flygoat.com>
On Thu, 13 Jun 2024 18:30:16 +0100
Jiaxun Yang <jiaxun.yang@flygoat.com> wrote:
> Wire up S3 and S4 sleep by setting relevant slp-typs bits for
> GED and generate _S3 and _S4 methods in acpi table.
>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
> hw/loongarch/acpi-build.c | 18 ++++++++++++++++++
> hw/loongarch/virt.c | 3 +++
> 2 files changed, 21 insertions(+)
>
> diff --git a/hw/loongarch/acpi-build.c b/hw/loongarch/acpi-build.c
> index af45ce526d6e..2cb1696b579b 100644
> --- a/hw/loongarch/acpi-build.c
> +++ b/hw/loongarch/acpi-build.c
> @@ -416,6 +416,24 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, MachineState *machine)
> acpi_dsdt_add_tpm(dsdt, lvms);
> #endif
> /* System State Package */
> + scope = aml_scope("\\");
> + pkg = aml_package(4);
> + aml_append(pkg, aml_int(ACPI_GED_SLP_TYP_S3));
> + aml_append(pkg, aml_int(0)); /* ignored */
> + aml_append(pkg, aml_int(0)); /* reserved */
> + aml_append(pkg, aml_int(0)); /* reserved */
> + aml_append(scope, aml_name_decl("_S3", pkg));
> + aml_append(dsdt, scope);
> +
> + scope = aml_scope("\\");
> + pkg = aml_package(4);
> + aml_append(pkg, aml_int(ACPI_GED_SLP_TYP_S4));
> + aml_append(pkg, aml_int(0)); /* ignored */
> + aml_append(pkg, aml_int(0)); /* reserved */
> + aml_append(pkg, aml_int(0)); /* reserved */
> + aml_append(scope, aml_name_decl("_S4", pkg));
> + aml_append(dsdt, scope);
if it's the same in both patches, I'd suggest to move it
in helper function in hw/acpi/generic_event_device.c
and call that here.
> scope = aml_scope("\\");
> pkg = aml_package(4);
> aml_append(pkg, aml_int(ACPI_GED_SLP_TYP_S5));
> diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
> index 66cef201abe0..a4b55f00a32b 100644
> --- a/hw/loongarch/virt.c
> +++ b/hw/loongarch/virt.c
> @@ -615,6 +615,9 @@ static DeviceState *create_acpi_ged(DeviceState *pch_pic,
> }
> dev = qdev_new(TYPE_ACPI_GED);
> qdev_prop_set_uint32(dev, "ged-event", event);
> + qdev_prop_set_uint32(dev, "slp-typs", (1 << ACPI_GED_SLP_TYP_S3) |
> + (1 << ACPI_GED_SLP_TYP_S4) |
> + (1 << ACPI_GED_SLP_TYP_S5));
drop this, it should be default,
and backward compatibility for versioned machine types,
should be handled by compat machinery
> sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
>
> /* ged event */
>
next prev parent reply other threads:[~2024-07-25 8:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-13 17:30 [PATCH 0/3] S3 and S4 sleep for loongarch/virt & microvm Jiaxun Yang
2024-06-13 17:30 ` [PATCH 1/3] acpi/ged: Implement S3 and S4 sleep Jiaxun Yang
2024-07-01 20:19 ` Michael S. Tsirkin
2024-07-25 8:22 ` Igor Mammedov
2024-07-25 8:30 ` Michael S. Tsirkin
2024-07-25 8:54 ` Igor Mammedov
2024-06-13 17:30 ` [PATCH 2/3] hw/loongarch/virt: Wire up " Jiaxun Yang
2024-07-25 8:26 ` Igor Mammedov [this message]
2024-06-13 17:30 ` [PATCH 3/3] hw/i386/microvm: " Jiaxun Yang
2024-06-14 3:32 ` [PATCH 0/3] S3 and S4 sleep for loongarch/virt & microvm maobibo
2024-06-14 4:27 ` Jiaxun Yang
2024-06-14 5:17 ` maobibo
2024-06-14 13:55 ` Jiaxun Yang
2024-06-14 14:03 ` Daniel P. Berrangé
2024-06-15 1:45 ` maobibo
2024-07-25 7:52 ` Igor Mammedov
2024-07-25 8:29 ` 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=20240725102643.498a0192@imammedo.users.ipa.redhat.com \
--to=imammedo@redhat.com \
--cc=anisinha@redhat.com \
--cc=eduardo@habkost.net \
--cc=gaosong@loongson.cn \
--cc=jiaxun.yang@flygoat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=slp@redhat.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).