Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1146700pxb; Thu, 4 Mar 2021 04:41:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+8z7XLMWWOlhxAQTNZwaILRSB8mNbjwcIlX+PgDN2PCF7KKqljyEWMzqhefWVin/jOr0m X-Received: by 2002:a17:906:86c6:: with SMTP id j6mr3809110ejy.197.1614861712989; Thu, 04 Mar 2021 04:41:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614861712; cv=none; d=google.com; s=arc-20160816; b=U3qZ6pLdwATVd9S9qL1Vvy6PBeAt2eXNk4o+LRtqLuj2A/UOuw5nyrblNjSh2pl/u0 K+g7qVVXkMZcN6lkDwlEfc61RMdIVuJjPBuvMC5evvbm5rdU09tY8EMnC//nx76bHUCj 0Qtpc4Rl5B2kUm8Adp1jRoVisLjC/fesMruhDm1/7nnm+8t0/3vm/GRsLhe1Ay7DarHW Y/heMcf8/io4PTkzL+EgsVsRReBQrK1yV5fpcerRVLhX38z7nAmspaNApFEwCk86cecj Cv/z9G8DC6H/feK07oV8DHmh1RER6HTEDhD3fG5bS0XiHkvuEmLoZMyEVanxAMogIxFL MUJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=IacLFA3LbjrQQztZFwWNWxbRWKqrcud7frA8MSdgJyA=; b=xAg6o6vkI7KOIdOdsiggIXfGazn5mRTu2z2ZyxPelTrw+av1Z7n0NKCnU/ucEzk/BY sWcwbGob3MzxZVQGUZmLuduBVe6kmeZ1qcue/kA/zxEBA1H71YIxrakvCYCpuUlvSWEv +thxFmSQhfl2hIz2rEnsstH9/q+9bXtSJC8un/WdBpRoDbNbcOjLJEBE2PSl3GIH63AG 287HAcDX3IWuWnryXfLHhY5iBjKEiM2IYTnIGV7B70umOdr8+B2FB7JItRsRZlSBYd+d b59UzhiCbx8XUMFSfGTK5/FplKgCupK0RPA0AwzL/OZx7v8Wrqfn+nqn5f/xPtZov5hl zX9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="ci/LRfIO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw19si8348092edb.211.2021.03.04.04.41.30; Thu, 04 Mar 2021 04:41:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="ci/LRfIO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232473AbhCCX7w (ORCPT + 99 others); Wed, 3 Mar 2021 18:59:52 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:51012 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376265AbhCCTnD (ORCPT ); Wed, 3 Mar 2021 14:43:03 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 123JXHUP016729; Wed, 3 Mar 2021 14:42:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=IacLFA3LbjrQQztZFwWNWxbRWKqrcud7frA8MSdgJyA=; b=ci/LRfIOFF4Ct1fLMiLuVWxzdzuYi9MgpI1+vS9YSz3sR+lbScx0qZ3f+nNQM0bRgvow uv6BGQhrCnDvv61pZ2lw9bZN9CrPOK4HtX4tkfbMbVmMRwedk0EdL6nBaN4sguSLAByV AliliIs10mCMgO9CwpagO2vx2Jx+fn89KoxUnzRpgjC+E9agYAczPqujh8Mn5UyRmImH +hOMGMV221J8zdqlmRALBJ8HIP/AxQs9nbVKGdob02XTcwF7wKb6LAxU08J4dpM3K253 VSqIiOyU2cceDFeHLPhWzJfUKT6X/i+v4Pv/X37M/11l/cR5fAbLuM0E6GxOzNE3/MZd oQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 372gpc889n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Mar 2021 14:42:19 -0500 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 123JYEHY021490; Wed, 3 Mar 2021 14:42:19 -0500 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 372gpc888w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Mar 2021 14:42:19 -0500 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 123Jb7X3004532; Wed, 3 Mar 2021 19:42:16 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma04ams.nl.ibm.com with ESMTP id 3712fmj2mr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Mar 2021 19:42:16 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 123JgDYL9372026 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 3 Mar 2021 19:42:14 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D16C45204E; Wed, 3 Mar 2021 19:42:13 +0000 (GMT) Received: from li-e979b1cc-23ba-11b2-a85c-dfd230f6cf82 (unknown [9.171.0.197]) by d06av21.portsmouth.uk.ibm.com (Postfix) with SMTP id 1FCF15204F; Wed, 3 Mar 2021 19:42:13 +0000 (GMT) Date: Wed, 3 Mar 2021 20:42:11 +0100 From: Halil Pasic To: Tony Krowiak Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, stable@vger.kernel.org, borntraeger@de.ibm.com, cohuck@redhat.com, kwankhede@nvidia.com, pbonzini@redhat.com, alex.williamson@redhat.com, pasic@linux.vnet.ibm.com Subject: Re: [PATCH v3 1/1] s390/vfio-ap: fix circular lockdep when setting/clearing crypto masks Message-ID: <20210303204211.4c021c25.pasic@linux.ibm.com> In-Reply-To: References: <20210302204322.24441-1-akrowiak@linux.ibm.com> <20210302204322.24441-2-akrowiak@linux.ibm.com> <20210303162332.4d227dbe.pasic@linux.ibm.com> Organization: IBM X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-03-03_06:2021-03-03,2021-03-03 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 mlxlogscore=969 phishscore=0 spamscore=0 priorityscore=1501 impostorscore=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103030137 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 3 Mar 2021 11:41:22 -0500 Tony Krowiak wrote: > > How do you exect userspace to react to this -ENODEV? > > The VFIO_DEVICE_RESET ioctl expects a return code. > The vfio_ap_mdev_reset_queues() function can return -EIO or > -EBUSY, so I would expect userspace to handle -ENODEV > similarly to -EIO or any other non-zero return code. I also > looked at all of the VFIO_DEVICE_RESET calls from QEMU to see > how the return from the ioctl call is handled: > > * ap: reports the reset failed along with the rc And carries on as if nothing happened. There is not much smart userspace can do in such a situation. Therefore the reset really should not fail. Please note that in this particular case, if the userspace would opt for a retry, we would most likely end up in a retry loop. > * ccw: doesn't check the rc > * pci: kind of hard to follow without digging deep, but definitely >          handles non-zero rc. > > I think the caller should be notified whether the queues were > successfully reset or not, and why; in this case, the answer is > there are no devices to reset. That is the wrong answer. The ioctl is supposed to reset the ap_matrix_mdev device. The ap_matrix_mdev device still exists. Thus returning -ENODEV is bugous. Regards, Halil