From nobody Sat May 4 22:52:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=de.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1585313267; cv=none; d=zohomail.com; s=zohoarc; b=DmnzUc7HSYkMY1k9ElYu67my+ruem2Hd3MK3FsBhgU2zdvtxhPVNrq3xNTiRN7MqJRwFonBVBGK70wNA6gIhy0lxK7IjyGeBJ/wQUp39vjTR27k2yEZp7NnjLntprnSMjeHZ+2OBd1ef1xT9clPUahn89oJH9kr6LusxOEmEtr4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585313267; h=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; bh=UUCxoEI0PQqld47bIvYyn8grsS1boAAw+mBnLaCMQSk=; b=i6ufZMfDArQyCkZYDyaELO+Xm4DTAfaMWGZR//QFEjaX+knWEtSgaI5uu0SQKH/qYSW6ibSXoPk5BvSNuJgu2lDDyRNBKhqUbgYAD6cHg9bUgOooJlnlZucQuychdbtsnhlbFrqJgUNHeRpiHUjxyK/eAAlGtDa1LcMH7Z4+T5g= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585313267166655.912657809354; Fri, 27 Mar 2020 05:47:47 -0700 (PDT) Received: from localhost ([::1]:41360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHoOn-0000T5-Gj for importer@patchew.org; Fri, 27 Mar 2020 08:47:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36723) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHoNU-00080j-4t for qemu-devel@nongnu.org; Fri, 27 Mar 2020 08:46:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHoNR-0004Un-KO for qemu-devel@nongnu.org; Fri, 27 Mar 2020 08:46:23 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:22600 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 1jHoNQ-0004R1-Kc; Fri, 27 Mar 2020 08:46:21 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02RCX0d8039782; Fri, 27 Mar 2020 08:46:19 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ywewxuvmh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Mar 2020 08:46:19 -0400 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 02RCXD9m041450; Fri, 27 Mar 2020 08:46:19 -0400 Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ywewxuvm6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Mar 2020 08:46:19 -0400 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 02RCjh9m010533; Fri, 27 Mar 2020 12:46:18 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma05wdc.us.ibm.com with ESMTP id 2ywawg26k1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Mar 2020 12:46:18 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02RCkItu49611250 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Mar 2020 12:46:18 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1D5B5124055; Fri, 27 Mar 2020 12:46:18 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 02C2D124053; Fri, 27 Mar 2020 12:46:17 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.17.106]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 27 Mar 2020 12:46:17 +0000 (GMT) From: Christian Borntraeger To: qemu-devel , Cornelia Huck Subject: [PATCH v2] s390x/pv: Retry ioctls on -EINTR Date: Fri, 27 Mar 2020 08:46:16 -0400 Message-Id: <20200327124616.34866-1-borntraeger@de.ibm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-27_04:2020-03-27, 2020-03-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 spamscore=0 clxscore=1015 malwarescore=0 impostorscore=0 bulkscore=0 phishscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003270111 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] 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: Janosch Frank , Janosch Frank , David Hildenbrand , Halil Pasic , Christian Borntraeger , qemu-s390x , Marc Hartmayer , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" PV_ENABLE (and maybe others) might return -EINTR when a signal is pending. See the Linux kernel patch "s390/gmap: return proper error code on ksm unsharing" for details. Let us retry the ioctl in that case. Fixes: 4d226deafc44 ("s390x: protvirt: Support unpack facility") Reported-by: Marc Hartmayer Acked-by: Janosch Frank Tested-by: Marc Hartmayer Signed-off-by: Christian Borntraeger --- hw/s390x/pv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/s390x/pv.c b/hw/s390x/pv.c index 8cf5cd2c9b..d3333d6e13 100644 --- a/hw/s390x/pv.c +++ b/hw/s390x/pv.c @@ -23,7 +23,11 @@ static int __s390_pv_cmd(uint32_t cmd, const char *cmdna= me, void *data) .cmd =3D cmd, .data =3D (uint64_t)data, }; - int rc =3D kvm_vm_ioctl(kvm_state, KVM_S390_PV_COMMAND, &pv_cmd); + int rc; + + do { + rc =3D kvm_vm_ioctl(kvm_state, KVM_S390_PV_COMMAND, &pv_cmd); + } while (rc =3D=3D -EINTR); =20 if (rc) { error_report("KVM PV command %d (%s) failed: header rc %x rrc %x " --=20 2.25.1