From patchwork Mon Jan 15 18:54:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Krowiak X-Patchwork-Id: 13520090 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6BEBB18657; Mon, 15 Jan 2024 18:54:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="nGuBSvy6" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 40FFgAPe008011; Mon, 15 Jan 2024 18:54:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=rHd/xy0O3+rLTvRRGJbasTaa+/W1+RiXzR3Vt5gNfIg=; b=nGuBSvy6BNhe1IwSu9jCd5kJ69qrfSSQ3YjJfigKKBQYlpt0vqvjCNdQt2TNJbkEIo+C M54milHZFDbxaTHeJduVn3CxgGoMvBOIq6MvxXmFXAEu9i4TQ57T9Bkx8gtrSNK3sVFj vgjGGcsxnweOA/DLNRMmzWHFnzVYNed0c2yCdIxbiwHzhM9GcYbwBIgBjMdW3tQe3XDW 07iS2iIPEXHI0DO/qqieQNCdX+mSVDkHlqIV4UKfzRxqMcXGUgQ6pPtvpatMoMHqTw9C IsTX4+esIDne/Q8x8rXGQLPxw3UK5gvjI0dp6yGl7PesUtiSyYISHoxH1LwHhqrcOELS 3Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3vmac0sft7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Jan 2024 18:54:45 +0000 Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 40FIsi3Q009799; Mon, 15 Jan 2024 18:54:44 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3vmac0sft2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Jan 2024 18:54:44 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 40FHo3I6018637; Mon, 15 Jan 2024 18:54:44 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([172.16.1.70]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3vm5una03r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Jan 2024 18:54:44 +0000 Received: from smtpav04.dal12v.mail.ibm.com (smtpav04.dal12v.mail.ibm.com [10.241.53.103]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 40FIsgSu14680816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Jan 2024 18:54:43 GMT Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B50C15805E; Mon, 15 Jan 2024 18:54:42 +0000 (GMT) Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CAFD558052; Mon, 15 Jan 2024 18:54:41 +0000 (GMT) Received: from li-2c1e724c-2c76-11b2-a85c-ae42eaf3cb3d.ibm.com.com (unknown [9.61.164.202]) by smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTP; Mon, 15 Jan 2024 18:54:41 +0000 (GMT) From: Tony Krowiak To: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: jjherne@linux.ibm.com, borntraeger@de.ibm.com, pasic@linux.ibm.com, pbonzini@redhat.com, frankja@linux.ibm.com, imbrenda@linux.ibm.com, alex.williamson@redhat.com, kwankhede@nvidia.com, agordeev@linux.ibm.com, gor@linux.ibm.com Subject: [PATCH v4 0/6] s390/vfio-ap: reset queues removed from guest's AP configuration Date: Mon, 15 Jan 2024 13:54:30 -0500 Message-ID: <20240115185441.31526-1-akrowiak@linux.ibm.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: mI0VXlyUpmFKrja69PUEDatiLDcaq5O- X-Proofpoint-ORIG-GUID: VwODC6uVC1hRyx8pj-OEBOvOqtkQ677x X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-15_13,2024-01-15_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=0 impostorscore=0 adultscore=0 lowpriorityscore=0 spamscore=0 malwarescore=0 priorityscore=1501 mlxscore=0 mlxlogscore=986 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2401150139 All queues removed from a guest's AP configuration must be reset so when they are subsequently made available again to a guest, they re-appear in a reset state. There are some scenarios where this is not the case. For example, if a queue device that is passed through to a guest is unbound from the vfio_ap device driver, the adapter to which the queue is attached will be removed from the guest's AP configuration. Doing so implicitly removes all queues associated with that adapter because the AP architecture precludes removing a single queue. Those queues also need to be reset. This patch series ensures that all queues removed from a guest's AP configuration are reset for all possible scenarios. Changelog v1=> v2: ----------------- * Fixed CHECKPATCH errors * Added line between description and Acked-by in patch 5/6 Tony Krowiak (6): s390/vfio-ap: always filter entire AP matrix s390/vfio-ap: loop over the shadow APCB when filtering guest's AP configuration s390/vfio-ap: let 'on_scan_complete' callback filter matrix and update guest's APCB s390/vfio-ap: reset queues filtered from the guest's AP config s390/vfio-ap: reset queues associated with adapter for queue unbound from driver s390/vfio-ap: do not reset queue removed from host config drivers/s390/crypto/vfio_ap_ops.c | 268 +++++++++++++++++--------- drivers/s390/crypto/vfio_ap_private.h | 11 +- 2 files changed, 184 insertions(+), 95 deletions(-)