From nobody Wed Nov 5 16:41:38 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.zoho.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 1496929854372736.3879449527483; Thu, 8 Jun 2017 06:50:54 -0700 (PDT) Received: from localhost ([::1]:49747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIxps-0003rN-Rr for importer@patchew.org; Thu, 08 Jun 2017 09:50:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIxiY-0006My-21 for qemu-devel@nongnu.org; Thu, 08 Jun 2017 09:43:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIxiU-0007QD-W6 for qemu-devel@nongnu.org; Thu, 08 Jun 2017 09:43:18 -0400 Received: from 10.mo178.mail-out.ovh.net ([46.105.76.150]:51036) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dIxiU-0007O0-Pt for qemu-devel@nongnu.org; Thu, 08 Jun 2017 09:43:14 -0400 Received: from player728.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo178.mail-out.ovh.net (Postfix) with ESMTP id 4E1F33EAD0 for ; Thu, 8 Jun 2017 15:43:13 +0200 (CEST) Received: from [192.168.0.243] (gar31-1-82-66-74-139.fbx.proxad.net [82.66.74.139]) (Authenticated sender: groug@kaod.org) by player728.ha.ovh.net (Postfix) with ESMTPA id 4F9305400A9; Thu, 8 Jun 2017 15:43:09 +0200 (CEST) From: Greg Kurz To: qemu-devel@nongnu.org Date: Thu, 08 Jun 2017 15:43:08 +0200 Message-ID: <149692938872.12119.17948850600182624221.stgit@bahia> In-Reply-To: <149692935202.12119.3614006195497745877.stgit@bahia> References: <149692935202.12119.3614006195497745877.stgit@bahia> User-Agent: StGit/0.17.1-20-gc0b1b-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 6084644573877017062 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeljedrieefgdeikecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.76.150 Subject: [Qemu-devel] [PATCH v4 4/6] xics: drop ICPStateClass::cpu_setup() handler 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, Cedric Le Goater , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 The cpu_setup() handler is only implemented by xics_kvm, where it really does a typical "realize" job. Moreover, the realize() handler is called shortly after cpu_setup(), on the same path. This patch converts xics_kvm to implement realize() instead of cpu_setup(). Signed-off-by: Greg Kurz Reviewed-by: C=C3=A9dric Le Goater --- hw/intc/xics.c | 4 ---- hw/intc/xics_kvm.c | 12 ++++++------ include/hw/ppc/xics.h | 1 - 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index fdbfddffeea5..7ccfb53c55a0 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -324,10 +324,6 @@ static void icp_realize(DeviceState *dev, Error **errp) cpu->intc =3D OBJECT(icp); icp->cs =3D CPU(obj); =20 - if (icpc->cpu_setup) { - icpc->cpu_setup(icp, cpu); - } - env =3D &cpu->env; switch (PPC_INPUT(env)) { case PPC_FLAGS_INPUT_POWER7: diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index 41c5b9439562..3091ad3ac2c8 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -115,9 +115,9 @@ static void icp_kvm_reset(ICPState *icp) icp_set_kvm_state(icp, 1); } =20 -static void icp_kvm_cpu_setup(ICPState *icp, PowerPCCPU *cpu) +static void icp_kvm_realize(ICPState *icp, Error **errp) { - CPUState *cs =3D CPU(cpu); + CPUState *cs =3D icp->cs; KVMEnabledICP *enabled_icp; unsigned long vcpu_id =3D kvm_arch_vcpu_id(cs); int ret; @@ -139,9 +139,9 @@ static void icp_kvm_cpu_setup(ICPState *icp, PowerPCCPU= *cpu) =20 ret =3D kvm_vcpu_enable_cap(cs, KVM_CAP_IRQ_XICS, 0, kernel_xics_fd, v= cpu_id); if (ret < 0) { - error_report("Unable to connect CPU%ld to kernel XICS: %s", vcpu_i= d, - strerror(errno)); - exit(1); + error_setg(errp, "Unable to connect CPU%ld to kernel XICS: %s", vc= pu_id, + strerror(errno)); + return; } enabled_icp =3D g_malloc(sizeof(*enabled_icp)); enabled_icp->vcpu_id =3D vcpu_id; @@ -154,7 +154,7 @@ static void icp_kvm_class_init(ObjectClass *klass, void= *data) =20 icpc->pre_save =3D icp_get_kvm_state; icpc->post_load =3D icp_set_kvm_state; - icpc->cpu_setup =3D icp_kvm_cpu_setup; + icpc->realize =3D icp_kvm_realize; icpc->reset =3D icp_kvm_reset; } =20 diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 37b8fb1e8817..28d248abad61 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -68,7 +68,6 @@ struct ICPStateClass { void (*realize)(ICPState *icp, Error **errp); void (*pre_save)(ICPState *icp); int (*post_load)(ICPState *icp, int version_id); - void (*cpu_setup)(ICPState *icp, PowerPCCPU *cpu); void (*reset)(ICPState *icp); }; =20