From nobody Sun May 19 01:26:42 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=linux.intel.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552377102135816.1700436309093; Tue, 12 Mar 2019 00:51:42 -0700 (PDT) Received: from localhost ([127.0.0.1]:46892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3cCE-0004e0-Sj for importer@patchew.org; Tue, 12 Mar 2019 03:51:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3cBD-0004CU-JA for qemu-devel@nongnu.org; Tue, 12 Mar 2019 03:50:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3cBC-0000Np-P0 for qemu-devel@nongnu.org; Tue, 12 Mar 2019 03:50:31 -0400 Received: from mga01.intel.com ([192.55.52.88]:19816) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h3cBA-0000AZ-F3; Tue, 12 Mar 2019 03:50:28 -0400 Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Mar 2019 00:50:20 -0700 Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga008.jf.intel.com with ESMTP; 12 Mar 2019 00:50:18 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,470,1544515200"; d="scan'208";a="124712371" From: Wei Yang To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Tue, 12 Mar 2019 15:49:53 +0800 Message-Id: <20190312074953.16671-1-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.88 Subject: [Qemu-devel] [PATCH] hw/arm/virt-acpi-build: use PCIE_MMCFG_BUS to retrieve end_bus_number 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: imammedo@redhat.com, shannon.zhaosl@gmail.com, Wei Yang , mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This is more proper to use PCIE_MMCFG_BUS to retrieve end_bus_number. Signed-off-by: Wei Yang Reviewed-by: Eric Auger Reviewed-by: Igor Mammedov --- hw/arm/virt-acpi-build.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index d7e2e4885b..57679a89bf 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -560,8 +560,8 @@ build_mcfg(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) /* Only a single allocation so no need to play with segments */ mcfg->allocation[0].pci_segment =3D cpu_to_le16(0); mcfg->allocation[0].start_bus_number =3D 0; - mcfg->allocation[0].end_bus_number =3D (memmap[ecam_id].size - / PCIE_MMCFG_SIZE_MIN) - 1; + mcfg->allocation[0].end_bus_number =3D + PCIE_MMCFG_BUS(memmap[ecam_id].size - 1); =20 build_header(linker, table_data, (void *)(table_data->data + mcfg_star= t), "MCFG", table_data->len - mcfg_start, 1, NULL, NULL); --=20 2.19.1