- Introduce the SM4 cipher algorithms (OSCCA GB/T 32907-2016).
- intel_iommu: Add missed sanity check for 256-bit invalidation queue
- linux-user: use 'max' instead of 'qemu32' / 'qemu64' by default
- chardev/baum: Use definitions to avoid dynamic stack allocation
- ui/console: Get tab completion working again in the SDL monitor vc
- s390x/tcg: Fix opcode for lzrf
- virtiofsd: use g_date_time_get_microsecond to get subsecond
- ui/curses: Avoid dynamic stack allocation
- target/m68k: always call gen_exit_tb() after writes to SR
- target/m68k: Perform writback before modifying SR
- target/m68k: Fix MACSR to CCR
- target/m68k: Implement atomic test-and-set
- block/nvme: nvme_process_completion() fix bound for cid
- hw/pci-host: pnv_phb{3, 4}: Fix heap out-of-bound access failure
- target/ppc: Zero second doubleword of VSR registers for FPR insns
- target/ppc: Set OV32 when OV is set
- target/ppc: Zero second doubleword for VSX madd instructions
- target/ppc: Set result to QNaN for DENBCD when VXCVI occurs
- hw/pci: Add parenthesis to PCI_BUILD_BDF macro
- intel_iommu: Send IQE event when setting reserved bit in IQT_TAIL
- acpi: cpuhp: fix guest-visible maximum access size to the legacy reg block
- acpi: ged: Add macro for acpi sleep control register
- hw/pci-bridge: Add a Kconfig switch for the normal PCI bridge
- ui/vnc: fix handling of VNC_FEATURE_XVP
- s390/sclp: fix SCLP facility map
- docs/tools/qemu-img.rst: fix typo (sumarizes)
- chardev/char: fix qemu_chr_is_busy() check
- edu: fix DMA range upper bound check
- platform-bus: fix refcount leak
- hw/net/virtio-net: fix qemu set used ring flag even vhost started
- hw/net/can/sja1000: fix bug for single acceptance filter and standard frame
- tests/avocado: fix typo in replay_linux
- util/userfaultfd: Remove unused uffd_poll_events
- hw/core/ptimer: fix timer zero period condition for freq > 1GHz
- hcd-ohci: Drop ohci_service_iso_td() if ed->head & OHCI_DPTR_MASK is zero
- tests/unit/test-vmstate: Avoid dynamic stack allocation
- hw/usb/hcd-ohci: Use definition to avoid dynamic stack allocation
- hw/i386/multiboot: Avoid dynamic stack allocation
- hw/ppc/spapr: Fix code style problems reported by checkpatch
- chardev/baum: Replace magic values by X_MAX / Y_MAX definitions
- hw/intc/xics: Avoid dynamic stack allocation
- hw/net/e1000e_core: Use definition to avoid dynamic stack allocation
- intel_iommu: Fix invalidation descriptor type field
- configs: Fix typo in the sh4-softmmu devices config file
Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com>
(cherry picked from commit 9813ed21ec2499c50cb58ac5fb114a1641708eb2)
60 lines
2.5 KiB
Diff
60 lines
2.5 KiB
Diff
From 865e7df2b0c8dd7fa026350f9f4d0a4e1063f0a5 Mon Sep 17 00:00:00 2001
|
|
From: Zhang Jiao <zhangjiao2_yewu@cmss.chinamobile.com>
|
|
Date: Wed, 23 Oct 2024 14:43:08 +0800
|
|
Subject: [PATCH] acpi: ged: Add macro for acpi sleep control register
|
|
|
|
cheery-pick from edafc90ba481c586d0a649f34dcb8cd1f29c4259
|
|
|
|
Macro definition is added for acpi sleep control register, ged emulation
|
|
driver can use the macro , also it can be used in FDT table if ged is
|
|
exposed with FDT table.
|
|
|
|
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
|
|
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
|
|
Message-Id: <20240918014206.2165821-2-maobibo@loongson.cn>
|
|
Signed-off-by: Song Gao <gaosong@loongson.cn>
|
|
Signed-off-by: Zhang Jiao <zhangjiao2_yewu@cmss.chinamobile.com>
|
|
---
|
|
hw/acpi/generic_event_device.c | 6 +++---
|
|
include/hw/acpi/generic_event_device.h | 7 +++++--
|
|
2 files changed, 8 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c
|
|
index 9118681662..9daf4f9f13 100644
|
|
--- a/hw/acpi/generic_event_device.c
|
|
+++ b/hw/acpi/generic_event_device.c
|
|
@@ -201,9 +201,9 @@ static void ged_regs_write(void *opaque, hwaddr addr, uint64_t data,
|
|
|
|
switch (addr) {
|
|
case ACPI_GED_REG_SLEEP_CTL:
|
|
- slp_typ = (data >> 2) & 0x07;
|
|
- slp_en = (data >> 5) & 0x01;
|
|
- if (slp_en && slp_typ == 5) {
|
|
+ slp_typ = (data >> ACPI_GED_SLP_TYP_POS) & ACPI_GED_SLP_TYP_MASK;
|
|
+ slp_en = !!(data & ACPI_GED_SLP_EN);
|
|
+ if (slp_en && slp_typ == ACPI_GED_SLP_TYP_S5) {
|
|
qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
|
|
}
|
|
return;
|
|
diff --git a/include/hw/acpi/generic_event_device.h b/include/hw/acpi/generic_event_device.h
|
|
index 6bb2ade385..95ade521e9 100644
|
|
--- a/include/hw/acpi/generic_event_device.h
|
|
+++ b/include/hw/acpi/generic_event_device.h
|
|
@@ -83,8 +83,11 @@ OBJECT_DECLARE_SIMPLE_TYPE(AcpiGedState, ACPI_GED)
|
|
/* ACPI_GED_REG_RESET value for reset*/
|
|
#define ACPI_GED_RESET_VALUE 0x42
|
|
|
|
-/* ACPI_GED_REG_SLEEP_CTL.SLP_TYP value for S5 (aka poweroff) */
|
|
-#define ACPI_GED_SLP_TYP_S5 0x05
|
|
+/* [ACPI 5.0 Chapter 4.8.3.7] Sleep Control and Status Register */
|
|
+#define ACPI_GED_SLP_TYP_POS 0x2 /* SLP_TYPx Bit Offset */
|
|
+#define ACPI_GED_SLP_TYP_MASK 0x07 /* SLP_TYPx 3-bit mask */
|
|
+#define ACPI_GED_SLP_TYP_S5 0x05 /* System _S5 State (Soft Off) */
|
|
+#define ACPI_GED_SLP_EN 0x20 /* SLP_EN write-only bit */
|
|
|
|
#define GED_DEVICE "GED"
|
|
#define AML_GED_EVT_REG "EREG"
|
|
--
|
|
2.41.0.windows.1
|
|
|