Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3122560iob; Mon, 16 May 2022 13:40:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrATdYCl7goNrovQNq/Zs56iuOHPqAQKtuKaa472CNU/Vf6SwVrVvqnsB+BtYcZiTvVutr X-Received: by 2002:a17:907:8a1f:b0:6f4:b5fb:e1c8 with SMTP id sc31-20020a1709078a1f00b006f4b5fbe1c8mr16566282ejc.240.1652733633183; Mon, 16 May 2022 13:40:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652733633; cv=none; d=google.com; s=arc-20160816; b=f+5dMRaeCL/W0QkfQfWEkywunowX0pd8lNgQeWXdSnGP7qKnauKJGtiJc5EvtztO5e S/2GS/DihU6+as3tein45Do5PNbcDYJN8gUH1yhMItfQpCmGBKmwBkaVMHdDg9Li7GgM uxHiP4HCyQPEehUTFnerVsN9QScy0CPxw2EOyW4KQqVCtZE/Z0kzVOk9oo5qE3AdnzQy 1C0eFuweDAlkgHjnBl1R2QNbHajvyZv5M76nQ8+ubYqN9bINJ/zIMEWZo5QHTHPbWQI2 ivQKAPXkRFQQPxz7b6OakvO13IPVaHztqTJjFmdOHk83MZDYhjVRpfTgFuFiz2iLI4aS OlTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=DzrZdpcDRLuxvldPjzyqpu8L+H3FzZFhPx9Zm0YN8io=; b=zkKvjQcCKXg4xhimLdLZylDJz/AdUjo3f4DtO/ug2tQMc7ZQlQNQXdJjlThlFMJGRF duEdDM7a5v3OnfwU4N1vaZR5O0hBtfxPecZGLt5cPMo6NgvGIsrVqudX7tzJUKrQ4xBa Q/0BNIh7PMeAUnvrzUS1xYaDwj5J0FLalXbDfMh27gy9xB69bbgNqQiHMcCKDjgb4Ifh kaLp83k+02pM6zU5n7UZUJ+AgfDrv3IgQ8giPgMMmmjb8ILj0ml0hO2w55B1Uk7x/88v 8dqPn9HIgRkw6O7L4bzhcGr4vAXO/z/f2U6Ff4zcRWFzLjvfzCk5/oqHw+iHE0vp332B aI3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=ACMpP0iP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg6-20020a170907a40600b006f863e61b2esi428942ejc.563.2022.05.16.13.40.07; Mon, 16 May 2022 13:40:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=ACMpP0iP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1344128AbiEPRNx (ORCPT + 99 others); Mon, 16 May 2022 13:13:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344110AbiEPRNw (ORCPT ); Mon, 16 May 2022 13:13:52 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C96A1326F9; Mon, 16 May 2022 10:13:50 -0700 (PDT) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24GFJn72004984; Mon, 16 May 2022 17:13:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=DzrZdpcDRLuxvldPjzyqpu8L+H3FzZFhPx9Zm0YN8io=; b=ACMpP0iP8samQDSf17L7q7OrTKW6CnrFPfTjORK7Sshv/CIZ4xqzO3zVyHMkZHlo/H0N nVNmLS0v3I2CIigjVoZZvKCgUEBDIdWl+tQQi+w8Rq8lH4j5JhuFc4c4DgukLfgY2oPN YJjKs5J6RmY2SgCu+RSyJdMPJghlq2mnF/sHxy/RqvwBkH0gbnbyKKWL6HaAnDNpPHhg ZfKmr18cSyap5Q57IoTp2gkv5oq7DfC2F6NYV5ij/Y5YYhTjFYL/wF/Olc+E3kUkFQ06 atMxyAm4Tlnadz4gyHRmMhFddwMlAT5ZXAmDkJKZ967bqj/NvpJFv/KTpu2UmjrJ9LCk gg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3g3s5at9p6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 May 2022 17:13:47 +0000 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 24GGm8lo024197; Mon, 16 May 2022 17:13:47 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3g3s5at9p0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 May 2022 17:13:47 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 24GHDf6w026882; Mon, 16 May 2022 17:13:46 GMT Received: from b03cxnp07027.gho.boulder.ibm.com (b03cxnp07027.gho.boulder.ibm.com [9.17.130.14]) by ppma02dal.us.ibm.com with ESMTP id 3g242a3ha0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 May 2022 17:13:46 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 24GHDj8H22085898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 May 2022 17:13:45 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4CD6B6A058; Mon, 16 May 2022 17:13:45 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 469B96A04D; Mon, 16 May 2022 17:13:44 +0000 (GMT) Received: from [9.65.254.31] (unknown [9.65.254.31]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 16 May 2022 17:13:44 +0000 (GMT) Message-ID: <62668577-bf0c-eda5-56a0-9ca56e5f9ce6@linux.ibm.com> Date: Mon, 16 May 2022 13:13:43 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v19 05/20] s390/vfio-ap: refresh guest's APCB by filtering AP resources assigned to mdev Content-Language: en-US To: jjherne@linux.ibm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: freude@linux.ibm.com, borntraeger@de.ibm.com, cohuck@redhat.com, mjrosato@linux.ibm.com, pasic@linux.ibm.com, alex.williamson@redhat.com, kwankhede@nvidia.com, fiuczy@linux.ibm.com References: <20220404221039.1272245-1-akrowiak@linux.ibm.com> <20220404221039.1272245-6-akrowiak@linux.ibm.com> From: Tony Krowiak In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: i91RkiB7fX-xeHhOrYTMaIuRYpA-_TYu X-Proofpoint-GUID: 3_4dAFx8Tehub2sjs0nkpNHIw-iy7ucL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-16_15,2022-05-16_02,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 clxscore=1011 adultscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 priorityscore=1501 malwarescore=0 spamscore=0 impostorscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205160094 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/16/22 12:36 PM, Jason J. Herne wrote: > On 4/4/22 18:10, Tony Krowiak wrote: >> |@@ -1306,8 +1392,6 @@ static int vfio_ap_mdev_set_kvm(struct >> ap_matrix_mdev *matrix_mdev, kvm_get_kvm(kvm); matrix_mdev->kvm = >> kvm; - memcpy(&matrix_mdev->shadow_apcb, &matrix_mdev->matrix, - >> sizeof(struct ap_matrix)); kvm_arch_crypto_set_masks(kvm, >> matrix_mdev->shadow_apcb.apm, matrix_mdev->shadow_apcb.aqm, >> matrix_mdev->shadow_apcb.adm);| > > This looks like an unrelated change. Does this snippet really belong > to this patch? It's kind of hard to tell which snippet you are talking about without the patch context, but I assume you are referring to the removal of the memcpy statement in the vfio_ap_mdev_set_kvm() function in which case this snippet belongs with this patch. This patch introduces a function that filters the contents of the matrix_mdev->matrix to ensure that the matrix_mdev->shadow_apcb contains only queues that are bound to the vfio_ap device driver. The filtering function is called whenever an adapter, domain or control domain is assigned or unassigned, so it is no longer necessary to copy the contents of matrix_mdev->matrix into matrix_mdev->shadow_apcb before setting the masks in the guest; that will have already been done by the filter function.