From nobody Sat Feb 7 02:20:53 2026 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; dkim=fail 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 1496986625719789.8387856968632; Thu, 8 Jun 2017 22:37:05 -0700 (PDT) Received: from localhost ([::1]:52712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJCbX-0004rP-SR for importer@patchew.org; Fri, 09 Jun 2017 01:37:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJCRz-0003yY-DD for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:27:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJCRy-0006fJ-3Z for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:27:11 -0400 Received: from ozlabs.org ([103.22.144.67]:60293) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dJCRx-0006dr-Nh; Fri, 09 Jun 2017 01:27:10 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3wkW4d2Jl4z9sNl; Fri, 9 Jun 2017 15:26:56 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1496986017; bh=NqNofQk74n9cS1pLnIvP+pGDLVRROi25YvojawdZFoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XUf7dI5DLXxXPqG0Cfn3MlljSWSF20n9hMeLb1yxb7wJrcrf9r948kOYSMofjksw3 wp/kV9Pt/AXRDbm7j9yD2OUM3fMey5xPi/wPtVfDqICZLDE4V/6+FzcGRFG75A3NW5 oRWZquhOgpkywIIT9xlQI0nZhUafMVEyF9jy7u0k= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 9 Jun 2017 15:26:51 +1000 Message-Id: <20170609052652.23200-20-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170609052652.23200-1-david@gibson.dropbear.id.au> References: <20170609052652.23200-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 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: 103.22.144.67 Subject: [Qemu-devel] [PULL 19/20] 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: agraf@suse.de, qemu-devel@nongnu.org, sursingh@redhat.com, mdroth@linux.vnet.ibm.com, Greg Kurz , qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Greg Kurz 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 Signed-off-by: David Gibson --- 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 fdbfddf..7ccfb53 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 41c5b94..3091ad3 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 37b8fb1..28d248a 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 --=20 2.9.4