hw/i386: fix acpi tables generation for big endian machines
PATCH 1/1 hw/i386: fix acpi tables generation for big endian machines
The acpi tables are not corrected loaded into guest's memory for big-endian hosts because of a linker-loader field swapped incorrectly. Fixed that.
Signed-off-by Marcel Apfelbaum <[email protected]>
---
Note that the acpi test still fails because of
an iasl issue, I will send a patch separately
that disables disassembly validation for big
endian machines until we'll have an iasl fix.
hw/i386/bios-linker-loader.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
hw/i386/bios-linker-loader.c +2 -3
@@ -109,9 +109,8 @@ void bios_linker_loader_alloc(GArray *linker,strncpy (entry.alloc.file, file,sizeof entry.alloc.file -1 ); entry.command =cpu_to_le32 (BIOS_LINKER_LOADER_COMMAND_ALLOCATE ); entry.alloc.align =cpu_to_le32 (alloc_align); - entry.alloc.zone =cpu_to_le32 (alloc_fseg ? -BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG : -BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH ); + entry.alloc.zone = alloc_fseg ?BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG : +BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH ;/* Alloc entries must come first, so prepend them */ g_array_prepend_vals (linker, &entry,sizeof entry);
Signature · 1 line
1.8.3.1
Michael S. Tsirkin
AppliedQuoted 5 lines · Marcel Apfelbaum
The acpi tables are not corrected loaded into guest's memory for big-endian hosts because of a linker-loader field swapped incorrectly. Fixed that.
Signed-off-by Marcel Apfelbaum <[email protected]>
Applied, thanks!
Quoted 27 lines
---
Note that the acpi test still fails because of
an iasl issue, I will send a patch separately
that disables disassembly validation for big
endian machines until we'll have an iasl fix.hw/i386/bios-linker-loader.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)hw/i386/bios-linker-loader.c +2
-3@@ -109,9 +109,8 @@ void bios_linker_loader_alloc(GArray *linker,strncpy (entry.alloc.file, file,sizeof entry.alloc.file -1 ); entry.command =cpu_to_le32 (BIOS_LINKER_LOADER_COMMAND_ALLOCATE ); entry.alloc.align =cpu_to_le32 (alloc_align); - entry.alloc.zone =cpu_to_le32 (alloc_fseg ? -BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG : -BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH ); + entry.alloc.zone = alloc_fseg ?BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG : +BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH ;/* Alloc entries must come first, so prepend them */ g_array_prepend_vals (linker, &entry,sizeof entry);Signature · 1 line
1.8.3.1