From nobody Sat Apr 27 00:11:41 2024 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 1495647729556899.212555328479; Wed, 24 May 2017 10:42:09 -0700 (PDT) Received: from localhost ([::1]:56128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDaIS-0005Ha-8l for importer@patchew.org; Wed, 24 May 2017 13:42:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDaHG-0004dk-3S for qemu-devel@nongnu.org; Wed, 24 May 2017 13:40:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dDaHC-00052o-FQ for qemu-devel@nongnu.org; Wed, 24 May 2017 13:40:53 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:51001 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dDaHC-000522-Ao for qemu-devel@nongnu.org; Wed, 24 May 2017 13:40:50 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4OHdqMB092034 for ; Wed, 24 May 2017 13:40:49 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0b-001b2d01.pphosted.com with ESMTP id 2anee0rwb1-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 24 May 2017 13:40:49 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 24 May 2017 13:40:48 -0400 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 24 May 2017 13:40:46 -0400 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v4OHel7d41025642; Wed, 24 May 2017 17:40:47 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 41B1FAE034; Wed, 24 May 2017 13:40:45 -0400 (EDT) Received: from bahia.lan (unknown [9.164.168.21]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id 4D254AE043; Wed, 24 May 2017 13:40:44 -0400 (EDT) From: Greg Kurz To: qemu-devel@nongnu.org Date: Wed, 24 May 2017 19:40:43 +0200 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-TM-AS-GCONF: 00 x-cbid: 17052417-0052-0000-0000-0000020982E4 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007111; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000212; SDB=6.00865054; UDB=6.00429494; IPR=6.00644834; BA=6.00005372; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015566; XFM=3.00000015; UTC=2017-05-24 17:40:48 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17052417-0053-0000-0000-000050B25BC7 Message-Id: <149564764390.1804.5304274992848891131.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-05-24_12:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705240083 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH] xics: add unrealize 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: Bharata B Rao , 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 Now that ICPState objects get finalized on CPU unplug, we should unregister reset handlers as well to avoid a QEMU crash at machine reset time. Signed-off-by: Greg Kurz --- hw/intc/xics.c | 5 +++++ hw/intc/xics_kvm.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index 292fffecd376..ea3516794af7 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -357,6 +357,10 @@ static void icp_realize(DeviceState *dev, Error **errp) qemu_register_reset(icp_reset, dev); } =20 +static void icp_unrealize(DeviceState *dev, Error **errp) +{ + qemu_unregister_reset(icp_reset, dev); +} =20 static void icp_class_init(ObjectClass *klass, void *data) { @@ -364,6 +368,7 @@ static void icp_class_init(ObjectClass *klass, void *da= ta) =20 dc->vmsd =3D &vmstate_icp_server; dc->realize =3D icp_realize; + dc->unrealize =3D icp_unrealize; } =20 static const TypeInfo icp_info =3D { diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index dd7f29846235..14b8f6f6e478 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -164,12 +164,18 @@ static void icp_kvm_realize(DeviceState *dev, Error *= *errp) qemu_register_reset(icp_kvm_reset, dev); } =20 +static void icp_kvm_unrealize(DeviceState *dev, Error **errp) +{ + qemu_unregister_reset(icp_kvm_reset, dev); +} + static void icp_kvm_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); ICPStateClass *icpc =3D ICP_CLASS(klass); =20 dc->realize =3D icp_kvm_realize; + dc->unrealize =3D icp_kvm_unrealize; icpc->pre_save =3D icp_get_kvm_state; icpc->post_load =3D icp_set_kvm_state; icpc->cpu_setup =3D icp_kvm_cpu_setup;