Skip to contentSkip to conversation

apci: fix ACPI tables for -no-hpet option

PATCH In review Marcel Apfelbaum 2 participants 3 messages May 8, 2014 – May 15, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 apci: fix ACPI tables for -no-hpet option

A wrong offset was added to the tables pointed by RSDT if the HPET table is not present.

---
 hw/i386/acpi-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/acpi-build.c +1 -1
index c98df88..d65fab0 100644
@@ -1417,8 +1417,8 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
     acpi_add_table(table_offsets, tables->table_data);
 
     build_madt(tables->table_data, tables->linker, &cpu, guest_info);
-    acpi_add_table(table_offsets, tables->table_data);
     if (misc.has_hpet) {
+        acpi_add_table(table_offsets, tables->table_data);
         build_hpet(tables->table_data, tables->linker);
     }
     if (guest_info->numa_nodes) {
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · On Thu, 8 May 2014 15:58:40 +0300 Marcel Apfelbaum <[email protected]> wrote:

A wrong offset was added to the tables pointed by RSDT if the HPET table is not present.

---
 hw/i386/acpi-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/acpi-build.c +0 -0
index c98df88..d65fab0 100644

hw/i386/acpi-build.c void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables) · line 1424

Quoted 9 lines
hw/i386/acpi-build.c +1 -1
@@ -1417,8 +1417,8 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
     acpi_add_table(table_offsets, tables->table_data);
 
     build_madt(tables->table_data, tables->linker, &cpu, guest_info);
-    acpi_add_table(table_offsets, tables->table_data);
     if (misc.has_hpet) {
+        acpi_add_table(table_offsets, tables->table_data);
         build_hpet(tables->table_data, tables->linker);
     }
     if (guest_info->numa_nodes) {
#2 lore raw
Quoted 18 lines · Igor Mammedov
Quoted 15 lines · On Thu, 8 May 2014 15:58:40 +0300 Marcel Apfelbaum <[email protected]> wrote:

A wrong offset was added to the tables pointed by RSDT if the HPET table is not present.

---
 hw/i386/acpi-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/acpi-build.c +0 -0
index c98df88..d65fab0 100644
@@ -1417,8 +1417,8 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
     acpi_add_table(table_offsets, tables->table_data);
 
Quoted 9 lines

hw/i386/acpi-build.c void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables) · line 1424

Quoted 7 lines
hw/i386/acpi-build.c +1 -1
     build_madt(tables->table_data, tables->linker, &cpu, guest_info);
-    acpi_add_table(table_offsets, tables->table_data);
     if (misc.has_hpet) {
+        acpi_add_table(table_offsets, tables->table_data);
         build_hpet(tables->table_data, tables->linker);
     }
     if (guest_info->numa_nodes) {

Hi Igor,

Thanks for the review, but Michael beat me and pushed a fix sooner :) Marcel