]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/loongarch/virt: Fix big endian support with MCFG table
authorBibo Mao <maobibo@loongson.cn>
Wed, 4 Jun 2025 06:55:01 +0000 (14:55 +0800)
committerSong Gao <gaosong@loongson.cn>
Tue, 10 Jun 2025 03:53:27 +0000 (11:53 +0800)
With API build_mcfg(), it is not necessary with parameter structure
AcpiMcfgInfo to convert to little endian since it is directly used
with host native endian.

Here remove endian conversion before calling function build_mcfg().
With this patch, bios-tables-test passes to run on big endian host
machine S390.

Fixes: 735143f10d3e ("hw/loongarch: Add acpi ged support")
Cc: qemu-stable@nongnu.org
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20250604065502.1114098-2-maobibo@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
hw/loongarch/virt-acpi-build.c

index 073b6de75ce43ffaf6ddb80c6af013bc92fb451e..2cd2d9d8424b494923b1cbae491a1d6e8d8a8be1 100644 (file)
@@ -575,8 +575,8 @@ static void acpi_build(AcpiBuildTables *tables, MachineState *machine)
     acpi_add_table(table_offsets, tables_blob);
     {
         AcpiMcfgInfo mcfg = {
-           .base = cpu_to_le64(VIRT_PCI_CFG_BASE),
-           .size = cpu_to_le64(VIRT_PCI_CFG_SIZE),
+           .base = VIRT_PCI_CFG_BASE,
+           .size = VIRT_PCI_CFG_SIZE,
         };
         build_mcfg(tables_blob, tables->linker, &mcfg, lvms->oem_id,
                    lvms->oem_table_id);