Commit 6c1b980a authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'dma-mapping-6.6-2023-08-29' of git://git.infradead.org/users/hch/dma-mapping

Pull dma-maping updates from Christoph Hellwig:

 - allow dynamic sizing of the swiotlb buffer, to cater for secure
   virtualization workloads that require all I/O to be bounce buffered
   (Petr Tesarik)

 - move a declaration to a header (Arnd Bergmann)

 - check for memory region overlap in dma-contiguous (Binglei Wang)

 - remove the somewhat dangerous runtime swiotlb-xen enablement and
   unexport is_swiotlb_active (Christoph Hellwig, Juergen Gross)

 - per-node CMA improvements (Yajun Deng)

* tag 'dma-mapping-6.6-2023-08-29' of git://git.infradead.org/users/hch/dma-mapping:
  swiotlb: optimize get_max_slots()
  swiotlb: move slot allocation explanation comment where it belongs
  swiotlb: search the software IO TLB only if the device makes use of it
  swiotlb: allocate a new memory pool when existing pools are full
  swiotlb: determine potential physical address limit
  swiotlb: if swiotlb is full, fall back to a transient memory pool
  swiotlb: add a flag whether SWIOTLB is allowed to grow
  swiotlb: separate memory pool data from other allocator data
  swiotlb: add documentation and rename swiotlb_do_find_slots()
  swiotlb: make io_tlb_default_mem local to swiotlb.c
  swiotlb: bail out of swiotlb_init_late() if swiotlb is already allocated
  dma-contiguous: check for memory region overlap
  dma-contiguous: support numa CMA for specified node
  dma-contiguous: support per-numa CMA for all architectures
  dma-mapping: move arch_dma_set_mask() declaration to header
  swiotlb: unexport is_swiotlb_active
  x86: always initialize xen-swiotlb when xen-pcifront is enabling
  xen/pci: add flag for PCI passthrough being possible
parents 3d3dfeb3 d069ed28
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -696,7 +696,7 @@
			kernel/dma/contiguous.c

	cma_pernuma=nn[MG]
			[ARM64,KNL,CMA]
			[KNL,CMA]
			Sets the size of kernel per-numa memory area for
			contiguous memory allocations. A value of 0 disables
			per-numa CMA altogether. And If this option is not
@@ -706,6 +706,17 @@
			which is located in node nid, if the allocation fails,
			they will fallback to the global default memory area.

	numa_cma=<node>:nn[MG][,<node>:nn[MG]]
			[KNL,CMA]
			Sets the size of kernel numa memory area for
			contiguous memory allocations. It will reserve CMA
			area for the specified node.

			With numa CMA enabled, DMA users on node nid will
			first try to allocate buffer from the numa area
			which is located in node nid, if the allocation fails,
			they will fallback to the global default memory area.

	cmo_free_hint=	[PPC] Format: { yes | no }
			Specify whether pages are marked as being inactive
			when they are freed.  This is used in CMO environments
+4 −6
Original line number Diff line number Diff line
@@ -125,12 +125,10 @@ static int __init xen_mm_init(void)
		return 0;

	/* we can work with the default swiotlb */
	if (!io_tlb_default_mem.nslabs) {
	rc = swiotlb_init_late(swiotlb_size_or_default(),
			       xen_swiotlb_gfp(), NULL);
	if (rc < 0)
		return rc;
	}

	cflush.op = 0;
	cflush.a.dev_bus_addr = 0;
+0 −2
Original line number Diff line number Diff line
@@ -461,8 +461,6 @@ void __init bootmem_init(void)
	arm64_hugetlb_cma_reserve();
#endif

	dma_pernuma_cma_reserve();

	kvm_hyp_reserve();

	/*
+1 −1
Original line number Diff line number Diff line
@@ -664,7 +664,7 @@ static int __init octeon_pci_setup(void)

		/* BAR1 movable regions contiguous to cover the swiotlb */
		octeon_bar1_pci_phys =
			io_tlb_default_mem.start & ~((1ull << 22) - 1);
			default_swiotlb_base() & ~((1ull << 22) - 1);

		for (index = 0; index < 32; index++) {
			union cvmx_pci_bar1_indexx bar1_index;
+1 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0

#include <linux/dma-mapping.h>
#include <linux/dma-map-ops.h>
#include <linux/export.h>
#include <asm/machdep.h>

Loading