[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH 6/9] VT-d: don't lose errors when flushing TLBs on multiple IOMMUs


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
  • Date: Thu, 24 Jun 2021 05:28:44 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.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=DmnO1AJCvEJAYCu0B2SLfSl8IVcETv9btJ+UVbpijjg=; b=joLCN+TKoyRtc59uOm/WwWt2AfFM+t86TxBMNaegUXiUPLZqdOfDp8WWZyf1zWbSSah7QbU3KiOonyZ5fCAN9fFhGMZCpj36IrJ1lySS65al2BFnUjzskkVokWvqpBqBzxbs6UMfnExNOD2AJixotRxYIq03Y3botf1ISSmb/s09fUuucv3J4al6TWN7ca9aCRP8sJ7NGGMT3nmqiEmcEWOb5CjHhTWRpZw0k36oTWiiCVucf6FFWVTaAEnJNGcPb0i58Ec7RHKpus1C3128H6r8eb6gB5BjIoMqD9Zt4IKjC1fRI6gUE+/mdL463ZLXSI7ySppGKlA/uFB6CtFaRQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jsqaWuYsUydJ/DTUXQyhErla4PNAy9bVYjbf8rQbm4d+ZrFnwaWyC3Ual04iagFligec2tGSg3Z7vYMZK8boCzID8P8uAbTAe6r8ERL8vnRo0QO+3dQEqYbeZE90MJIFb5ayVXKalF9FRRkiRjjWJdmzYUq8vM1RWNezmPLLhAuQewBQtAFlnxezC+rE/q3CmB02LoXefZg+iXeIh+cFlHjVlduTmLsJPRzQM3m8Sg0Fqn5TQBdypoVj2OJ+VyrbFVNm6AkdPqdnA6Bp0KhryzKZ3HbaWkb9ioIeMMi+56T3qOJt3RH9PdBlSD+Dbvt4Yoy43JAs6m6CkCIFrGun6A==
  • Authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=intel.com;
  • Cc: Paul Durrant <paul@xxxxxxx>, "Cooper, Andrew" <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Thu, 24 Jun 2021 05:29:03 +0000
  • Dlp-product: dlpe-windows
  • Dlp-reaction: no-action
  • Dlp-version: 11.5.1.3
  • Ironport-sdr: 7Jc7IJCI/WWpY6d5zGrCQV756M0TcgoqIInKNVOlPfIpc+HPqorHdgLA/RbBfH0yMJmlD5cbEL 9Z5J8CaCKrgA==
  • Ironport-sdr: KyRX9+06cNR1o+63fO8S4jLdFrIpO15HrhAnbTgFnOAa9zSamlc3C9QPw2wTXUQIfQUOYICZXa xp4OF6t/2R1Q==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXXRH0ckwXa9bz/0iMr111MgNGbqsiuVNg
  • Thread-topic: [PATCH 6/9] VT-d: don't lose errors when flushing TLBs on multiple IOMMUs

> From: Jan Beulich
> Sent: Wednesday, June 9, 2021 5:29 PM
> 
> 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>

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>

> 
> --- 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,
> 


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.