acpi_send_gpe_events() sends events encoded in the AcpiEventStatusBits enum. The maximum bit used so far in the latter was 128, hence a single byte (ACPIGPE.sts[0]) is currently enough to hold the set bits.
When we add an extra one, we will need a second byte to encode the state and casting from AcpiEventStatusBits to uint8_t will silently ignore the higher bits. Fix this, by taking into account the length value inside ACPIGPE. Signed-off-by: Babis Chalios <[email protected]> --- hw/acpi/core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/acpi/core.c b/hw/acpi/core.c index ff16582803..48694eca54 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -730,7 +730,13 @@ uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t addr) void acpi_send_gpe_event(ACPIREGS *ar, qemu_irq irq, AcpiEventStatusBits status) { - ar->gpe.sts[0] |= status; + int i; + + for (i = 0; i < ar->gpe.len; i++) { + ar->gpe.sts[i] |= (status & 0xff); + status >>= 8; + } + acpi_update_sci(ar, irq); } -- 2.34.1
