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

Ping: [PATCH v2 3/3] AMD/IOMMU: consider hidden devices when flushing device I/O TLBs


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 11 Oct 2021 10:04:33 +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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=X/4ljXLmYk1pUbKedYutRMFE70u9r2ifwdFCmcnSvbM=; b=ZqDUHZd/PX6oJtEUnagu1oKRu6qZsipYPDZJbRHOpI2+orLrW8GdJsTN3gMvRmWiELvl25jKQQQj6jNTtzDS1Yhm37CkNnToq87IiNPATUKK9nJVlNt5Dm1Dbsse4CG1dAucRgn7iviNGrNxEReSA4HQlmRh+OHvu9GWx3ousR8dch8Wfne3ukwMPOvY2CP1UrPmoU1ABCIiWVefgK+yDyq92Mv6K1jiHgPm4m+FelOfjtfdrYxSXAJjqjK9HEvWON/7uEXEh7IdfoOCLvJiyHqOvTnUriNvjBk1fdKI+V+TUcH5uDKqQP2yHmWjJODgWyTY7WWGlS2tSRyXQ6/ItQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hZ7EOIWMicIp5PfltbhSvFOjt0Ltsj6Gd5pqM3mQdKzmsjojXzW4ORtd3GwJ/cxdzO1Qt3Jd8EWLYjAckyQJ3KJ3lLl6wzYxc1+V5XycSWTETbG5AnzcR7DIPWivWgOR2+Egyj2ljpQa69pptTbH9f7BbOtNmgV8Ni0NGPK/JqQfxGo5I5O3oECUKNnfvES0inpqmGYiRxUTfjYWgrXap0AIFETKYle+UrlzOhsfhhl9AtwfIrf0SaFCI/snqMXMJchS6e4hxaz+MM6DApbDwTq8rM1vqMGo6hRtxGDdZ5X9dRh6dlnryw2c8YftIzsCaYgPHFrtjTKDKGr6Y03Uvg==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Paul Durrant <paul@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 11 Oct 2021 08:04:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17.09.2021 13:00, Jan Beulich wrote:
> Hidden devices are associated with DomXEN but usable by the
> hardware domain. Hence they need flushing as well when all devices are
> to have flushes invoked.
> 
> While there drop a redundant ATS-enabled check and constify the first
> parameter of the involved function.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

The VT-d side equivalent having gone in a while ago, I think it would
be good to have the AMD side on par.

Jan

> --- a/xen/drivers/passthrough/amd/iommu_cmd.c
> +++ b/xen/drivers/passthrough/amd/iommu_cmd.c
> @@ -308,14 +308,11 @@ void amd_iommu_flush_iotlb(u8 devfn, con
>      flush_command_buffer(iommu, iommu_dev_iotlb_timeout);
>  }
>  
> -static void amd_iommu_flush_all_iotlbs(struct domain *d, daddr_t daddr,
> +static void amd_iommu_flush_all_iotlbs(const struct domain *d, daddr_t daddr,
>                                         unsigned int order)
>  {
>      struct pci_dev *pdev;
>  
> -    if ( !ats_enabled )
> -        return;
> -
>      for_each_pdev( d, pdev )
>      {
>          u8 devfn = pdev->devfn;
> @@ -343,7 +340,16 @@ static void _amd_iommu_flush_pages(struc
>      }
>  
>      if ( ats_enabled )
> +    {
>          amd_iommu_flush_all_iotlbs(d, daddr, order);
> +
> +        /*
> +         * Hidden devices are associated with DomXEN but usable by the
> +         * hardware domain. Hence they need dealing with here as well.
> +         */
> +        if ( is_hardware_domain(d) )
> +            amd_iommu_flush_all_iotlbs(dom_xen, daddr, order);
> +    }
>  }
>  
>  void amd_iommu_flush_all_pages(struct domain *d)
> 
> 




 


Rackspace

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