From nobody Mon Apr 29 15:46:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1554822172; cv=none; d=zoho.com; s=zohoarc; b=WHLMn7/AA8fkWKuc4PtcihbvmzhtyIESQZff0T2D3Z51ErcOShVTtgkZPQ0dCi0VumGmyNEUc2CKSryw3QCiHf7IoJVcIxJyc0MoX9AitMeICEBD75gXw4NSwgln98LyxnJVVKP/yyiw2SnGScIZRb/gq3umy08jQiWCCBAzoYs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1554822172; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=YAbdSE9Pau1yPFUN7Z3fA9Nh8v7GzhQvXRMTLNUZJqU=; b=WSmrJ/Z/R0aROl6zToEV7jqMHrBhnsyoIErkWxcWYuLQoU9/gi+yTnw1YXVvl7tlZ01zEnsegMayHwTwGkFuyJjs0wMDSJf5w/iXHXAZQX4fXmLEukAbybV1f4wj1yiz9s5P9SNZaePwazktvh4t78mle6tFBgnaM7+34PfOJUw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1554822172413445.86072967801147; Tue, 9 Apr 2019 08:02:52 -0700 (PDT) Received: from localhost ([127.0.0.1]:42946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDsGt-0005l8-H1 for importer@patchew.org; Tue, 09 Apr 2019 11:02:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDsEm-0004a8-CT for qemu-devel@nongnu.org; Tue, 09 Apr 2019 11:00:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hDsEl-0000Dq-82 for qemu-devel@nongnu.org; Tue, 09 Apr 2019 11:00:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46714) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hDsEk-0000D3-VT for qemu-devel@nongnu.org; Tue, 09 Apr 2019 11:00:35 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6AAEA3008CCD; Tue, 9 Apr 2019 15:00:25 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 009F2600CC; Tue, 9 Apr 2019 15:00:18 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Date: Tue, 9 Apr 2019 17:00:37 +0200 Message-Id: <1554822037-329838-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 09 Apr 2019 15:00:30 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-4.1] q35: acpi: do not create dummy MCFG table 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: richardw.yang@linux.intel.com, ehabkost@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Dummy table (with signature "QEMU") creation came from original SeaBIOS codebase. And QEMU would have to keep it around if there were Q35 machine that depended on keeping ACPI tables blob constant size. Luckily there were no versioned Q35 machine types before commit: (since 2.3) a1666142db acpi-build: make ROMs RAM blocks resizeable which obsoleted need to keep ACPI tables blob the same size on source/desti= nation. Considering the 1st versioned machine is pc-q35-2.4, the dummy table is not really necessary and it's safe to drop it without breaking cross version migration in both directions unconditionally. Signed-off-by: Igor Mammedov Reviewed-by: Wei Yang --- hw/i386/acpi-build.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 416da31..8671e25 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2401,7 +2401,6 @@ static void build_mcfg_q35(GArray *table_data, BIOSLinker *linker, AcpiMcfgInfo *info) { AcpiTableMcfg *mcfg; - const char *sig; int len =3D sizeof(*mcfg) + 1 * sizeof(mcfg->allocation[0]); =20 mcfg =3D acpi_data_push(table_data, len); @@ -2411,19 +2410,7 @@ build_mcfg_q35(GArray *table_data, BIOSLinker *linke= r, AcpiMcfgInfo *info) mcfg->allocation[0].start_bus_number =3D 0; mcfg->allocation[0].end_bus_number =3D PCIE_MMCFG_BUS(info->mcfg_size = - 1); =20 - /* 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. - */ - if (info->mcfg_base =3D=3D PCIE_BASE_ADDR_UNMAPPED) { - /* Reserved signature: ignored by OSPM */ - sig =3D "QEMU"; - } else { - sig =3D "MCFG"; - } - build_header(linker, table_data, (void *)mcfg, sig, len, 1, NULL, NULL= ); + build_header(linker, table_data, (void *)mcfg, "MCFG", len, 1, NULL, N= ULL); } =20 /* @@ -2592,6 +2579,9 @@ static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg) } mcfg->mcfg_base =3D qnum_get_uint(qobject_to(QNum, o)); qobject_unref(o); + if (mcfg->mcfg_base =3D=3D PCIE_BASE_ADDR_UNMAPPED) { + return false; + } =20 o =3D object_property_get_qobject(pci_host, PCIE_HOST_MCFG_SIZE, NULL); assert(o); --=20 2.7.4