[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <af4c8c3f-6bb5-5b42-8589-8fe66fc7621a@oracle.com>
Date: Thu, 4 Jun 2020 13:46:28 -0400
From: Boris Ostrovsky <boris.ostrovsky@...cle.com>
To: Stefano Stabellini <sstabellini@...nel.org>, jgross@...e.com,
konrad.wilk@...cle.com
Cc: xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org,
tamas@...engyel.com, roman@...eda.com,
Stefano Stabellini <stefano.stabellini@...inx.com>
Subject: Re: [PATCH v2 08/11] swiotlb-xen: introduce phys_to_dma/dma_to_phys
translations
On 6/3/20 6:22 PM, Stefano Stabellini wrote:
>
> diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
> index 0a6cb67f0fc4..60ef07440905 100644
> --- a/drivers/xen/swiotlb-xen.c
> +++ b/drivers/xen/swiotlb-xen.c
> @@ -64,16 +64,16 @@ static inline dma_addr_t xen_phys_to_bus(struct device *dev, phys_addr_t paddr)
Weren't you going to rename this to xen_phys_to_dma()? (And the the one
below to xen_dma_to_phys())?
-boris
>
> dma |= paddr & ~XEN_PAGE_MASK;
>
> - return dma;
> + return phys_to_dma(dev, dma);
> }
>
> -static inline phys_addr_t xen_bus_to_phys(struct device *dev, dma_addr_t baddr)
> +static inline phys_addr_t xen_bus_to_phys(struct device *dev,
> + dma_addr_t dma_addr)
> {
> + phys_addr_t baddr = dma_to_phys(dev, dma_addr);
> unsigned long xen_pfn = bfn_to_pfn(XEN_PFN_DOWN(baddr));
> - dma_addr_t dma = (dma_addr_t)xen_pfn << XEN_PAGE_SHIFT;
> - phys_addr_t paddr = dma;
> -
> - paddr |= baddr & ~XEN_PAGE_MASK;
> + phys_addr_t paddr = (xen_pfn << XEN_PAGE_SHIFT) |
> + (baddr & ~XEN_PAGE_MASK);
>
Powered by blists - more mailing lists