cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-pc-set-the-OEM-fields-in-the-RSDT-and-the-FADT-from-.patch

34b321
From 607904cf94b1dee91c74522aedebda308ffba93d Mon Sep 17 00:00:00 2001
34b321
From: Laszlo Ersek <lersek@redhat.com>
34b321
Date: Wed, 11 May 2016 12:33:48 +0200
34b321
Subject: [PATCH 09/10] pc: set the OEM fields in the RSDT and the FADT from
34b321
 the SLIC
34b321
34b321
RH-Author: Laszlo Ersek <lersek@redhat.com>
34b321
Message-id: <1462970028-10959-8-git-send-email-lersek@redhat.com>
34b321
Patchwork-id: 70384
34b321
O-Subject: [RHEL-7.3 qemu-kvm PATCH v2 7/7] pc: set the OEM fields in the RSDT and the FADT from the SLIC
34b321
Bugzilla: 1330969
34b321
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
34b321
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
34b321
RH-Acked-by: Thomas Huth <thuth@redhat.com>
34b321
34b321
The Microsoft spec about the SLIC and MSDM ACPI tables at
34b321
<http://go.microsoft.com/fwlink/p/?LinkId=234834> requires the OEM ID and
34b321
OEM Table ID fields to be consistent between the SLIC and the RSDT/XSDT.
34b321
That further affects the FADT, because a similar match between the FADT
34b321
and the RSDT/XSDT is required by the ACPI spec in general.
34b321
34b321
This patch wires up the previous three patches.
34b321
34b321
Cc: "Michael S. Tsirkin" <mst@redhat.com> (supporter:ACPI/SMBIOS)
34b321
Cc: Igor Mammedov <imammedo@redhat.com> (supporter:ACPI/SMBIOS)
34b321
Cc: Paolo Bonzini <pbonzini@redhat.com> (maintainer:X86)
34b321
Cc: Richard W.M. Jones <rjones@redhat.com>
34b321
Cc: Aleksei Kovura <alex3kov@zoho.com>
34b321
Cc: Michael Tokarev <mjt@tls.msk.ru>
34b321
Cc: Steven Newbury <steve@snewbury.org.uk>
34b321
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1248758
34b321
LP: https://bugs.launchpad.net/qemu/+bug/1533848
34b321
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
34b321
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
34b321
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
34b321
Reviewed-by: Steven Newbury <steve@snewbury.org.uk>
34b321
(cherry picked from commit ae12374951f07157f7a52c8d848b90f8eec722fb)
34b321
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
34b321
34b321
Conflicts:
34b321
	hw/i386/acpi-build.c
34b321
34b321
RHEL-7 backport note: conflict due to downstream lacking 7c2c1fa5f428
34b321
("pc: acpi: use local var for accessing ACPI tables blob in
34b321
acpi_build()").
34b321
34b321
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
34b321
---
34b321
 hw/i386/acpi-build.c | 13 +++++++++----
34b321
 qemu-options.hx      |  4 ++++
34b321
 2 files changed, 13 insertions(+), 4 deletions(-)
34b321
---
34b321
 hw/i386/acpi-build.c | 13 +++++++++----
34b321
 qemu-options.hx      |  4 ++++
34b321
 2 files changed, 13 insertions(+), 4 deletions(-)
34b321
34b321
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
34b321
index d9433e6..85291f5 100644
34b321
--- a/hw/i386/acpi-build.c
34b321
+++ b/hw/i386/acpi-build.c
34b321
@@ -511,7 +511,8 @@ static void fadt_setup(AcpiFadtDescriptorRev1 *fadt, AcpiPmInfo *pm)
34b321
 /* FADT */
34b321
 static void
34b321
 build_fadt(GArray *table_data, GArray *linker, AcpiPmInfo *pm,
34b321
-           unsigned facs, unsigned dsdt)
34b321
+           unsigned facs, unsigned dsdt,
34b321
+           const char *oem_id, const char *oem_table_id)
34b321
 {
34b321
     AcpiFadtDescriptorRev1 *fadt = acpi_data_push(table_data, sizeof(*fadt));
34b321
 
34b321
@@ -532,7 +533,7 @@ build_fadt(GArray *table_data, GArray *linker, AcpiPmInfo *pm,
34b321
     fadt_setup(fadt, pm);
34b321
 
34b321
     build_header(linker, table_data,
34b321
-                 (void *)fadt, "FACP", sizeof(*fadt), 1, NULL, NULL);
34b321
+                 (void *)fadt, "FACP", sizeof(*fadt), 1, oem_id, oem_table_id);
34b321
 }
34b321
 
34b321
 static void
34b321
@@ -1065,6 +1066,7 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
34b321
     AcpiMcfgInfo mcfg;
34b321
     PcPciInfo pci;
34b321
     uint8_t *u;
34b321
+    AcpiSlicOem slic_oem = { .id = NULL, .table_id = NULL };
34b321
 
34b321
     acpi_get_cpu_info(&cpu);
34b321
     acpi_get_pm_info(&pm);
34b321
@@ -1072,6 +1074,7 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
34b321
     acpi_get_hotplug_info(&misc);
34b321
     acpi_get_misc_info(&misc);
34b321
     acpi_get_pci_info(&pci;;
34b321
+    acpi_get_slic_oem(&slic_oem);
34b321
 
34b321
     table_offsets = g_array_new(false, true /* clear */,
34b321
                                         sizeof(uint32_t));
34b321
@@ -1095,7 +1098,8 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
34b321
 
34b321
     /* ACPI tables pointed to by RSDT */
34b321
     acpi_add_table(table_offsets, tables->table_data);
34b321
-    build_fadt(tables->table_data, tables->linker, &pm, facs, dsdt);
34b321
+    build_fadt(tables->table_data, tables->linker, &pm, facs, dsdt,
34b321
+               slic_oem.id, slic_oem.table_id);
34b321
 
34b321
     acpi_add_table(table_offsets, tables->table_data);
34b321
     build_ssdt(tables->table_data, tables->linker, &cpu, &pm, &misc, &pci,
34b321
@@ -1127,7 +1131,8 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
34b321
 
34b321
     /* RSDT is pointed to by RSDP */
34b321
     rsdt = tables->table_data->len;
34b321
-    build_rsdt(tables->table_data, tables->linker, table_offsets, NULL, NULL);
34b321
+    build_rsdt(tables->table_data, tables->linker, table_offsets,
34b321
+               slic_oem.id, slic_oem.table_id);
34b321
 
34b321
     /* RSDP is in FSEG memory, so allocate it separately */
34b321
     build_rsdp(tables->rsdp, tables->linker, rsdt);
34b321
diff --git a/qemu-options.hx b/qemu-options.hx
34b321
index 62c3e06..24ffab6 100644
34b321
--- a/qemu-options.hx
34b321
+++ b/qemu-options.hx
34b321
@@ -1295,6 +1295,10 @@ ACPI headers (possible overridden by other options).
34b321
 For data=, only data
34b321
 portion of the table is used, all header information is specified in the
34b321
 command line.
34b321
+If a SLIC table is supplied to QEMU, then the SLIC's oem_id and oem_table_id
34b321
+fields will override the same in the RSDT and the FADT (a.k.a. FACP), in order
34b321
+to ensure the field matches required by the Microsoft SLIC spec and the ACPI
34b321
+spec.
34b321
 ETEXI
34b321
 
34b321
 DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
34b321
-- 
34b321
1.8.3.1
34b321