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

Re: [PATCH 3/8] xen-swiotlb: use io_tlb_end in xen_swiotlb_dma_supported


  • To: Christoph Hellwig <hch@xxxxxx>
  • From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
  • Date: Fri, 19 Feb 2021 16:00:20 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.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=UqlfMFUiDpITjvYlTcrtKvtc2PjKHLcDk3gvr6X5NFY=; b=EgJUIGf2Sp2FRic75OJladf1FNn/SntjPzEMia2I/uwSUVNI6JlqiFimDp7zTh59tqYBorQ4JymT1ZqeroPlyhxfzVdzPEYMpzUm6bquA22epKOX6NriNbRMq6+L2Zxvzmk/zlCyqpLb3W9Yd7OPzYpxBzeZTFNMSggcQhzX7nohc1mB8G9pbb36mB39827COtQMrGIEOsR/4VvXkxaBU6ygfwQec5pNJRw5rMMCOqDxbTgQ6JvPO6apgRoBzeZ64vMLaMz4EmlETThbOh7kdzV1zqPA5ucwOM42azEQ8TMnSQZ0AH1MPB/QlhO2V1BKCXopOmnqwfRIRgN5u4h9Eg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MT74IFNh5PljWJ5GOKU9nN8+5VCKDN2S55rMBcishaDOfXtBKxzJwvxDrV7TZwoEMQu4Vbu0z+9osQ+0N58Yg+vucSGPAJgzWWViNsTBytJzjo83nJr5oNGlSVnIjXs9I713eQrCeem6PsMluUfx7m62Z24Fi3KUOPthvAoE58pVwjtsYK9+Bcb+znurccFA//kOZlLbY+RsBXd1jRXXCXg6NqWhnZQiRTrhfOaLwqp3s76wNi0z7wbouuRBjfSoZYjbmeh81nbWtsHaWrTibqIhu6KIq7tXl0ILA8O0hn3Z3LNKwkEY7z4fU/7uQQL0sX7XSgPAWJJSrjSRio3ypw==
  • Authentication-results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=oracle.com;
  • Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Dongli Zhang <dongli.zhang@xxxxxxxxxx>, Claire Chang <tientzu@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 19 Feb 2021 21:00:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Sun, Feb 07, 2021 at 05:09:29PM +0100, Christoph Hellwig wrote:
> Use the existing variable that holds the physical address for
> xen_io_tlb_end to simplify xen_swiotlb_dma_supported a bit, and remove
> the otherwise unused xen_io_tlb_end variable and the xen_virt_to_bus
> helper.
> 
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>

> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> ---
>  drivers/xen/swiotlb-xen.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
> index a4026822a889f7..4298f74a083985 100644
> --- a/drivers/xen/swiotlb-xen.c
> +++ b/drivers/xen/swiotlb-xen.c
> @@ -46,7 +46,7 @@
>   * API.
>   */
>  
> -static char *xen_io_tlb_start, *xen_io_tlb_end;
> +static char *xen_io_tlb_start;
>  static unsigned long xen_io_tlb_nslabs;
>  /*
>   * Quick lookup value of the bus address of the IOTLB.
> @@ -82,11 +82,6 @@ static inline phys_addr_t xen_dma_to_phys(struct device 
> *dev,
>       return xen_bus_to_phys(dev, dma_to_phys(dev, dma_addr));
>  }
>  
> -static inline dma_addr_t xen_virt_to_bus(struct device *dev, void *address)
> -{
> -     return xen_phys_to_dma(dev, virt_to_phys(address));
> -}
> -
>  static inline int range_straddles_page_boundary(phys_addr_t p, size_t size)
>  {
>       unsigned long next_bfn, xen_pfn = XEN_PFN_DOWN(p);
> @@ -250,7 +245,6 @@ int __ref xen_swiotlb_init(int verbose, bool early)
>               rc = swiotlb_late_init_with_tbl(xen_io_tlb_start, 
> xen_io_tlb_nslabs);
>  
>  end:
> -     xen_io_tlb_end = xen_io_tlb_start + bytes;
>       if (!rc)
>               swiotlb_set_max_segment(PAGE_SIZE);
>  
> @@ -558,7 +552,7 @@ xen_swiotlb_sync_sg_for_device(struct device *dev, struct 
> scatterlist *sgl,
>  static int
>  xen_swiotlb_dma_supported(struct device *hwdev, u64 mask)
>  {
> -     return xen_virt_to_bus(hwdev, xen_io_tlb_end - 1) <= mask;
> +     return xen_phys_to_dma(hwdev, io_tlb_end - 1) <= mask;
>  }
>  
>  const struct dma_map_ops xen_swiotlb_dma_ops = {
> -- 
> 2.29.2
> 



 


Rackspace

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