linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Fix restricted DMA vs swiotlb_exit()
@ 2021-07-19 12:30 Will Deacon
  2021-07-19 12:30 ` [PATCH 1/5] of: Return success from of_dma_set_restricted_buffer() when !OF_ADDRESS Will Deacon
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Will Deacon @ 2021-07-19 12:30 UTC (permalink / raw)
  To: iommu
  Cc: linux-kernel, Will Deacon, Guenter Roeck, Claire Chang,
	Christoph Hellwig, Robin Murphy, Konrad Rzeszutek Wilk,
	Nathan Chancellor

Hi all,

This series fixes the issues which have been reported against the
Restricted DMA series in -next:

  * Fix the build for Sparc as reported by Guenter [1].

  * Rework the lifetime of 'io_tlb_default_mem' so that devices
    can retain valid references to it even after swiotlb_exit(). This,
    in turn, fixes the x86/AMD IOMMU regressions reported by Nathan [2].

I also then added a diagnostic to swiotlb_exit(), as suggested by Konrad
[3] and the final patch frees the underlying buffer memory during the
tear down, but I must confess that I don't know why this wasn't being
done already.

A massive thank you to Nathan for helping to debug this and also for
testing these patches to confirm that they address the issue on his
machine.

Patches are based against swiotlb devel/for-linus-5.15.

Cheers,

Will

[1] https://lore.kernel.org/r/20210702030807.GA2685166@roeck-us.net
[2] https://lore.kernel.org/r/YNvMDFWKXSm4LRfZ@Ryzen-9-3900X.localdomain
[3] https://lore.kernel.org/r/YORsr0h7u5l9DZwh@char.us.oracle.com

Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Claire Chang <tientzu@chromium.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Nathan Chancellor <nathan@kernel.org>

--->8

Will Deacon (5):
  of: Return success from of_dma_set_restricted_buffer() when
    !OF_ADDRESS
  swiotlb: Point io_default_tlb_mem at static allocation
  swiotlb: Remove io_tlb_default_mem indirection
  swiotlb: Emit diagnostic in swiotlb_exit()
  swiotlb: Free tbl memory in swiotlb_exit()

 drivers/base/core.c       |  2 +-
 drivers/of/of_private.h   |  3 +-
 drivers/xen/swiotlb-xen.c |  4 +-
 include/linux/swiotlb.h   |  4 +-
 kernel/dma/swiotlb.c      | 82 +++++++++++++++++++++++----------------
 5 files changed, 56 insertions(+), 39 deletions(-)

-- 
2.32.0.402.g57bb445576-goog


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

end of thread, other threads:[~2021-07-20  8:57 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-19 12:30 [PATCH 0/5] Fix restricted DMA vs swiotlb_exit() Will Deacon
2021-07-19 12:30 ` [PATCH 1/5] of: Return success from of_dma_set_restricted_buffer() when !OF_ADDRESS Will Deacon
2021-07-20  3:35   ` Claire Chang
2021-07-19 12:30 ` [PATCH 2/5] swiotlb: Point io_default_tlb_mem at static allocation Will Deacon
2021-07-20  3:35   ` Claire Chang
2021-07-20  7:51   ` Christoph Hellwig
2021-07-20  8:49     ` Will Deacon
2021-07-19 12:30 ` [PATCH 3/5] swiotlb: Remove io_tlb_default_mem indirection Will Deacon
2021-07-20  3:35   ` Claire Chang
2021-07-19 12:30 ` [PATCH 4/5] swiotlb: Emit diagnostic in swiotlb_exit() Will Deacon
2021-07-20  3:36   ` Claire Chang
2021-07-19 12:30 ` [PATCH 5/5] swiotlb: Free tbl memory " Will Deacon
2021-07-20  3:36   ` Claire Chang
2021-07-20  8:35     ` Will Deacon
2021-07-20  7:51 ` [PATCH 0/5] Fix restricted DMA vs swiotlb_exit() Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).