Re: [PATCH v2 08/11] swiotlb-xen: introduce phys_to_dma/dma_to_phys translations

2020-06-09 Thread Stefano Stabellini
On Mon, 8 Jun 2020, Christoph Hellwig wrote: > On Mon, Jun 08, 2020 at 04:06:57PM -0700, Stefano Stabellini wrote: > > I understand what you are suggesting about having something like: > > > > xen_phys_to_dma(...) > > { > > phys_addr_t phys = xen_phys_to_bus(dev, paddr) > >

Re: [PATCH v2 08/11] swiotlb-xen: introduce phys_to_dma/dma_to_phys translations

2020-06-08 Thread Christoph Hellwig
On Mon, Jun 08, 2020 at 04:06:57PM -0700, Stefano Stabellini wrote: > I understand what you are suggesting about having something like: > > xen_phys_to_dma(...) > { > phys_addr_t phys = xen_phys_to_bus(dev, paddr) > return phys_to_dma(phys); > } > > I thought about it

Re: [PATCH v2 08/11] swiotlb-xen: introduce phys_to_dma/dma_to_phys translations

2020-06-08 Thread Stefano Stabellini
On Mon, 8 Jun 2020, Stefano Stabellini wrote: > On Mon, 8 Jun 2020, Christoph Hellwig wrote: > > On Wed, Jun 03, 2020 at 03:22:44PM -0700, Stefano Stabellini wrote: > > > From: Stefano Stabellini > > > > > > With some devices physical addresses are different than dma addresses. > > > To be able

Re: [PATCH v2 08/11] swiotlb-xen: introduce phys_to_dma/dma_to_phys translations

2020-06-08 Thread Stefano Stabellini
On Mon, 8 Jun 2020, Christoph Hellwig wrote: > On Wed, Jun 03, 2020 at 03:22:44PM -0700, Stefano Stabellini wrote: > > From: Stefano Stabellini > > > > With some devices physical addresses are different than dma addresses. > > To be able to deal with these cases, we need to call phys_to_dma on >

Re: [PATCH v2 08/11] swiotlb-xen: introduce phys_to_dma/dma_to_phys translations

2020-06-08 Thread Christoph Hellwig
On Wed, Jun 03, 2020 at 03:22:44PM -0700, Stefano Stabellini wrote: > From: Stefano Stabellini > > With some devices physical addresses are different than dma addresses. > To be able to deal with these cases, we need to call phys_to_dma on > physical addresses (including machine addresses in Xen

Re: [PATCH v2 08/11] swiotlb-xen: introduce phys_to_dma/dma_to_phys translations

2020-06-04 Thread Boris Ostrovsky
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

Re: [PATCH v2 08/11] swiotlb-xen: introduce phys_to_dma/dma_to_phys translations

2020-06-04 Thread boris . ostrovsky
On 6/4/20 1:46 PM, Boris Ostrovsky wrote: > 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 @@

[PATCH v2 08/11] swiotlb-xen: introduce phys_to_dma/dma_to_phys translations

2020-06-03 Thread Stefano Stabellini
From: Stefano Stabellini With some devices physical addresses are different than dma addresses. To be able to deal with these cases, we need to call phys_to_dma on physical addresses (including machine addresses in Xen terminology) before returning them from xen_swiotlb_alloc_coherent and