All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] swiotlb: clear io_tlb_start and io_tlb_end in swiotlb_exit
@ 2019-01-14 20:14 Christoph Hellwig
       [not found] ` <20190114201408.12270-1-hch-jcswGhMUV9g@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2019-01-14 20:14 UTC (permalink / raw)
  To: konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA
  Cc: Sibren Vasse, michel-otUistvHUpPR7s880joybQ,
	freedesktop-DLwv2wemLo05ZU0pBKPMFg,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

Otherwise is_swiotlb_buffer will return false positives when
we first initialize a swiotlb buffer, but then free it because
we have an IOMMU available.

Fixes: 55897af63091 ("dma-direct: merge swiotlb_dma_ops into the dma_direct code")
Reported-by: Sibren Vasse <sibren-DLwv2wemLo05ZU0pBKPMFg@public.gmane.org>
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
Tested-by: Sibren Vasse <sibren-DLwv2wemLo05ZU0pBKPMFg@public.gmane.org>
---
 kernel/dma/swiotlb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index d6361776dc5c..1fb6fd68b9c7 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -378,6 +378,8 @@ void __init swiotlb_exit(void)
 		memblock_free_late(io_tlb_start,
 				   PAGE_ALIGN(io_tlb_nslabs << IO_TLB_SHIFT));
 	}
+	io_tlb_start = 0;
+	io_tlb_end = 0;
 	io_tlb_nslabs = 0;
 	max_segment = 0;
 }
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] swiotlb: clear io_tlb_start and io_tlb_end in swiotlb_exit
       [not found] ` <20190114201408.12270-1-hch-jcswGhMUV9g@public.gmane.org>
@ 2019-01-14 20:25   ` Konrad Rzeszutek Wilk
       [not found]     ` <20190114202513.GG32038-he5eyhs8q0BAdwtm4QZOy9BPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2019-01-14 20:25 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Sibren Vasse, michel-otUistvHUpPR7s880joybQ,
	freedesktop-DLwv2wemLo05ZU0pBKPMFg,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

On Mon, Jan 14, 2019 at 09:14:08PM +0100, Christoph Hellwig wrote:
> Otherwise is_swiotlb_buffer will return false positives when
> we first initialize a swiotlb buffer, but then free it because
> we have an IOMMU available.
> 
> Fixes: 55897af63091 ("dma-direct: merge swiotlb_dma_ops into the dma_direct code")
> Reported-by: Sibren Vasse <sibren-DLwv2wemLo05ZU0pBKPMFg@public.gmane.org>
> Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
> Tested-by: Sibren Vasse <sibren-DLwv2wemLo05ZU0pBKPMFg@public.gmane.org>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

Thank you!
> ---
>  kernel/dma/swiotlb.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
> index d6361776dc5c..1fb6fd68b9c7 100644
> --- a/kernel/dma/swiotlb.c
> +++ b/kernel/dma/swiotlb.c
> @@ -378,6 +378,8 @@ void __init swiotlb_exit(void)
>  		memblock_free_late(io_tlb_start,
>  				   PAGE_ALIGN(io_tlb_nslabs << IO_TLB_SHIFT));
>  	}
> +	io_tlb_start = 0;
> +	io_tlb_end = 0;
>  	io_tlb_nslabs = 0;
>  	max_segment = 0;
>  }
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] swiotlb: clear io_tlb_start and io_tlb_end in swiotlb_exit
       [not found]     ` <20190114202513.GG32038-he5eyhs8q0BAdwtm4QZOy9BPR1lH4CV8@public.gmane.org>
@ 2019-01-14 20:33       ` Christoph Hellwig
       [not found]         ` <20190114203323.GA11412-jcswGhMUV9g@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2019-01-14 20:33 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Sibren Vasse, michel-otUistvHUpPR7s880joybQ,
	freedesktop-DLwv2wemLo05ZU0pBKPMFg, Christoph Hellwig,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

On Mon, Jan 14, 2019 at 03:25:13PM -0500, Konrad Rzeszutek Wilk wrote:
> On Mon, Jan 14, 2019 at 09:14:08PM +0100, Christoph Hellwig wrote:
> > Otherwise is_swiotlb_buffer will return false positives when
> > we first initialize a swiotlb buffer, but then free it because
> > we have an IOMMU available.
> > 
> > Fixes: 55897af63091 ("dma-direct: merge swiotlb_dma_ops into the dma_direct code")
> > Reported-by: Sibren Vasse <sibren-DLwv2wemLo05ZU0pBKPMFg@public.gmane.org>
> > Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
> > Tested-by: Sibren Vasse <sibren-DLwv2wemLo05ZU0pBKPMFg@public.gmane.org>
> 
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

Do you want to send this to Linus, or do you want me to pick it up
through the dma-mapping tree?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] swiotlb: clear io_tlb_start and io_tlb_end in swiotlb_exit
       [not found]         ` <20190114203323.GA11412-jcswGhMUV9g@public.gmane.org>
@ 2019-01-16 14:57           ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2019-01-16 14:57 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Sibren Vasse, michel-otUistvHUpPR7s880joybQ,
	freedesktop-DLwv2wemLo05ZU0pBKPMFg,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Konrad Rzeszutek Wilk

On Mon, Jan 14, 2019 at 09:33:23PM +0100, Christoph Hellwig wrote:
> On Mon, Jan 14, 2019 at 03:25:13PM -0500, Konrad Rzeszutek Wilk wrote:
> > On Mon, Jan 14, 2019 at 09:14:08PM +0100, Christoph Hellwig wrote:
> > > Otherwise is_swiotlb_buffer will return false positives when
> > > we first initialize a swiotlb buffer, but then free it because
> > > we have an IOMMU available.
> > > 
> > > Fixes: 55897af63091 ("dma-direct: merge swiotlb_dma_ops into the dma_direct code")
> > > Reported-by: Sibren Vasse <sibren-DLwv2wemLo05ZU0pBKPMFg@public.gmane.org>
> > > Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
> > > Tested-by: Sibren Vasse <sibren-DLwv2wemLo05ZU0pBKPMFg@public.gmane.org>
> > 
> > Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> 
> Do you want to send this to Linus, or do you want me to pick it up
> through the dma-mapping tree?

I will do it. Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-16 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-14 20:14 [PATCH] swiotlb: clear io_tlb_start and io_tlb_end in swiotlb_exit Christoph Hellwig
     [not found] ` <20190114201408.12270-1-hch-jcswGhMUV9g@public.gmane.org>
2019-01-14 20:25   ` Konrad Rzeszutek Wilk
     [not found]     ` <20190114202513.GG32038-he5eyhs8q0BAdwtm4QZOy9BPR1lH4CV8@public.gmane.org>
2019-01-14 20:33       ` Christoph Hellwig
     [not found]         ` <20190114203323.GA11412-jcswGhMUV9g@public.gmane.org>
2019-01-16 14:57           ` Konrad Rzeszutek Wilk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.