@samitouri / QOSamiQemu / commits / 15c73b0f17

hw/acpi: correct field sequence in SPCR table

On LoongArch and RISC-V invalid SPCR tables are created: Terminal Type : 00 Language : 03 The correct values are: Terminal Type : 03 Language : 00 This is due to commit 7dd0b070fa09 ("hw/arm/virt-acpi-build.c: Migrate SPCR creation to common location") that swapped the fields. See the specification of the table in https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/serial-port-console-redirection-table This page shows version 1.10. But the sequence of the fields was not changed since version 1.0. Our LoongArch and ARM code uses version 1.07 of the specification. Our RISC-V code uses version 1.10 of the specification. Fixes: 7dd0b070fa09 ("hw/arm/virt-acpi-build.c: Migrate SPCR creation to common location") Origin: https://lore.kernel.org/qemu-devel/20260326121947.51200-1-heinrich.schuchardt@canonical.com/T/#u Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2146419 Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20260705063147.199732-3-heinrich.schuchardt@canonical.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

Heinrich Schuchardt committed Jul 5, 2026 at 08:31 UTC 15c73b0f17d27956b47812124b646d52181517bf
1 file changed +2 -2
hw/acpi/aml-build.c
+2 -2
@@ -2144,10 +2144,10 @@ void build_spcr(GArray *table_data, BIOSLinker *linker,
2144 build_append_int_noprefix(table_data, f->stop_bits, 1);
2145 /* Flow Control */
2146 build_append_int_noprefix(table_data, f->flow_control, 1);
2147 - /* Language */
2148 - build_append_int_noprefix(table_data, f->language, 1);
2147 /* Terminal Type */
2148 build_append_int_noprefix(table_data, f->terminal_type, 1);
2149 + /* Language */
2150 + build_append_int_noprefix(table_data, f->language, 1);
2151 /* PCI Device ID */
2152 build_append_int_noprefix(table_data, f->pci_device_id, 2);
2153 /* PCI Vendor ID */