From nobody Fri Nov 7 06:13:17 2025 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1546886951430620.557341288587; Mon, 7 Jan 2019 10:49:11 -0800 (PST) Received: from localhost ([127.0.0.1]:48275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggZxW-0001fw-EZ for importer@patchew.org; Mon, 07 Jan 2019 13:49:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggZpU-0002qu-8m for qemu-devel@nongnu.org; Mon, 07 Jan 2019 13:40:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggZpT-000380-Bh for qemu-devel@nongnu.org; Mon, 07 Jan 2019 13:40:52 -0500 Received: from 1.mo69.mail-out.ovh.net ([178.33.251.173]:37064) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ggZpT-00033p-4n for qemu-devel@nongnu.org; Mon, 07 Jan 2019 13:40:51 -0500 Received: from player687.ha.ovh.net (unknown [10.109.159.248]) by mo69.mail-out.ovh.net (Postfix) with ESMTP id CC3E1393E8 for ; Mon, 7 Jan 2019 19:40:49 +0100 (CET) Received: from kaod.org (lfbn-1-10605-110.w90-89.abo.wanadoo.fr [90.89.196.110]) (Authenticated sender: clg@kaod.org) by player687.ha.ovh.net (Postfix) with ESMTPSA id 2210F1604EBD; Mon, 7 Jan 2019 18:40:44 +0000 (UTC) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: David Gibson Date: Mon, 7 Jan 2019 19:39:40 +0100 Message-Id: <20190107183946.7230-8-clg@kaod.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107183946.7230-1-clg@kaod.org> References: <20190107183946.7230-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 11326834538476047334 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrvdejgdduudegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 178.33.251.173 Subject: [Qemu-devel] [PATCH 07/13] ppc/xics: introduce a icp_kvm_connect() routine 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: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This routine gathers all the KVM initialization of the XICS KVM presenter. It will be useful when the initialization of the KVM XICS device is moved to a global routine. Signed-off-by: C=C3=A9dric Le Goater --- hw/intc/xics_kvm.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index ac94594b1919..2426e5b2f4ed 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -123,11 +123,8 @@ static void icp_kvm_reset(DeviceState *dev) icp_set_kvm_state(ICP(dev), 1); } =20 -static void icp_kvm_realize(DeviceState *dev, Error **errp) +static void icp_kvm_connect(ICPState *icp, Error **errp) { - ICPState *icp =3D ICP(dev); - ICPStateClass *icpc =3D ICP_GET_CLASS(icp); - Error *local_err =3D NULL; CPUState *cs; KVMEnabledICP *enabled_icp; unsigned long vcpu_id; @@ -135,11 +132,6 @@ static void icp_kvm_realize(DeviceState *dev, Error **= errp) =20 if (kernel_xics_fd =3D=3D -1) { abort(); - } - - icpc->parent_realize(dev, &local_err); - if (local_err) { - error_propagate(errp, local_err); return; } =20 @@ -168,6 +160,25 @@ static void icp_kvm_realize(DeviceState *dev, Error **= errp) QLIST_INSERT_HEAD(&kvm_enabled_icps, enabled_icp, node); } =20 +static void icp_kvm_realize(DeviceState *dev, Error **errp) +{ + ICPStateClass *icpc =3D ICP_GET_CLASS(dev); + Error *local_err =3D NULL; + + icpc->parent_realize(dev, &local_err); + if (local_err) { + error_propagate(errp, local_err); + return; + } + + /* Connect the presenter to the VCPU (required for CPU hotplug) */ + icp_kvm_connect(ICP(dev), &local_err); + if (local_err) { + error_propagate(errp, local_err); + return; + } +} + static void icp_kvm_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); --=20 2.20.1