cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From aa98e5248b83b5eed5230e582a21156373d9fc72 Mon Sep 17 00:00:00 2001
9ae3a8
From: Laszlo Ersek <lersek@redhat.com>
9ae3a8
Date: Wed, 13 Aug 2014 07:59:41 +0200
9ae3a8
Subject: [PATCH 04/11] acpi: fix tables for no-hpet configuration
9ae3a8
9ae3a8
Message-id: <1407916781-22610-2-git-send-email-lersek@redhat.com>
9ae3a8
Patchwork-id: 60549
9ae3a8
O-Subject: [RHEL-7.1 qemu-kvm PATCH 1/1] acpi: fix tables for no-hpet configuration
9ae3a8
Bugzilla: 1129552
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
9ae3a8
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
9ae3a8
9ae3a8
From: "Michael S. Tsirkin" <mst@redhat.com>
9ae3a8
9ae3a8
acpi build tried to add offset of hpet table to rsdt even when hpet was
9ae3a8
disabled.  If no tables follow hpet, this could lead to a malformed
9ae3a8
rsdt.
9ae3a8
9ae3a8
Fix it up.
9ae3a8
9ae3a8
To avoid such errors in the future, rearrange code slightly to make it
9ae3a8
clear that acpi_add_table stores the offset of the following table - not
9ae3a8
of the previous one.
9ae3a8
9ae3a8
Reported-by: TeLeMan <geleman@gmail.com>
9ae3a8
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9ae3a8
Cc: qemu-stable@nongnu.org
9ae3a8
(cherry picked from commit 9ac1c4c07e7e6ab16a3e2149e9b32c0d092cb3f5)
9ae3a8
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
---
9ae3a8
 hw/i386/acpi-build.c | 7 ++++---
9ae3a8
 1 file changed, 4 insertions(+), 3 deletions(-)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 hw/i386/acpi-build.c |    7 ++++---
9ae3a8
 1 files changed, 4 insertions(+), 3 deletions(-)
9ae3a8
9ae3a8
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
9ae3a8
index 33012c9..8be1286 100644
9ae3a8
--- a/hw/i386/acpi-build.c
9ae3a8
+++ b/hw/i386/acpi-build.c
9ae3a8
@@ -1076,15 +1076,16 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
9ae3a8
     /* ACPI tables pointed to by RSDT */
9ae3a8
     acpi_add_table(table_offsets, tables->table_data);
9ae3a8
     build_fadt(tables->table_data, tables->linker, &pm, facs, dsdt);
9ae3a8
-    acpi_add_table(table_offsets, tables->table_data);
9ae3a8
 
9ae3a8
+    acpi_add_table(table_offsets, tables->table_data);
9ae3a8
     build_ssdt(tables->table_data, tables->linker, &cpu, &pm, &misc, &pci,
9ae3a8
                guest_info);
9ae3a8
-    acpi_add_table(table_offsets, tables->table_data);
9ae3a8
 
9ae3a8
-    build_madt(tables->table_data, tables->linker, &cpu, guest_info);
9ae3a8
     acpi_add_table(table_offsets, tables->table_data);
9ae3a8
+    build_madt(tables->table_data, tables->linker, &cpu, guest_info);
9ae3a8
+
9ae3a8
     if (misc.has_hpet) {
9ae3a8
+        acpi_add_table(table_offsets, tables->table_data);
9ae3a8
         build_hpet(tables->table_data, tables->linker);
9ae3a8
     }
9ae3a8
     if (guest_info->numa_nodes) {
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8