From nobody Tue Oct 28 01:55:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515506381526570.4862794936224; Tue, 9 Jan 2018 05:59:41 -0800 (PST) Received: from localhost ([::1]:54197 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYuR9-0005wX-2c for importer@patchew.org; Tue, 09 Jan 2018 08:59:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYuQ2-0005DR-G2 for qemu-devel@nongnu.org; Tue, 09 Jan 2018 08:58:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYuPy-0007W1-JV for qemu-devel@nongnu.org; Tue, 09 Jan 2018 08:58:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58934) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eYuPy-0007VW-E0 for qemu-devel@nongnu.org; Tue, 09 Jan 2018 08:58:18 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 283DE5BEBC; Tue, 9 Jan 2018 13:58:17 +0000 (UTC) Received: from redhat.com (ovpn-122-189.rdu2.redhat.com [10.10.122.189]) by smtp.corp.redhat.com (Postfix) with SMTP id 7222081187; Tue, 9 Jan 2018 13:58:12 +0000 (UTC) Date: Tue, 9 Jan 2018 15:58:11 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1515506288-32291-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 09 Jan 2018 13:58:17 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] acpi: switch to a dummy SSDT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Igor Mammedov , Richard Henderson , Eduardo Habkost , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" We prefer not changing table sizes depending on parameters, that's why we create a dummy table rather than just drop the MCFG table. However, a table named "QEMU" could be put to a better use than just a stub, e.g. we could use it to pass some QEMU specific info to guests. Replace with an SSDT and pad with the Nop opcode to preserve the length. Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 73519ab..d0afb31e 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2419,6 +2419,8 @@ build_mcfg_q35(GArray *table_data, BIOSLinker *linker= , AcpiMcfgInfo *info) { AcpiTableMcfg *mcfg; const char *sig; + const char *oem; + const char *oem_id; int len =3D sizeof(*mcfg) + 1 * sizeof(mcfg->allocation[0]); =20 mcfg =3D acpi_data_push(table_data, len); @@ -2431,16 +2433,21 @@ build_mcfg_q35(GArray *table_data, BIOSLinker *link= er, AcpiMcfgInfo *info) /* MCFG is used for ECAM which can be enabled or disabled by guest. * To avoid table size changes (which create migration issues), * always create the table even if there are no allocations, - * but set the signature to a reserved value in this case. - * ACPI spec requires OSPMs to ignore such tables. + * but fill it with Noop values. + * OSPMs ignore such tables. */ if (info->mcfg_base =3D=3D PCIE_BASE_ADDR_UNMAPPED) { - /* Reserved signature: ignored by OSPM */ - sig =3D "QEMU"; + sig =3D "SSDT"; + oem =3D "QEMU "; + oem_id =3D "NOOP"; + /* 0xa3 - NoopOp */ + memset(&mcfg->reserved, 0xa3, len - offsetof(AcpiTableMcfg, reserv= ed)); } else { sig =3D "MCFG"; + oem =3D NULL; + oem_id =3D NULL; } - build_header(linker, table_data, (void *)mcfg, sig, len, 1, NULL, NULL= ); + build_header(linker, table_data, (void *)mcfg, sig, len, 1, oem, oem_i= d); } =20 /* --=20 MST