From nobody Fri Nov 7 04:06:13 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1545352959261146.54465588241646; Thu, 20 Dec 2018 16:42:39 -0800 (PST) Received: from localhost ([::1]:41694 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ga8th-0001xe-Si for importer@patchew.org; Thu, 20 Dec 2018 19:42:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ga8ol-0006CX-0X for qemu-devel@nongnu.org; Thu, 20 Dec 2018 19:37:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ga8od-0007aK-T0 for qemu-devel@nongnu.org; Thu, 20 Dec 2018 19:37:28 -0500 Received: from 1.mo2.mail-out.ovh.net ([46.105.63.121]:56793) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ga8oT-0007IQ-Ll for qemu-devel@nongnu.org; Thu, 20 Dec 2018 19:37:15 -0500 Received: from player758.ha.ovh.net (unknown [10.109.159.62]) by mo2.mail-out.ovh.net (Postfix) with ESMTP id 9699417704C for ; Fri, 21 Dec 2018 01:37:10 +0100 (CET) Received: from kaod.org (lns-bzn-46-82-253-208-248.adsl.proxad.net [82.253.208.248]) (Authenticated sender: groug@kaod.org) by player758.ha.ovh.net (Postfix) with ESMTPSA id 1D15F11487FD; Fri, 21 Dec 2018 00:36:54 +0000 (UTC) From: Greg Kurz To: qemu-devel@nongnu.org Date: Fri, 21 Dec 2018 01:36:53 +0100 Message-ID: <154535261366.862554.2330587135163596442.stgit@bahia.lan> In-Reply-To: <154535246529.862554.6113740443866753456.stgit@bahia.lan> References: <154535246529.862554.6113740443866753456.stgit@bahia.lan> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 3869999458215893442 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudejgedgvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.63.121 Subject: [Qemu-devel] [PATCH 07/15] spapr_pci: Define SPAPR_MAX_PHBS in hw/pci-host/spapr.h 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: Cornelia Huck , Gerd Hoffmann , Eduardo Habkost , "Michael S. Tsirkin" , Alexey Kardashevskiy , David Hildenbrand , Michael Roth , qemu-s390x@nongnu.org, Dmitry Fleytman , qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , Marcel Apfelbaum , Paolo Bonzini , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" PHB hotplug will bring more users for it. Let's define it along with the PHB defines from which it is derived for simplicity. While here fix a misleading comment about manual placement, which was abandoned with 30b3bc5aa9f4. Signed-off-by: Greg Kurz Reviewed-by: C=C3=A9dric Le Goater --- hw/ppc/spapr.c | 2 -- include/hw/pci-host/spapr.h | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 621006eaa862..fe3f9829ae6c 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3838,8 +3838,6 @@ static void spapr_phb_placement(sPAPRMachineState *sp= apr, uint32_t index, * 1TiB 64-bit MMIO windows for each PHB. */ const uint64_t base_buid =3D 0x800000020000000ULL; -#define SPAPR_MAX_PHBS ((SPAPR_PCI_LIMIT - SPAPR_PCI_BASE) / \ - SPAPR_PCI_MEM64_WIN_SIZE - 1) int i; =20 /* Sanity check natural alignments */ diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h index 9d2ec1a410e8..83d5075a6ef3 100644 --- a/include/hw/pci-host/spapr.h +++ b/include/hw/pci-host/spapr.h @@ -94,11 +94,13 @@ struct sPAPRPHBState { ((1ULL << 32) - SPAPR_PCI_MEM_WIN_BUS_OFFSET) #define SPAPR_PCI_MEM64_WIN_SIZE 0x10000000000ULL /* 1 TiB */ =20 -/* Without manual configuration, all PCI outbound windows will be - * within this range */ +/* All PCI outbound windows will be within this range */ #define SPAPR_PCI_BASE (1ULL << 45) /* 32 TiB */ #define SPAPR_PCI_LIMIT (1ULL << 46) /* 64 TiB */ =20 +#define SPAPR_MAX_PHBS ((SPAPR_PCI_LIMIT - SPAPR_PCI_BASE) / \ + SPAPR_PCI_MEM64_WIN_SIZE - 1) + #define SPAPR_PCI_2_7_MMIO_WIN_SIZE 0xf80000000 #define SPAPR_PCI_IO_WIN_SIZE 0x10000 =20