From nobody Tue Feb 10 01:35:45 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=1576741345; cv=none; d=zohomail.com; s=zohoarc; b=O6pBpa3A9mwMAix2mSmBJ7R2KyowCEWAqwf+XMagwnNhlWz94B27qob2mwQDIuVeM0fjCUJcXHLtXm/noxW8EAlDa9LodZLFS9ugI+17Dx67px2oR/UzB4BLyBp9pP/STmVn5jwrt4iIRcplZFy8+7rlTm3Dx7/wcCDc4N7hRGQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576741345; 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=PMj/DM0Yh2utV1tACmnwolApM3Y+YyKR4KXlVV9Dwog=; b=eWuNGrFxxwdTHGyMmrSuz8rXmFFKUFw6YnoM/hDhiI+XByfaGYAOoKN8E6mrj2Mhk6P1gsm/eL8tGj4/jqxgLf3YK/KiXBX8KR5D1CC2/EzRQYkQm9H0896aFdX5yg05/MaJf4ptQwEUmy9I4+xJzXuAhW4at4Qji4GTNTBResM= 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 1576741345267581.5344278991132; Wed, 18 Dec 2019 23:42:25 -0800 (PST) Received: from localhost ([::1]:36890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihqRy-0001Rq-UP for importer@patchew.org; Thu, 19 Dec 2019 02:42:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50615) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihqGz-0007Az-03 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 02:31:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihqGx-0004X3-NK for qemu-devel@nongnu.org; Thu, 19 Dec 2019 02:31:00 -0500 Received: from 18.mo6.mail-out.ovh.net ([46.105.73.110]:34102) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ihqGx-0004NX-Dk for qemu-devel@nongnu.org; Thu, 19 Dec 2019 02:30:59 -0500 Received: from player714.ha.ovh.net (unknown [10.109.146.173]) by mo6.mail-out.ovh.net (Postfix) with ESMTP id B70D61EF8A0 for ; Thu, 19 Dec 2019 08:30:57 +0100 (CET) Received: from kaod.org (lfbn-tou-1-1227-223.w90-76.abo.wanadoo.fr [90.76.50.223]) (Authenticated sender: clg@kaod.org) by player714.ha.ovh.net (Postfix) with ESMTPSA id 2F7C7D671F1E; Thu, 19 Dec 2019 07:30:52 +0000 (UTC) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: David Gibson Subject: [PATCH 08/10] xive: Use the XIVE fabric link under the XIVE router Date: Thu, 19 Dec 2019 08:29:59 +0100 Message-Id: <20191219073001.26790-9-clg@kaod.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191219073001.26790-1-clg@kaod.org> References: <20191219073001.26790-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 2824038442277112806 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrvddutddguddtjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeevrogurhhitgcunfgvucfiohgrthgvrhcuoegtlhhgsehkrghougdrohhrgheqnecukfhppedtrddtrddtrddtpdeltddrjeeirdehtddrvddvfeenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepphhlrgihvghrjedugedrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdprhgtphhtthhopehqvghmuhdquggvvhgvlhesnhhonhhgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgepge 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.110 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.0