From nobody Wed Feb 11 00:56:04 2026 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 1550230942119123.30856498417415; Fri, 15 Feb 2019 03:42:22 -0800 (PST) Received: from localhost ([127.0.0.1]:37953 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gubso-0005Vn-38 for importer@patchew.org; Fri, 15 Feb 2019 06:42:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gubqm-0004Be-CL for qemu-devel@nongnu.org; Fri, 15 Feb 2019 06:40:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gubqi-0005Yq-Lx for qemu-devel@nongnu.org; Fri, 15 Feb 2019 06:40:10 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:36700) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gubqg-0005RM-Hw for qemu-devel@nongnu.org; Fri, 15 Feb 2019 06:40:08 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1FBXtUN076644 for ; Fri, 15 Feb 2019 06:40:01 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qntdh6xkb-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 15 Feb 2019 06:40:01 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 15 Feb 2019 11:39:58 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 15 Feb 2019 11:39:56 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x1FBdtPN62980206 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Feb 2019 11:39:55 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9296C52057; Fri, 15 Feb 2019 11:39:55 +0000 (GMT) Received: from smtp.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.1]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 7EB5052052; Fri, 15 Feb 2019 11:39:55 +0000 (GMT) Received: from bahia.lan (sig-9-145-62-36.uk.ibm.com [9.145.62.36]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id 0B860220295; Fri, 15 Feb 2019 12:39:54 +0100 (CET) From: Greg Kurz To: David Gibson Date: Fri, 15 Feb 2019 12:39:54 +0100 In-Reply-To: <155023078266.1011724.5995737218088270486.stgit@bahia.lan> References: <155023078266.1011724.5995737218088270486.stgit@bahia.lan> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 19021511-0012-0000-0000-000002F61BD0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19021511-0013-0000-0000-0000212D9C95 Message-Id: <155023079461.1011724.12644984391500635645.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-15_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902150083 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 02/10] xics: Handle KVM ICP reset from the common code 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-devel@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" The KVM ICP reset handler simply writes the ICP state to KVM. This doesn't need the overkill parent_reset logic we have today. Call icp_set_kvm_state() from the base ICP reset function instead. Since there are no other users for ICPStateClass::parent_reset, and it isn't currently expected to change, drop it as well. Signed-off-by: Greg Kurz Reviewed-by: C=C3=A9dric Le Goater --- hw/intc/xics.c | 12 ++++-------- hw/intc/xics_kvm.c | 11 ----------- include/hw/ppc/xics.h | 1 - 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index 988b53abd17d..822d367e6388 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -289,7 +289,7 @@ static const VMStateDescription vmstate_icp_server =3D { }, }; =20 -static void icp_reset(DeviceState *dev) +static void icp_reset_handler(void *dev) { ICPState *icp =3D ICP(dev); =20 @@ -299,13 +299,10 @@ static void icp_reset(DeviceState *dev) =20 /* Make all outputs are deasserted */ qemu_set_irq(icp->output, 0); -} =20 -static void icp_reset_handler(void *dev) -{ - DeviceClass *dc =3D DEVICE_GET_CLASS(dev); - - dc->reset(dev); + if (kvm_irqchip_in_kernel()) { + icp_set_kvm_state(ICP(dev)); + } } =20 static void icp_realize(DeviceState *dev, Error **errp) @@ -370,7 +367,6 @@ static void icp_class_init(ObjectClass *klass, void *da= ta) =20 dc->realize =3D icp_realize; dc->unrealize =3D icp_unrealize; - dc->reset =3D icp_reset; } =20 static const TypeInfo icp_info =3D { diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index 7efa99b8b434..80321e9b75ab 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -115,15 +115,6 @@ int icp_set_kvm_state(ICPState *icp) return 0; } =20 -static void icp_kvm_reset(DeviceState *dev) -{ - ICPStateClass *icpc =3D ICP_GET_CLASS(dev); - - icpc->parent_reset(dev); - - icp_set_kvm_state(ICP(dev)); -} - static void icp_kvm_realize(DeviceState *dev, Error **errp) { ICPState *icp =3D ICP(dev); @@ -176,8 +167,6 @@ static void icp_kvm_class_init(ObjectClass *klass, void= *data) =20 device_class_set_parent_realize(dc, icp_kvm_realize, &icpc->parent_realize); - device_class_set_parent_reset(dc, icp_kvm_reset, - &icpc->parent_reset); } =20 static const TypeInfo icp_kvm_info =3D { diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 3236ccec924c..e33282a576d0 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -65,7 +65,6 @@ struct ICPStateClass { DeviceClass parent_class; =20 DeviceRealize parent_realize; - DeviceReset parent_reset; }; =20 struct ICPState {