From nobody Mon Apr 29 11:35:58 2024 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=1569427974; cv=none; d=zoho.com; s=zohoarc; b=UGHPFEJCNeRCe0DRdKfF0/3ku2M4lWf0SNuSgO/OipGkEw5JYpKotQSAnQJoQ8Qb2dgQUuIHpL5M9BlT+SEgcV8eGXnF9M3dYbVpusPVs9AWS5D6ZCZQhkFPaMioLQfFlIkzCo/iVqwgA6zmY8koJv/5F6FoU4uuZ6Xaq5JOdWE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569427974; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=BDQDpQeaxphuPrb4hfaKuyjkhfuCttPDxlRUe1v9nRc=; b=T6vVkl9zmL1AC6s59ZjWa6d3s38ZP4OZztR4AmfRZ6MlAp35+hFKTtnbCOHScWPnrjuquOiMqtA2kK12XaRrMw0+FyJ9/a1kgRgSbx5WZVsrUUyAKvMX1v7W6xrDwd/UUPxUGgHVKgTg7S6i4j0pKBTmVmpz3StmOp9UQGJqdYE= 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 1569427974285522.9322003800959; Wed, 25 Sep 2019 09:12:54 -0700 (PDT) Received: from localhost ([::1]:54512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iD9uO-0004q9-Sq for importer@patchew.org; Wed, 25 Sep 2019 12:12:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40146) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iD9pV-0007cZ-ED for qemu-devel@nongnu.org; Wed, 25 Sep 2019 12:07:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iD9pU-0007io-Cs for qemu-devel@nongnu.org; Wed, 25 Sep 2019 12:07:49 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:38788 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 1iD9pU-0007iQ-7w for qemu-devel@nongnu.org; Wed, 25 Sep 2019 12:07:48 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8PG7X3X132472 for ; Wed, 25 Sep 2019 12:07:46 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2v8asb9v2u-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 25 Sep 2019 12:07:46 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Sep 2019 17:07:44 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) 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) Wed, 25 Sep 2019 17:07:41 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8PG7eEY23396438 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Sep 2019 16:07:40 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AFB3DA404D; Wed, 25 Sep 2019 16:07:40 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 796D1A4051; Wed, 25 Sep 2019 16:07:40 +0000 (GMT) Received: from bahia.lan (unknown [9.145.186.179]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 25 Sep 2019 16:07:40 +0000 (GMT) Subject: [PATCH] spapr/irq: Fix migration of older machine types with XIVE From: Greg Kurz To: David Gibson , =?utf-8?q?C=C3=A9dric?= Le Goater Date: Wed, 25 Sep 2019 18:07:40 +0200 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: 19092516-0016-0000-0000-000002B08883 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19092516-0017-0000-0000-000033115191 Message-Id: <156942766014.1274533.10792048853177121231.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-09-25_07:, , 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=809 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909250147 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 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, Satheesh Rajendran , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Recent patch "spapr/irq: Only claim VALID interrupts at the KVM level" broke migration of older machine types started with ic-mode=3Dxive: qemu-system-ppc64: KVM_SET_DEVICE_ATTR failed: Group 3 attr 0x0000000000001= 300: Invalid argument qemu-system-ppc64: error while loading state for instance 0x0 of device 'sp= apr' qemu-system-ppc64: load of migration failed: Operation not permitted This is because we should set the interrupt source in KVM at post load, since we no longer do it unconditionaly at reset time for all interrupts. Signed-off-by: Greg Kurz --- David, I guess you should probably fold this fix directly into Cedric's patch (currently SHA1 966d526cdfd9 in ppc-for-4.2) to avoid bisection breakage. --- hw/intc/spapr_xive_kvm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c index 71b88d7797bc..2006f96aece1 100644 --- a/hw/intc/spapr_xive_kvm.c +++ b/hw/intc/spapr_xive_kvm.c @@ -678,6 +678,17 @@ int kvmppc_xive_post_load(SpaprXive *xive, int version= _id) continue; } =20 + /* + * We can only restore the source config if the source has been + * previously set in KVM. Since we don't do that for all interrupts + * at reset time anymore, let's do it now. + */ + kvmppc_xive_source_reset_one(&xive->source, i, &local_err); + if (local_err) { + error_report_err(local_err); + return -1; + } + kvmppc_xive_set_source_config(xive, i, &xive->eat[i], &local_err); if (local_err) { error_report_err(local_err);