From nobody Mon Feb 9 23:04:07 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1578324698; cv=none; d=zohomail.com; s=zohoarc; b=FmPf2t1g+0SNObydvoa+BHMk0EvcgXWDV+tjKLWSHwnQbpFGjvY83T7pgXWA9oSauxDyFTrUdB05o0sBVmVeXVK5J8FQewVv8Eq0TrQuGM3r1jVYTe4PpsLN6R2S5nNooe9CKrMKo1C0Oe3dCqxmrnOh2qjm1K+EgqIpEQgbZNo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578324698; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tT9IoRpgnOETDqskPOfw4yDkz8UN6egPx0IwhHjqplg=; b=VdTeQokEXq79ObH3u6rbkldKp1gEK64zWoRl8qxDXbqvl/dLIngokjsGhpPhsEXRdRYX1pJNo/THGYg4nKWh0PSavru6qaASIenmCS/c6OG60yLJRLgipxUVCM5DQT1vevAangco1PITjHAESrfXIKZ/YOui/xiM+eFvFvPIlr0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578324698144750.5570129435607; Mon, 6 Jan 2020 07:31:38 -0800 (PST) Received: from localhost ([::1]:53578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioULw-0003eO-SL for importer@patchew.org; Mon, 06 Jan 2020 10:31:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49617) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTot-0000gm-K4 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:57:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTos-0000px-FJ for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:57:27 -0500 Received: from 10.mo177.mail-out.ovh.net ([46.105.73.133]:49494) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ioTos-0000o9-8t for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:57:26 -0500 Received: from player731.ha.ovh.net (unknown [10.109.143.136]) by mo177.mail-out.ovh.net (Postfix) with ESMTP id 2457911D0E6 for ; Mon, 6 Jan 2020 15:57:24 +0100 (CET) Received: from kaod.org (deibp9eh1--blueice1n4.emea.ibm.com [195.212.29.166]) (Authenticated sender: clg@kaod.org) by player731.ha.ovh.net (Postfix) with ESMTPSA id F1A87DB3A677; Mon, 6 Jan 2020 14:57:17 +0000 (UTC) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: David Gibson Subject: [PATCH v3 05/12] xive: Use the XIVE fabric link under the XIVE router Date: Mon, 6 Jan 2020 15:56:38 +0100 Message-Id: <20200106145645.4539-6-clg@kaod.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200106145645.4539-1-clg@kaod.org> References: <20200106145645.4539-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 5391934658024213478 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrvdehtddgjeduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojghfgggtgfesthekredtredtjeenucfhrhhomhepveorughrihgtucfnvgcuifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucfkpheptddrtddrtddrtddpudelhedrvdduvddrvdelrdduieeinecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehplhgrhigvrhejfedurdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghlgheskhgrohgurdhorhhgpdhrtghpthhtohepqhgvmhhuqdguvghvvghlsehnohhnghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedu Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.73.133 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-ppc@nongnu.org, Greg Kurz , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Greg Kurz Now that the spapr and pnv machines do set the "xive-fabric" link, the use of the XIVE fabric pointer becomes mandatory. This is checked with an assert() in a new realize hook. Since the XIVE router is realized at machine init for the all the machine's life time, no risk to abort an already running guest (ie. not a hotplug path). This gets rid of a qdev_get_machine() call. Signed-off-by: Greg Kurz Signed-off-by: C=C3=A9dric Le Goater --- hw/intc/xive.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hw/intc/xive.c b/hw/intc/xive.c index 6df89b06da38..12a362b681a6 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -1378,6 +1378,13 @@ static int xive_router_get_block_id(XiveRouter *xrtr) return xrc->get_block_id(xrtr); } =20 +static void xive_router_realize(DeviceState *dev, Error **errp) +{ + XiveRouter *xrtr =3D XIVE_ROUTER(dev); + + assert(xrtr->xfb); +} + /* * Encode the HW CAM line in the block group mode format : * @@ -1470,12 +1477,11 @@ int xive_presenter_tctx_match(XivePresenter *xptr, = XiveTCTX *tctx, * * The parameters represent what is sent on the PowerBus */ -static bool xive_presenter_notify(uint8_t format, +static bool xive_presenter_notify(XiveFabric *xfb, uint8_t format, uint8_t nvt_blk, uint32_t nvt_idx, bool cam_ignore, uint8_t priority, uint32_t logic_serv) { - XiveFabric *xfb =3D XIVE_FABRIC(qdev_get_machine()); XiveFabricClass *xfc =3D XIVE_FABRIC_GET_CLASS(xfb); XiveTCTXMatch match =3D { .tctx =3D NULL, .ring =3D 0 }; int count; @@ -1607,7 +1613,7 @@ static void xive_router_end_notify(XiveRouter *xrtr, = uint8_t end_blk, return; } =20 - found =3D xive_presenter_notify(format, nvt_blk, nvt_idx, + found =3D xive_presenter_notify(xrtr->xfb, format, nvt_blk, nvt_idx, xive_get_field32(END_W7_F0_IGNORE, end.w7), priority, xive_get_field32(END_W7_F1_LOG_SERVER_ID, end.w7= )); @@ -1727,6 +1733,8 @@ static void xive_router_class_init(ObjectClass *klass= , void *data) =20 dc->desc =3D "XIVE Router Engine"; dc->props =3D xive_router_properties; + /* Parent is SysBusDeviceClass. No need to call its realize hook */ + dc->realize =3D xive_router_realize; xnc->notify =3D xive_router_notify; } =20 --=20 2.21.1