[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/9] VT-d: don't lose errors when flushing TLBs on multiple IOMMUs
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 9 Jun 2021 11:29:03 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OdIIKv781vcvaB9/e0X5fG6O/EkokaPYCef67sSMkIA=; b=GgBX3XSsNOhx1FdUSpzcf1dWzYNzEuIUZdK+KjlmhOvbGLlpmtByq0wDWOVKKtaQONijhAwFgU0bsOwTFtN0AB2ThM77dZmB8dpkqeYaAPawcCgD3Hl5uXxABQ3CQQYxZy6M2jj+v5m4h4+Bc5OrXCahMwL/UVB0K6EZMCwdpv3BvOCXU53hj0bKm5RWCcDmmY/2OIiwR6GIb/39x3X+bonhVScDovoHDdBDJcTVnzYWLkYoMuLcBHW/QymXb7D4lRpsor/zopQHWnIEvBG0z8TTWVLt/NCEJaTSdo+amQP+hHxulgtiIMdaaqQqBfgK/4G5Ceb0HUwlO2i/mltlhQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VDPfesniEpPeHlNwJRDkUoJG4vN6INT1kyxXqXEtAxpalMdF9/xwV2rq74v7SHoXFvSDGzO+NajZW66pvl2O7TbUldWfb/S17fgg/cNP1hJKIJ6ads433n3N4kJvk7DNDZVzqft4IZ+BV2PPOzFS/JmIhPAzz0W2Yda9WnWvpSrnx1MrwDnk/0ctUV0HnENLk8H5y5VQ5yU9g59kveAow+BfNEr03BKu2GmZanF1n369qDvc5ZnVQO9UUDq+HkdoVcMSTsUjxGdMWeECpWTM98hraK+4Z2Yc2y/BDcj93RbxBL5YaOgjyXsGDif1THtRM2dnghuFAE6U8n13obI17w==
- Authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=suse.com;
- Cc: Paul Durrant <paul@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>
- Delivery-date: Wed, 09 Jun 2021 09:29:10 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
While no longer an immediate problem with flushes no longer timing out,
errors (if any) get properly reported by iommu_flush_iotlb_{dsi,psi}().
Overwriting such an error with, perhaps, a success indicator received
from another IOMMU will misguide callers. Record the first error, but
don't bail from the loop (such that further necessary invalidation gets
carried out on a best effort basis).
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -643,7 +643,7 @@ static int __must_check iommu_flush_iotl
struct vtd_iommu *iommu;
bool_t flush_dev_iotlb;
int iommu_domid;
- int rc = 0;
+ int ret = 0;
/*
* No need pcideves_lock here because we have flush
@@ -651,6 +651,8 @@ static int __must_check iommu_flush_iotl
*/
for_each_drhd_unit ( drhd )
{
+ int rc;
+
iommu = drhd->iommu;
if ( !test_bit(iommu->index, &hd->arch.vtd.iommu_bitmap) )
@@ -673,13 +675,12 @@ static int __must_check iommu_flush_iotl
flush_dev_iotlb);
if ( rc > 0 )
- {
iommu_flush_write_buffer(iommu);
- rc = 0;
- }
+ else if ( !ret )
+ ret = rc;
}
- return rc;
+ return ret;
}
static int __must_check iommu_flush_iotlb_pages(struct domain *d,
|