From patchwork Mon Jan 18 14:12:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 8054921 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0EDD0BEEE5 for ; Mon, 18 Jan 2016 14:15:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 192C820382 for ; Mon, 18 Jan 2016 14:15:35 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 45AA120303 for ; Mon, 18 Jan 2016 14:15:30 +0000 (UTC) Received: from localhost ([::1]:60018 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLAaf-0000vs-Ha for patchwork-qemu-devel@patchwork.kernel.org; Mon, 18 Jan 2016 09:15:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLAXo-0004gz-Ri for qemu-devel@nongnu.org; Mon, 18 Jan 2016 09:12:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLAXl-0002sA-IR for qemu-devel@nongnu.org; Mon, 18 Jan 2016 09:12:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLAXl-0002s5-B3 for qemu-devel@nongnu.org; Mon, 18 Jan 2016 09:12:29 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 11E8FC049D4F; Mon, 18 Jan 2016 14:12:29 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-77.phx2.redhat.com [10.3.113.77]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0IECHdx021325; Mon, 18 Jan 2016 09:12:27 -0500 From: Laszlo Ersek To: qemu-devel@nongnu.org Date: Mon, 18 Jan 2016 15:12:13 +0100 Message-Id: <1453126333-19474-5-git-send-email-lersek@redhat.com> In-Reply-To: <1453126333-19474-1-git-send-email-lersek@redhat.com> References: <1453126333-19474-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Aleksei Kovura , "Michael S. Tsirkin" , Steven Newbury , Michael Tokarev , "Richard W.M. Jones" , Paolo Bonzini , Igor Mammedov Subject: [Qemu-devel] [PATCH v2 4/4] pc: set the OEM fields in the RSDT and the FADT from the SLIC X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The Microsoft spec about the SLIC and MSDM ACPI tables at requires the OEM ID and OEM Table ID fields to be consistent between the SLIC and the RSDT/XSDT. That further affects the FADT, because a similar match between the FADT and the RSDT/XSDT is required by the ACPI spec in general. This patch wires up the previous three patches. Cc: "Michael S. Tsirkin" (supporter:ACPI/SMBIOS) Cc: Igor Mammedov (supporter:ACPI/SMBIOS) Cc: Paolo Bonzini (maintainer:X86) Cc: Richard W.M. Jones Cc: Aleksei Kovura Cc: Michael Tokarev Cc: Steven Newbury RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1248758 LP: https://bugs.launchpad.net/qemu/+bug/1533848 Signed-off-by: Laszlo Ersek --- Notes: v2: - rebase to new acpi_get_slic_oem() [MST] - drop machine type property to disable this behavior [MST] hw/i386/acpi-build.c | 13 +++++++++---- qemu-options.hx | 4 ++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 6408362..9a74284 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -337,7 +337,8 @@ static void fadt_setup(AcpiFadtDescriptorRev1 *fadt, AcpiPmInfo *pm) /* FADT */ static void build_fadt(GArray *table_data, GArray *linker, AcpiPmInfo *pm, - unsigned facs, unsigned dsdt) + unsigned facs, unsigned dsdt, + const char *oem_id, const char *oem_table_id) { AcpiFadtDescriptorRev1 *fadt = acpi_data_push(table_data, sizeof(*fadt)); @@ -358,7 +359,7 @@ build_fadt(GArray *table_data, GArray *linker, AcpiPmInfo *pm, fadt_setup(fadt, pm); build_header(linker, table_data, - (void *)fadt, "FACP", sizeof(*fadt), 1, NULL, NULL); + (void *)fadt, "FACP", sizeof(*fadt), 1, oem_id, oem_table_id); } static void @@ -2621,11 +2622,13 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables) uint8_t *u; size_t aml_len = 0; GArray *tables_blob = tables->table_data; + AcpiSlicOem slic_oem = { .id = NULL, .table_id = NULL }; acpi_get_cpu_info(&cpu); acpi_get_pm_info(&pm); acpi_get_misc_info(&misc); acpi_get_pci_info(&pci); + acpi_get_slic_oem(&slic_oem); table_offsets = g_array_new(false, true /* clear */, sizeof(uint32_t)); @@ -2654,7 +2657,8 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables) /* ACPI tables pointed to by RSDT */ acpi_add_table(table_offsets, tables_blob); - build_fadt(tables_blob, tables->linker, &pm, facs, dsdt); + build_fadt(tables_blob, tables->linker, &pm, facs, dsdt, + slic_oem.id, slic_oem.table_id); ssdt = tables_blob->len; acpi_add_table(table_offsets, tables_blob); @@ -2705,7 +2709,8 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables) /* RSDT is pointed to by RSDP */ rsdt = tables_blob->len; - build_rsdt(tables_blob, tables->linker, table_offsets, NULL, NULL); + build_rsdt(tables_blob, tables->linker, table_offsets, + slic_oem.id, slic_oem.table_id); /* RSDP is in FSEG memory, so allocate it separately */ build_rsdp(tables->rsdp, tables->linker, rsdt); diff --git a/qemu-options.hx b/qemu-options.hx index b4763ba..0ef79ee 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1472,6 +1472,10 @@ ACPI headers (possible overridden by other options). For data=, only data portion of the table is used, all header information is specified in the command line. +If a SLIC table is supplied to QEMU, then the SLIC's oem_id and oem_table_id +fields will override the same in the RSDT and the FADT (a.k.a. FACP), in order +to ensure the field matches required by the Microsoft SLIC spec and the ACPI +spec. ETEXI DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,