From nobody Tue Nov 11 01:39:40 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 ARC-Seal: i=1; a=rsa-sha256; t=1560779462; cv=none; d=zoho.com; s=zohoarc; b=MkbFE/MnXpSVpSN2t1VktqGESmb/R3ij+jOeNgEoJ5Sg13kIEDralrxOUkyA5ci2KMPmemTSTbVXI8D1dDbWpmPCVewJaF5vMYPMiuhMErN4lFwi6dNDlQm9TYj+ekyGTfROIyP4wd63e7GsjZY+pM5uxO0mt9kqxCIAPx4HBUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560779462; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=pNP3HIaffV2EMOj22VlBibyd6nBtAFUadAzfU54zTsc=; b=WmPluugg1Dz60yr0qckFJD1BDFeZ6bxKtMklYgGOORd71rMbyTtWxV/psizgcrH4/kXz9znAvdQBYdnna53bP/9iycW38GAh7xtYMtqkpi9xSrDMSIB7eEER1uUKQ1k4mSi8dF46CbCOrRxTW3ijuAOTHJCSPI+6rPAaqMTSm2k= ARC-Authentication-Results: i=1; mx.zoho.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 1560779462046494.02271240132586; Mon, 17 Jun 2019 06:51:02 -0700 (PDT) Received: from localhost ([::1]:47646 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcs2G-0006fv-Qy for importer@patchew.org; Mon, 17 Jun 2019 09:51:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32883) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcry8-0004IJ-J2 for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:46:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcry7-0000WQ-FN for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:46:44 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:39426 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 1hcry7-0000Vk-9X for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:46:43 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5HDbVMj088033 for ; Mon, 17 Jun 2019 09:46:42 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0b-001b2d01.pphosted.com with ESMTP id 2t69mrxq52-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 17 Jun 2019 09:46:42 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Jun 2019 14:46:40 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 17 Jun 2019 14:46:36 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5HDkaLY61800516 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jun 2019 13:46:36 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 055F211C050; Mon, 17 Jun 2019 13:46:36 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C966A11C04C; Mon, 17 Jun 2019 13:46:35 +0000 (GMT) Received: from bahia.lan (unknown [9.145.14.35]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 17 Jun 2019 13:46:35 +0000 (GMT) From: Greg Kurz To: David Gibson Date: Mon, 17 Jun 2019 15:46:35 +0200 In-Reply-To: <156077918969.433243.1416211899441569578.stgit@bahia.lan> References: <156077918969.433243.1416211899441569578.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: 19061713-0020-0000-0000-0000034AD609 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061713-0021-0000-0000-0000219E1BFC Message-Id: <156077919546.433243.8748677531446035746.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-17_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=941 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906170126 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 1/6] xics/spapr: Drop unused function declaration X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Commit 9fb6eb7ca50c added the declaration of xics_spapr_connect(), which has no implementation and no users. This is a leftover from a previous iteration of this patch. Drop it. Signed-off-by: Greg Kurz Reviewed-by: C=C3=A9dric Le Goater --- include/hw/ppc/xics_spapr.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/hw/ppc/xics_spapr.h b/include/hw/ppc/xics_spapr.h index d968f2499ca7..330448126223 100644 --- a/include/hw/ppc/xics_spapr.h +++ b/include/hw/ppc/xics_spapr.h @@ -37,6 +37,5 @@ int xics_kvm_init(SpaprMachineState *spapr, Error **errp); void xics_kvm_disconnect(SpaprMachineState *spapr, Error **errp); bool xics_kvm_has_broken_disconnect(SpaprMachineState *spapr); void xics_spapr_init(SpaprMachineState *spapr); -void xics_spapr_connect(SpaprMachineState *spapr); =20 #endif /* XICS_SPAPR_H */ From nobody Tue Nov 11 01:39:40 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 ARC-Seal: i=1; a=rsa-sha256; t=1560779501; cv=none; d=zoho.com; s=zohoarc; b=RSTydgO7jDoDd6fR4OGOG+m8blqNpYaaY0z1sofABRoyePpCCICLPL5qFRGK82s8W0PZnKLlMYpcpzDZbLDN9nOfWZqN4oAnamNv8B3Q6Bei/UshFkWIPVbwZrvQB/TzvfOkhLjmRA3ukWUjeNIgE9cSZ07MaHPrZdhebJt1Nrw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560779501; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=GoZKhTDplXASzLAIYWhVcA9xYbJfnfBkY6h7Ap0vRx8=; b=X6wahrNKnsLe13Se+KOAhgQ5M6B+9RPTjI2GQz8qtVjSeXNndOKNACwidCIjNT+jyINGjoPoQy7PP40oBnF4Xhn4QbnHLZVnPjV7aP++F/78esNoFc64Dgu3+FoLSgrVgITyTa/lm2YGcsd2G5JTuFRmxfpK3ZJgXu4OuHRhGDA= ARC-Authentication-Results: i=1; mx.zoho.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 1560779501433291.54359220933554; Mon, 17 Jun 2019 06:51:41 -0700 (PDT) Received: from localhost ([::1]:47652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcs2u-0007ck-7W for importer@patchew.org; Mon, 17 Jun 2019 09:51:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32927) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcryD-0004LQ-6k for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:46:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcryB-0000a0-UJ for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:46:49 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:48810 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 1hcryB-0000ZM-Ob for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:46:47 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5HDbcTF177599 for ; Mon, 17 Jun 2019 09:46:46 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2t6brv0wnr-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 17 Jun 2019 09:46:46 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Jun 2019 14:46:45 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 17 Jun 2019 14:46:42 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5HDkf8E51380230 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jun 2019 13:46:41 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8C1F0AE051; Mon, 17 Jun 2019 13:46:41 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5C0A6AE053; Mon, 17 Jun 2019 13:46:41 +0000 (GMT) Received: from bahia.lan (unknown [9.145.14.35]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 17 Jun 2019 13:46:41 +0000 (GMT) From: Greg Kurz To: David Gibson Date: Mon, 17 Jun 2019 15:46:41 +0200 In-Reply-To: <156077918969.433243.1416211899441569578.stgit@bahia.lan> References: <156077918969.433243.1416211899441569578.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: 19061713-0028-0000-0000-0000037B06D5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061713-0029-0000-0000-0000243B0B45 Message-Id: <156077920102.433243.6605099291134598170.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-17_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 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-1906170126 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 2/6] xics/spapr: Rename xics_kvm_init() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Switch to using the connect/disconnect terminology like we already do for XIVE. Signed-off-by: Greg Kurz Reviewed-by: C=C3=A9dric Le Goater --- hw/intc/xics_kvm.c | 2 +- hw/ppc/spapr_irq.c | 2 +- include/hw/ppc/xics_spapr.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index c7f8f5edd257..534515143ea8 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -331,7 +331,7 @@ void ics_kvm_set_irq(ICSState *ics, int srcno, int val) } } =20 -int xics_kvm_init(SpaprMachineState *spapr, Error **errp) +int xics_kvm_connect(SpaprMachineState *spapr, Error **errp) { int rc; CPUState *cs; diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c index 84b9b32fe40f..ff3df0bbd8cf 100644 --- a/hw/ppc/spapr_irq.c +++ b/hw/ppc/spapr_irq.c @@ -237,7 +237,7 @@ static const char *spapr_irq_get_nodename_xics(SpaprMac= hineState *spapr) static void spapr_irq_init_kvm_xics(SpaprMachineState *spapr, Error **errp) { if (kvm_enabled()) { - xics_kvm_init(spapr, errp); + xics_kvm_connect(spapr, errp); } } =20 diff --git a/include/hw/ppc/xics_spapr.h b/include/hw/ppc/xics_spapr.h index 330448126223..5dabc9a1388f 100644 --- a/include/hw/ppc/xics_spapr.h +++ b/include/hw/ppc/xics_spapr.h @@ -33,7 +33,7 @@ =20 void spapr_dt_xics(SpaprMachineState *spapr, uint32_t nr_servers, void *fd= t, uint32_t phandle); -int xics_kvm_init(SpaprMachineState *spapr, Error **errp); +int xics_kvm_connect(SpaprMachineState *spapr, Error **errp); void xics_kvm_disconnect(SpaprMachineState *spapr, Error **errp); bool xics_kvm_has_broken_disconnect(SpaprMachineState *spapr); void xics_spapr_init(SpaprMachineState *spapr); From nobody Tue Nov 11 01:39:40 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 ARC-Seal: i=1; a=rsa-sha256; t=1560779448; cv=none; d=zoho.com; s=zohoarc; b=c+taY8l6Wf3VU8137K4Y6xuIh5bq9fhuqQi+O1QN76t2Uhe0wRbv6Mq4TH7RUvm6a5xe68GsYM2ZgB06qWShGK3RvRVObMbw8S7aB5/r97mrjGo9smSq6OgV65tqwRYcjzx18qhYpBzZHu3xMrqJ14eIXjk0qPRyMDDtFo/3e4o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560779448; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ABa3dKzZNvYNsJ51T18GERyg/2n16YK7lTmbcx6wYu8=; b=KaeJFOZhsOXG96LOzd8lIpW4SZVcKhVGvY3S0cm7M8A9Q5V4qX8X95DfRVe2yoidcIt5v5W9wTNd8Mj+TO7plOTa3u7Zm9bxwt1oOVUKig725yZXZbK/UCP0MhRIctKOh7F4374nRLxz6FVgtRJTf94lGQ13Zx2UA9SksBNhoXo= ARC-Authentication-Results: i=1; mx.zoho.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 1560779448942872.0070632775096; Mon, 17 Jun 2019 06:50:48 -0700 (PDT) Received: from localhost ([::1]:47644 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcs1z-0006Ls-2i for importer@patchew.org; Mon, 17 Jun 2019 09:50:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32978) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcryJ-0004Mf-Ku for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:46:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcryH-0000dv-RI for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:46:55 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49422 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 1hcryH-0000d2-LL for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:46:53 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5HDbd45177623 for ; Mon, 17 Jun 2019 09:46:52 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2t6brv0wsh-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 17 Jun 2019 09:46:52 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Jun 2019 14:46:50 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 17 Jun 2019 14:46:48 +0100 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5HDklHu56164574 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jun 2019 13:46:47 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1DCCCA405F; Mon, 17 Jun 2019 13:46:47 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E3688A4060; Mon, 17 Jun 2019 13:46:46 +0000 (GMT) Received: from bahia.lan (unknown [9.145.14.35]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 17 Jun 2019 13:46:46 +0000 (GMT) From: Greg Kurz To: David Gibson Date: Mon, 17 Jun 2019 15:46:46 +0200 In-Reply-To: <156077918969.433243.1416211899441569578.stgit@bahia.lan> References: <156077918969.433243.1416211899441569578.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: 19061713-0016-0000-0000-00000289D1DA X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061713-0017-0000-0000-000032E71BBB Message-Id: <156077920657.433243.13541093940589972734.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-17_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=877 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906170126 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 3/6] xics/kvm: Skip rollback when KVM XICS is absent X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" There is no need to rollback anything at this point, so just return an error. Signed-off-by: Greg Kurz Reviewed-by: C=C3=A9dric Le Goater --- hw/intc/xics_kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index 534515143ea8..377ff88701c2 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -348,7 +348,7 @@ int xics_kvm_connect(SpaprMachineState *spapr, Error **= errp) if (!kvm_enabled() || !kvm_check_extension(kvm_state, KVM_CAP_IRQ_XICS= )) { error_setg(errp, "KVM and IRQ_XICS capability must be present for in-ker= nel XICS"); - goto fail; + return -1; } =20 rc =3D kvmppc_define_rtas_kernel_token(RTAS_IBM_SET_XIVE, "ibm,set-xiv= e"); From nobody Tue Nov 11 01:39:40 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 ARC-Seal: i=1; a=rsa-sha256; t=1560779638; cv=none; d=zoho.com; s=zohoarc; b=le2RawdPiGsMvZ9f2BbTRYbucNz/XL0V1QhRCsP0Jd1HUdhW04O0CAuMuAHLhzjf0TZNb4v7LUd66O9O3guQBPHEHDA+Gg5ZWEUalXwX0rnLg15eChLeizvpFkmwipIglmUODLgzwaKHua+nc8u6WyDdq5jqUyV/LyAJKhUtMaU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560779638; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=oEVuiNlUiaX6G/6TSPRRDuIhDVeuc8S85VO3WuYvjTE=; b=W1TGbdqXVDMgZlWedSA6hWIH9idLmqpC6YxrQepf65iWWLbFwnBUTY6qDNpPTYKYH6DnilMEJQq70YA3i2hVP39nwEK7ebo6YOK8dH8+0Ctwlt5o7iExmPRGnBUT3n3J/szCBG6WOs3XhgXfEeVQB+wj8rRLbbV/P6vaiqYxNf4= ARC-Authentication-Results: i=1; mx.zoho.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 1560779638204737.6604460053799; Mon, 17 Jun 2019 06:53:58 -0700 (PDT) Received: from localhost ([::1]:47676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcs57-0001qU-6a for importer@patchew.org; Mon, 17 Jun 2019 09:53:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33040) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcryY-0004Os-Qq for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:47:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcryU-0000nf-Ue for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:47:08 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:38434 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 1hcryN-0000hs-K1 for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:47:03 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5HDbT5R113979 for ; Mon, 17 Jun 2019 09:46:59 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2t6bj89ktd-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 17 Jun 2019 09:46:58 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Jun 2019 14:46:56 +0100 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 17 Jun 2019 14:46:53 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5HDkiHj30277956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jun 2019 13:46:44 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9A26E5204F; Mon, 17 Jun 2019 13:46:52 +0000 (GMT) Received: from bahia.lan (unknown [9.145.14.35]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 6C03D52050; Mon, 17 Jun 2019 13:46:52 +0000 (GMT) From: Greg Kurz To: David Gibson Date: Mon, 17 Jun 2019 15:46:52 +0200 In-Reply-To: <156077918969.433243.1416211899441569578.stgit@bahia.lan> References: <156077918969.433243.1416211899441569578.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: 19061713-0008-0000-0000-000002F47BC1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061713-0009-0000-0000-000022618DDE Message-Id: <156077921212.433243.11716701611944816815.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-17_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=837 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906170126 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 4/6] xics/kvm: Always use local_err in xics_kvm_init() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Passing both errp and &local_err to functions is a recipe for messing things up. Since we must use &local_err for icp_kvm_realize(), use &local_err everywhere where rollback must happen and have a single call to error_propagate() them all. While here, add errno to the error message. Signed-off-by: Greg Kurz Reviewed-by: C=C3=A9dric Le Goater --- hw/intc/xics_kvm.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index 377ff88701c2..c9e25fb051bb 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -353,32 +353,36 @@ int xics_kvm_connect(SpaprMachineState *spapr, Error = **errp) =20 rc =3D kvmppc_define_rtas_kernel_token(RTAS_IBM_SET_XIVE, "ibm,set-xiv= e"); if (rc < 0) { - error_setg(errp, "kvmppc_define_rtas_kernel_token: ibm,set-xive"); + error_setg_errno(&local_err, -rc, + "kvmppc_define_rtas_kernel_token: ibm,set-xive"); goto fail; } =20 rc =3D kvmppc_define_rtas_kernel_token(RTAS_IBM_GET_XIVE, "ibm,get-xiv= e"); if (rc < 0) { - error_setg(errp, "kvmppc_define_rtas_kernel_token: ibm,get-xive"); + error_setg_errno(&local_err, -rc, + "kvmppc_define_rtas_kernel_token: ibm,get-xive"); goto fail; } =20 rc =3D kvmppc_define_rtas_kernel_token(RTAS_IBM_INT_ON, "ibm,int-on"); if (rc < 0) { - error_setg(errp, "kvmppc_define_rtas_kernel_token: ibm,int-on"); + error_setg_errno(&local_err, -rc, + "kvmppc_define_rtas_kernel_token: ibm,int-on"); goto fail; } =20 rc =3D kvmppc_define_rtas_kernel_token(RTAS_IBM_INT_OFF, "ibm,int-off"= ); if (rc < 0) { - error_setg(errp, "kvmppc_define_rtas_kernel_token: ibm,int-off"); + error_setg_errno(&local_err, -rc, + "kvmppc_define_rtas_kernel_token: ibm,int-off"); goto fail; } =20 /* Create the KVM XICS device */ rc =3D kvm_create_device(kvm_state, KVM_DEV_TYPE_XICS, false); if (rc < 0) { - error_setg_errno(errp, -rc, "Error on KVM_CREATE_DEVICE for XICS"); + error_setg_errno(&local_err, -rc, "Error on KVM_CREATE_DEVICE for = XICS"); goto fail; } =20 @@ -393,7 +397,6 @@ int xics_kvm_connect(SpaprMachineState *spapr, Error **= errp) =20 icp_kvm_realize(DEVICE(spapr_cpu_state(cpu)->icp), &local_err); if (local_err) { - error_propagate(errp, local_err); goto fail; } } @@ -410,6 +413,7 @@ int xics_kvm_connect(SpaprMachineState *spapr, Error **= errp) return 0; =20 fail: + error_propagate(errp, local_err); kvmppc_define_rtas_kernel_token(0, "ibm,set-xive"); kvmppc_define_rtas_kernel_token(0, "ibm,get-xive"); kvmppc_define_rtas_kernel_token(0, "ibm,int-on"); From nobody Tue Nov 11 01:39:40 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 ARC-Seal: i=1; a=rsa-sha256; t=1560779820; cv=none; d=zoho.com; s=zohoarc; b=QxOG10ghBpX8rrj94dyPS+3B0rxxeEjP+rlNHulQFx9eliTH4I8TceJNYFOSnkMgtWAh3FUokKiLFMd/BtnaMhKYylcE7ed737CmklTRotmeHcQaDz4sC2NeXdBrYEpjblu1/SG1alCkp2w0LG71VdJMQVN0jqxyZHWO2eQSVDY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560779820; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Q44z6YegoN7gahjTILwUKwoyWqawuFTdJYTP0rb68p8=; b=dyDrqde6diAlaQLW4yN4qTioqsxcjnPtZvlxGjUCcewcf3/ad3K2/PhRiTyobsMMUr07RNzOu2ABFk9ng1iBr7wurxxfabKzcIjD4JzLaUrrcOIDkt/c13Kep1y0/0A/wuE8WpOV7m8xl+zDRIpPJXcksAhmz1Zbv8QvOzwh4BQ= ARC-Authentication-Results: i=1; mx.zoho.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 1560779820443292.93188607951106; Mon, 17 Jun 2019 06:57:00 -0700 (PDT) Received: from localhost ([::1]:47726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcs83-000516-84 for importer@patchew.org; Mon, 17 Jun 2019 09:56:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33075) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcrye-0004Pg-PM for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:47:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcryY-0000qc-Rq for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:47:14 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:55418) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hcryU-0000lN-VG for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:47:08 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5HDdUmi056952 for ; Mon, 17 Jun 2019 09:47:03 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2t6bmh143x-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 17 Jun 2019 09:47:02 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Jun 2019 14:47:00 +0100 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 17 Jun 2019 14:46:59 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5HDkw5439977374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jun 2019 13:46:58 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2EDD44C044; Mon, 17 Jun 2019 13:46:58 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F36FE4C040; Mon, 17 Jun 2019 13:46:57 +0000 (GMT) Received: from bahia.lan (unknown [9.145.14.35]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 17 Jun 2019 13:46:57 +0000 (GMT) From: Greg Kurz To: David Gibson Date: Mon, 17 Jun 2019 15:46:57 +0200 In-Reply-To: <156077918969.433243.1416211899441569578.stgit@bahia.lan> References: <156077918969.433243.1416211899441569578.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: 19061713-0008-0000-0000-000002F47BC6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061713-0009-0000-0000-000022618DE3 Message-Id: <156077921763.433243.4614327010172954196.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-17_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=818 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906170126 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 5/6] xics/kvm: Add error propagation to ic*_set_kvm_state() functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" This allows errors happening there to be propagated up to spapr_irq, just like XIVE already does. Signed-off-by: Greg Kurz Reviewed-by: C=C3=A9dric Le Goater --- hw/intc/xics.c | 39 ++++++++++++++++++++++++++++++++++----- hw/intc/xics_kvm.c | 37 ++++++++++++++++++++++--------------- include/hw/ppc/xics.h | 6 +++--- 3 files changed, 59 insertions(+), 23 deletions(-) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index 1dc3a0f12280..69152e3d9ff6 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -267,7 +267,14 @@ static int icp_post_load(void *opaque, int version_id) ICPState *icp =3D opaque; =20 if (kvm_irqchip_in_kernel()) { - return icp_set_kvm_state(icp); + Error *local_err =3D NULL; + int ret; + + ret =3D icp_set_kvm_state(icp, &local_err); + if (ret < 0) { + error_report_err(local_err); + return ret; + } } =20 return 0; @@ -300,7 +307,12 @@ static void icp_reset_handler(void *dev) qemu_set_irq(icp->output, 0); =20 if (kvm_irqchip_in_kernel()) { - icp_set_kvm_state(ICP(dev)); + Error *local_err =3D NULL; + + icp_set_kvm_state(ICP(dev), &local_err); + if (local_err) { + error_report_err(local_err); + } } } =20 @@ -555,7 +567,12 @@ static void ics_simple_reset(DeviceState *dev) icsc->parent_reset(dev); =20 if (kvm_irqchip_in_kernel()) { - ics_set_kvm_state(ICS_BASE(dev)); + Error *local_err =3D NULL; + + ics_set_kvm_state(ICS_BASE(dev), &local_err); + if (local_err) { + error_report_err(local_err); + } } } =20 @@ -671,7 +688,14 @@ static int ics_base_post_load(void *opaque, int versio= n_id) ICSState *ics =3D opaque; =20 if (kvm_irqchip_in_kernel()) { - return ics_set_kvm_state(ics); + Error *local_err =3D NULL; + int ret; + + ret =3D ics_set_kvm_state(ics, &local_err); + if (ret < 0) { + error_report_err(local_err); + return ret; + } } =20 return 0; @@ -757,8 +781,13 @@ void ics_set_irq_type(ICSState *ics, int srcno, bool l= si) lsi ? XICS_FLAGS_IRQ_LSI : XICS_FLAGS_IRQ_MSI; =20 if (kvm_irqchip_in_kernel()) { + Error *local_err =3D NULL; + ics_reset_irq(ics->irqs + srcno); - ics_set_kvm_state_one(ics, srcno); + ics_set_kvm_state_one(ics, srcno, &local_err); + if (local_err) { + error_report_err(local_err); + } } } =20 diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index c9e25fb051bb..4bfbe1a84092 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -106,7 +106,7 @@ void icp_synchronize_state(ICPState *icp) } } =20 -int icp_set_kvm_state(ICPState *icp) +int icp_set_kvm_state(ICPState *icp, Error **errp) { uint64_t state; int ret; @@ -126,10 +126,11 @@ int icp_set_kvm_state(ICPState *icp) | ((uint64_t)icp->pending_priority << KVM_REG_PPC_ICP_PPRI_SHIFT); =20 ret =3D kvm_set_one_reg(icp->cs, KVM_REG_PPC_ICP_STATE, &state); - if (ret !=3D 0) { - error_report("Unable to restore KVM interrupt controller state (0x= %" - PRIx64 ") for CPU %ld: %s", state, kvm_arch_vcpu_id(icp->c= s), - strerror(errno)); + if (ret < 0) { + error_setg_errno(errp, -ret, + "Unable to restore KVM interrupt controller state= (0x%" + PRIx64 ") for CPU %ld", state, + kvm_arch_vcpu_id(icp->cs)); return ret; } =20 @@ -240,10 +241,9 @@ void ics_synchronize_state(ICSState *ics) ics_get_kvm_state(ics); } =20 -int ics_set_kvm_state_one(ICSState *ics, int srcno) +int ics_set_kvm_state_one(ICSState *ics, int srcno, Error **errp) { uint64_t state; - Error *local_err =3D NULL; ICSIRQState *irq =3D &ics->irqs[srcno]; int ret; =20 @@ -278,16 +278,15 @@ int ics_set_kvm_state_one(ICSState *ics, int srcno) } =20 ret =3D kvm_device_access(kernel_xics_fd, KVM_DEV_XICS_GRP_SOURCES, - srcno + ics->offset, &state, true, &local_err); - if (local_err) { - error_report_err(local_err); + srcno + ics->offset, &state, true, errp); + if (ret < 0) { return ret; } =20 return 0; } =20 -int ics_set_kvm_state(ICSState *ics) +int ics_set_kvm_state(ICSState *ics, Error **errp) { int i; =20 @@ -297,10 +296,12 @@ int ics_set_kvm_state(ICSState *ics) } =20 for (i =3D 0; i < ics->nr_irqs; i++) { + Error *local_err =3D NULL; int ret; =20 - ret =3D ics_set_kvm_state_one(ics, i); - if (ret) { + ret =3D ics_set_kvm_state_one(ics, i, &local_err); + if (ret < 0) { + error_propagate(errp, local_err); return ret; } } @@ -402,12 +403,18 @@ int xics_kvm_connect(SpaprMachineState *spapr, Error = **errp) } =20 /* Update the KVM sources */ - ics_set_kvm_state(spapr->ics); + ics_set_kvm_state(spapr->ics, &local_err); + if (local_err) { + goto fail; + } =20 /* Connect the presenters to the initial VCPUs of the machine */ CPU_FOREACH(cs) { PowerPCCPU *cpu =3D POWERPC_CPU(cs); - icp_set_kvm_state(spapr_cpu_state(cpu)->icp); + icp_set_kvm_state(spapr_cpu_state(cpu)->icp, &local_err); + if (local_err) { + goto fail; + } } =20 return 0; diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index eb65ad7e43b7..1eb7b5cd6847 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -190,13 +190,13 @@ Object *icp_create(Object *cpu, const char *type, XIC= SFabric *xi, =20 /* KVM */ void icp_get_kvm_state(ICPState *icp); -int icp_set_kvm_state(ICPState *icp); +int icp_set_kvm_state(ICPState *icp, Error **errp); void icp_synchronize_state(ICPState *icp); void icp_kvm_realize(DeviceState *dev, Error **errp); =20 void ics_get_kvm_state(ICSState *ics); -int ics_set_kvm_state_one(ICSState *ics, int srcno); -int ics_set_kvm_state(ICSState *ics); +int ics_set_kvm_state_one(ICSState *ics, int srcno, Error **errp); +int ics_set_kvm_state(ICSState *ics, Error **errp); void ics_synchronize_state(ICSState *ics); void ics_kvm_set_irq(ICSState *ics, int srcno, int val); =20 From nobody Tue Nov 11 01:39:40 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 ARC-Seal: i=1; a=rsa-sha256; t=1560779736; cv=none; d=zoho.com; s=zohoarc; b=ghoYACTHJ42hwwEWkk5uwhnZgSnhHEp4mImYBos4L6PLP3Q4OjH5N8wlCgNUP0v4iiPRNcBqYCSGraZkMw8Xoc3HveahcEYovULolbMfrKv8mVdj1JNX+wVSrAorAefX58z+fwhlmV5T0Jb9UIqXwFUTezM86aMhOumAVbROMgU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560779736; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=rPLWmeBLlHM/OlMU8XyNZ0gwez1j+vAeMk5KjwWniAA=; b=Wa4bZeD6/Mlz74OC04NF9jl8OMzY2QBqZwtVBQEsLJjsnw5rBfgQKZHhBTovAPE4cAxAlFR9tGpwxrcwWnuWZ9/40T3YsUmdG+nFf0t65bAyHadrSkcGn/q5bXXfMoYCetMszm4j7jDz9TYLSsIUQRq+IsxonEdjyu65lISbsiI= ARC-Authentication-Results: i=1; mx.zoho.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 (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560779736022342.4959704974815; Mon, 17 Jun 2019 06:55:36 -0700 (PDT) Received: from localhost ([::1]:47684 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcs6b-0003GU-PG for importer@patchew.org; Mon, 17 Jun 2019 09:55:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33080) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcrye-0004Pr-Q5 for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:47:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcrya-0000sA-TY for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:47:15 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:39702 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 1hcryY-0000pE-Sc for qemu-devel@nongnu.org; Mon, 17 Jun 2019 09:47:10 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5HDbTUE113990 for ; Mon, 17 Jun 2019 09:47:08 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2t6bj89m1w-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 17 Jun 2019 09:47:08 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Jun 2019 14:47:06 +0100 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) 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) Mon, 17 Jun 2019 14:47:04 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5HDktEo35717558 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jun 2019 13:46:55 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B5400A405B; Mon, 17 Jun 2019 13:47:03 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 86C51A4057; Mon, 17 Jun 2019 13:47:03 +0000 (GMT) Received: from bahia.lan (unknown [9.145.14.35]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 17 Jun 2019 13:47:03 +0000 (GMT) From: Greg Kurz To: David Gibson Date: Mon, 17 Jun 2019 15:47:03 +0200 In-Reply-To: <156077918969.433243.1416211899441569578.stgit@bahia.lan> References: <156077918969.433243.1416211899441569578.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: 19061713-0012-0000-0000-00000329DB04 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061713-0013-0000-0000-00002162F2F0 Message-Id: <156077922319.433243.609897156640506891.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-17_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=929 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906170126 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 6/6] xics/kvm: Add proper rollback to xics_kvm_init() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Make xics_kvm_disconnect() able to undo the changes of a partial execution of xics_kvm_connect() and use it to perform rollback. Note that kvmppc_define_rtas_kernel_token(0) never fails, no matter the RTAS call has been defined or not. Signed-off-by: Greg Kurz Reviewed-by: C=C3=A9dric Le Goater --- hw/intc/xics_kvm.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index 4bfbe1a84092..51433b19b076 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -421,10 +421,7 @@ int xics_kvm_connect(SpaprMachineState *spapr, Error *= *errp) =20 fail: error_propagate(errp, local_err); - kvmppc_define_rtas_kernel_token(0, "ibm,set-xive"); - kvmppc_define_rtas_kernel_token(0, "ibm,get-xive"); - kvmppc_define_rtas_kernel_token(0, "ibm,int-on"); - kvmppc_define_rtas_kernel_token(0, "ibm,int-off"); + xics_kvm_disconnect(spapr, NULL); return -1; } =20 @@ -448,8 +445,10 @@ void xics_kvm_disconnect(SpaprMachineState *spapr, Err= or **errp) * removed from the list of devices of the VM. The VCPU presenters * are also detached from the device. */ - close(kernel_xics_fd); - kernel_xics_fd =3D -1; + if (kernel_xics_fd !=3D -1) { + close(kernel_xics_fd); + kernel_xics_fd =3D -1; + } =20 kvmppc_define_rtas_kernel_token(0, "ibm,set-xive"); kvmppc_define_rtas_kernel_token(0, "ibm,get-xive");