From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a05:6000:88:0:0:0:0 with SMTP id m8csp1266710wrx; Thu, 18 Apr 2019 17:50:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHmh7corazvVNsKTiGf45f8/OnJQb25jSFqI6o/sVwNBE8A5HoxsIyzcHw12ffp+nWsdkv X-Received: by 2002:a5d:6883:: with SMTP id h3mr682011wru.215.1555635009981; Thu, 18 Apr 2019 17:50:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555635009; cv=none; d=google.com; s=arc-20160816; b=CLQaF5yLUIazTD8QlVJooAkh6pA+b7R8QVaCEopFGTRMZjNnBT6SC4Oshaxhv06Mz1 RyaLIMhBRbXdITkwfNFlkvyFbWzd7yEvBTMla8O4NGVw5bMI1f8n4TZ/BEHAA8z/1NP3 J3TWTPFQCBPeeJ+k4LaubyjEgjUJbNS7mKEds3UEcDXMcQQXvLiPgawuZxn94rBF6IO+ 5M2Gi/ViIObaVxYCCsXZUXHvGPPu6mXK3PVsK/nvsNVqLJ0DDxf3JHB3zsQFtK/R7WtE Q+xhy+GBwQIkRFHm10q0EQlwZRYr6tiYIzdH49hU/KaaCXbHNxxDMfDkzuc7Zx8nsXbp 5z2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from; bh=3JC4fgKACibZW/ukQFjnyh5N/SxEJASsENPhlbKI+Rg=; b=0Yc2fyraYAQMjgud6TTmYMk/kVtf88Wb2ZAHHGb8OBxc6SskoHXGgIDQt5RLhn8NMA Hz+DR2JuzSVAt2GxUka2tnmxAAkmdgkvRgcSW6CAV4TtwfHYltG3AN7PPHYf4t6Mxl8f fe/shGehVJMmkgmdePpaoDu8ZVA/oOwUmepYYeUNI35UoBIHtjXfWNSZyPzxGRZSrXV7 2kkinn7OatD182P4jvGj1+iAf8cmD9VEtkb0MpgIxYYt1dHb0d2BqIEBqvAOu/w07WuW bmq0XJ8AGDi6AIDkXq+s4PdTjKrzMC6ARlYd7FN6X/RK7Aq19kWFR992urtNYb6jEurX s7mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x11si2608390wmc.144.2019.04.18.17.50.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 18 Apr 2019 17:50:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from localhost ([127.0.0.1]:49307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHHjF-0003tq-4j for alex.bennee@linaro.org; Thu, 18 Apr 2019 20:50:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHHcA-0007cN-Bc for qemu-devel@nongnu.org; Thu, 18 Apr 2019 20:42:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHHRB-0005ni-Qf for qemu-devel@nongnu.org; Thu, 18 Apr 2019 20:31:30 -0400 Received: from mga18.intel.com ([134.134.136.126]:3679) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hHHRA-0005kx-EK; Thu, 18 Apr 2019 20:31:28 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Apr 2019 17:31:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,367,1549958400"; d="scan'208";a="163163305" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga004.fm.intel.com with ESMTP; 18 Apr 2019 17:31:24 -0700 From: Wei Yang To: qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Fri, 19 Apr 2019 08:30:48 +0800 Message-Id: <20190419003053.8260-2-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190419003053.8260-1-richardw.yang@linux.intel.com> References: <20190419003053.8260-1-richardw.yang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.126 Subject: [Qemu-devel] [PATCH v4 1/6] 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: yang.zhong@intel.com, peter.maydell@linaro.org, mst@redhat.com, shannon.zhaosl@gmail.com, Wei Yang , imammedo@redhat.com, philmd@redhat.com Errors-To: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-devel" X-TUID: xQhZDwnySi84 From: Igor Mammedov 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/destination. 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 Signed-off-by: Wei Yang Reviewed-by: Philippe Mathieu-Daudé --- 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 b17d4a711d..d009176072 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 = sizeof(*mcfg) + 1 * sizeof(mcfg->allocation[0]); mcfg = acpi_data_push(table_data, len); @@ -2411,19 +2410,7 @@ build_mcfg_q35(GArray *table_data, BIOSLinker *linker, AcpiMcfgInfo *info) mcfg->allocation[0].start_bus_number = 0; mcfg->allocation[0].end_bus_number = PCIE_MMCFG_BUS(info->mcfg_size - 1); - /* 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 == PCIE_BASE_ADDR_UNMAPPED) { - /* Reserved signature: ignored by OSPM */ - sig = "QEMU"; - } else { - sig = "MCFG"; - } - build_header(linker, table_data, (void *)mcfg, sig, len, 1, NULL, NULL); + build_header(linker, table_data, (void *)mcfg, "MCFG", len, 1, NULL, NULL); } /* @@ -2592,6 +2579,9 @@ static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg) } mcfg->mcfg_base = qnum_get_uint(qobject_to(QNum, o)); qobject_unref(o); + if (mcfg->mcfg_base == PCIE_BASE_ADDR_UNMAPPED) { + return false; + } o = object_property_get_qobject(pci_host, PCIE_HOST_MCFG_SIZE, NULL); assert(o); -- 2.19.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:35712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHHcA-0007cN-Bc for qemu-devel@nongnu.org; Thu, 18 Apr 2019 20:42:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHHRB-0005ni-Qf for qemu-devel@nongnu.org; Thu, 18 Apr 2019 20:31:30 -0400 From: Wei Yang Date: Fri, 19 Apr 2019 08:30:48 +0800 Message-Id: <20190419003053.8260-2-richardw.yang@linux.intel.com> In-Reply-To: <20190419003053.8260-1-richardw.yang@linux.intel.com> References: <20190419003053.8260-1-richardw.yang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v4 1/6] q35: acpi: do not create dummy MCFG table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-arm@nongnu.org Cc: mst@redhat.com, imammedo@redhat.com, shannon.zhaosl@gmail.com, peter.maydell@linaro.org, marcel.apfelbaum@gmail.com, yang.zhong@intel.com, philmd@redhat.com, Wei Yang From: Igor Mammedov 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/destination. 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 Signed-off-by: Wei Yang Reviewed-by: Philippe Mathieu-Daudé --- 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 b17d4a711d..d009176072 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 = sizeof(*mcfg) + 1 * sizeof(mcfg->allocation[0]); mcfg = acpi_data_push(table_data, len); @@ -2411,19 +2410,7 @@ build_mcfg_q35(GArray *table_data, BIOSLinker *linker, AcpiMcfgInfo *info) mcfg->allocation[0].start_bus_number = 0; mcfg->allocation[0].end_bus_number = PCIE_MMCFG_BUS(info->mcfg_size - 1); - /* 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 == PCIE_BASE_ADDR_UNMAPPED) { - /* Reserved signature: ignored by OSPM */ - sig = "QEMU"; - } else { - sig = "MCFG"; - } - build_header(linker, table_data, (void *)mcfg, sig, len, 1, NULL, NULL); + build_header(linker, table_data, (void *)mcfg, "MCFG", len, 1, NULL, NULL); } /* @@ -2592,6 +2579,9 @@ static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg) } mcfg->mcfg_base = qnum_get_uint(qobject_to(QNum, o)); qobject_unref(o); + if (mcfg->mcfg_base == PCIE_BASE_ADDR_UNMAPPED) { + return false; + } o = object_property_get_qobject(pci_host, PCIE_HOST_MCFG_SIZE, NULL); assert(o); -- 2.19.1