Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp551802pxu; Thu, 26 Nov 2020 05:39:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzZKgocvjsXp7HXXIoRRn7dO/kT6B5h6UnhxQq0bK8z8NTidFJfzWQsrZBUtClJrGgcV46 X-Received: by 2002:a17:906:71d3:: with SMTP id i19mr2718520ejk.187.1606397973656; Thu, 26 Nov 2020 05:39:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606397973; cv=none; d=google.com; s=arc-20160816; b=V/xEyjSwNYNt65EHghTjZk+B30pWgvEIXIE4pUJovnxQEVJaeijbs4TVuk8ovBOwH6 lJi1TD2Z7XcryA7cV87i5YVW27nPdHuBybN+DXyB0cnPiR0gyAXVfILR9UDg6iL8f06Q GjZ+Z0InrkYhxUnnNsgjM0h8ViE8OJe7H1boWb7XiSRJCxNil1dlsScWSzj2JPOBVA1/ hInML0JL/BNaoJCQMckpK9P2EQqv6tuuL1CkE+Kh9PprA8w09eKsBT3RjARz072qvvK2 qF/NkdCC2wZlMmE75m/EAB3fAF6DfaAUuRasZB8Jo3CyqWcsAQ+dGarIb1jOsU83i1LK u6TA== 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=WSfkROi48m72xER+NaUnW8SnHhGr58DL6BR1O3Z2HfE=; b=Ma248ix8083lwc3wpemEQ2IX8LZGGoYIyqdl3AvoYfdFDeHkYq0wAFP9CrPVseN9AF 6E3ZFZz3DEKWEUu1YgwKTJL5sGulLZ1bDExszmw8R35YMjnkhgYDlVNDUALOlrKpLULY hmknP5X2pzlUJKD5x+BkULHBeIqPG1NTyCDmjyQ/anaxBnD21DIz/0SvDzqr8ac+Qk2j gMKY38OzcXDZONRO2nls20z6nOZ4L+a+mUsRgDdBDsIjST9DD072rSJ+/gcVPdtNBBvH aonrwuWTn8iRBGd4S1kg39Ugv9RuiaKkIjuGRkgwNGuMycZHeR7qe9SZafHyLwIUv67b /e4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=WmbMh72g; 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 y15si359154ejp.228.2020.11.26.05.39.10; Thu, 26 Nov 2020 05:39:33 -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=WmbMh72g; 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 S2390022AbgKZNhr (ORCPT + 99 others); Thu, 26 Nov 2020 08:37:47 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:62270 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389919AbgKZNhq (ORCPT ); Thu, 26 Nov 2020 08:37:46 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0AQDWBSV166420; Thu, 26 Nov 2020 08:37:43 -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=WSfkROi48m72xER+NaUnW8SnHhGr58DL6BR1O3Z2HfE=; b=WmbMh72gkMsyG/gHCfLMLQHNFpWfLKLn03+PX5sRZMz0zRPN0J7UqSjY1kfZ7SW7JxBW y4uxgrWF07qvIPnnWKrwsabYKwTA7HJu2KSl/qgv4NOB17ushmvIjCnYqVNl286qAJPH +hUfqn+EYA+PpJVot0LCguIsXhTUE+7mLbBMlRP5+ka/0Lh5ztq9YNme/vcloHtiiSug 02B2un7sS26PAT5IdIByy4SGzpmNYESqYYkNBFsgx87lHZ0NbK7D8GKUr5vXGd3J2vOT 8EC6wyATQGmGln773Ndl8OUTWS5YWRuxYltR2LuFN/lwLt9XGpkXZ83LW9P3Fm8XhbBF kQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3527ys1fkg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Nov 2020 08:37:43 -0500 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0AQDXKoB170447; Thu, 26 Nov 2020 08:37:43 -0500 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 3527ys1fjk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Nov 2020 08:37:43 -0500 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0AQDX2AM025464; Thu, 26 Nov 2020 13:37:41 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma03ams.nl.ibm.com with ESMTP id 34xth8dndw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Nov 2020 13:37:41 +0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0AQDbciW59244862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Nov 2020 13:37:38 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0F7A342047; Thu, 26 Nov 2020 13:37:38 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 44F4542041; Thu, 26 Nov 2020 13:37:37 +0000 (GMT) Received: from oc2783563651 (unknown [9.171.0.176]) by d06av24.portsmouth.uk.ibm.com (Postfix) with SMTP; Thu, 26 Nov 2020 13:37:37 +0000 (GMT) Date: Thu, 26 Nov 2020 14:37:35 +0100 From: Halil Pasic To: Tony Krowiak Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, freude@linux.ibm.com, borntraeger@de.ibm.com, cohuck@redhat.com, mjrosato@linux.ibm.com, alex.williamson@redhat.com, kwankhede@nvidia.com, fiuczy@linux.ibm.com, frankja@linux.ibm.com, david@redhat.com, hca@linux.ibm.com, gor@linux.ibm.com Subject: Re: [PATCH v12 04/17] s390/vfio-ap: No need to disable IRQ after queue reset Message-ID: <20201126143735.65e5d5e8.pasic@linux.ibm.com> In-Reply-To: <20201124214016.3013-5-akrowiak@linux.ibm.com> References: <20201124214016.3013-1-akrowiak@linux.ibm.com> <20201124214016.3013-5-akrowiak@linux.ibm.com> Organization: IBM X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-11-26_04:2020-11-26,2020-11-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 phishscore=0 spamscore=0 malwarescore=0 suspectscore=2 bulkscore=0 impostorscore=0 adultscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011260078 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 24 Nov 2020 16:40:03 -0500 Tony Krowiak wrote: > The queues assigned to a matrix mediated device are currently reset when: > > * The VFIO_DEVICE_RESET ioctl is invoked > * The mdev fd is closed by userspace (QEMU) > * The mdev is removed from sysfs. > > Immediately after the reset of a queue, a call is made to disable > interrupts for the queue. This is entirely unnecessary because the reset of > a queue disables interrupts, so this will be removed. > > Signed-off-by: Tony Krowiak Reviewed-by: Halil Pasic As I said previously, I would prefer the cleanup of the airq resources being part of reset_queue(), but I can propose that later. > --- > drivers/s390/crypto/vfio_ap_ops.c | 28 +++++----------------------- > 1 file changed, 5 insertions(+), 23 deletions(-) > > diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c > index 8e6972495daa..dc699fd54505 100644 > --- a/drivers/s390/crypto/vfio_ap_ops.c > +++ b/drivers/s390/crypto/vfio_ap_ops.c > @@ -26,14 +26,6 @@ > > static int vfio_ap_mdev_reset_queues(struct mdev_device *mdev); > > -static int match_apqn(struct device *dev, const void *data) > -{ > - struct vfio_ap_queue *q = dev_get_drvdata(dev); > - > - return (q->apqn == *(int *)(data)) ? 1 : 0; > -} > - > - > /** > * vfio_ap_get_queue: Retrieve a queue with a specific APQN. > * @matrix_mdev: the associated mediated matrix > @@ -1121,20 +1113,6 @@ static int vfio_ap_mdev_group_notifier(struct notifier_block *nb, > return NOTIFY_OK; > } > > -static void vfio_ap_irq_disable_apqn(int apqn) > -{ > - struct device *dev; > - struct vfio_ap_queue *q; > - > - dev = driver_find_device(&matrix_dev->vfio_ap_drv->driver, NULL, > - &apqn, match_apqn); > - if (dev) { > - q = dev_get_drvdata(dev); > - vfio_ap_irq_disable(q); > - put_device(dev); > - } > -} > - > static int vfio_ap_mdev_reset_queue(unsigned int apid, unsigned int apqi, > unsigned int retry) > { > @@ -1169,6 +1147,7 @@ static int vfio_ap_mdev_reset_queues(struct mdev_device *mdev) > { > int ret; > int rc = 0; > + struct vfio_ap_queue *q; > unsigned long apid, apqi; > struct ap_matrix_mdev *matrix_mdev = mdev_get_drvdata(mdev); > > @@ -1184,7 +1163,10 @@ static int vfio_ap_mdev_reset_queues(struct mdev_device *mdev) > */ > if (ret) > rc = ret; > - vfio_ap_irq_disable_apqn(AP_MKQID(apid, apqi)); > + > + q = vfio_ap_get_queue(matrix_mdev, AP_MKQID(apid, apqi); > + if (q) > + vfio_ap_free_aqic_resources(q); > } > } >