Lines Matching full:memory

7 swiotlb is a memory buffer allocator used by the Linux kernel DMA layer. It is
8 typically used when a device doing DMA can't directly access the target memory
10 the DMA layer calls swiotlb to allocate a temporary memory buffer that conforms
11 to the limitations. The DMA is done to/from this temporary memory buffer, and
13 memory buffer. This approach is generically called "bounce buffering", and the
14 temporary memory buffer is called a "bounce buffer".
25 memory buffer, doing bounce buffering is slower than doing DMA directly to the
26 original memory buffer, and it consumes more CPU resources. So it is used only
32 limitations. As physical memory sizes grew beyond 4 GiB, some devices could
33 only provide 32-bit DMA addresses. By allocating bounce buffer memory below
37 More recently, Confidential Computing (CoCo) VMs have the guest VM's memory
38 encrypted by default, and the memory is not accessible by the host hypervisor
40 directed to guest memory that is unencrypted. CoCo VMs set a kernel-wide option
41 to force all DMA I/O to use bounce buffers, and the bounce buffer memory is set
42 up as unencrypted. The host does DMA I/O to/from the bounce buffer memory, and
44 data to/from the original target memory buffer. The CPU copying bridges between
45 the unencrypted and the encrypted memory. This use of bounce buffers allows
47 needed to handle the memory encryption complexity.
51 "untrusted", the device should be given access only to the memory containing
52 the data being transferred. But if that memory occupies only part of an IOMMU
64 buffer memory is physically contiguous. The expectation is that the DMA layer
65 maps the physical memory address to a DMA address, and returns the DMA address
67 multiple memory buffer segments, a separate bounce buffer must be allocated for
73 updated the bounce buffer memory and DMA_ATTR_SKIP_CPU_SYNC is not set, the
75 buffer back to the original buffer. Then the bounce buffer memory is freed.
88 block. Hence the default memory pool for swiotlb allocations must be
90 allocations must be physically contiguous, the entire default memory pool is
96 for space to become available. But a large pool potentially wastes memory, as
97 this pre-allocated memory is not available for other uses in the system. The
99 I/O. These VMs use a heuristic to set the default pool size to ~6% of memory,
100 with a max of 1 GiB, which has the potential to be very wasteful of memory.
104 default memory pool size remains an open issue.
141 Memory used for swiotlb bounce buffers is allocated from overall system memory
151 memory. The default pool is allocated below the 4 GiB physical address line so
152 it works for devices that can only address 32-bits of physical memory (unless
154 pool memory must be decrypted before swiotlb is used.
199 the amount of memory available for allocation as bounce buffers. If a bounce
201 task is kicked off to allocate memory from general system memory and turn it
203 because the memory allocation may block, and as noted above, swiotlb requests
207 deleted when the bounce buffer is freed. Memory for this transient pool comes
208 from the general system memory atomic pool so that creation does not block.
210 where the memory must be decrypted, so it is done only as a stopgap until the
213 Adding a dynamic pool has limitations. Like with the default pool, the memory
215 (e.g., 4 MiB on a typical x86 system). Due to memory fragmentation, a max size
218 memory fragmentation, dynamically adding a pool might not succeed at all.
234 few CPUs. It allows the default swiotlb pool to be smaller so that memory is
241 io_tlb_area, and io_tlb_slot. io_tlb_mem describes a swiotlb memory allocator,
242 which includes the default memory pool and any dynamic or transient pools
243 linked to it. Limited statistics on swiotlb usage are kept per memory allocator
247 io_tlb_pool describes a memory pool, either the default pool, a dynamic pool,
249 the memory in the pool, a pointer to an array of io_tlb_area structures, and a
258 io_tlb_slot describes an individual memory slot in the pool, with size
260 index computed from the bounce buffer address relative to the starting memory
269 memory buffer address obviously must be passed as an argument to
271 swiotlb data structures must save the original memory buffer address so that it
279 swiotlb code must be able to calculate the corresponding original memory buffer
281 memory buffer address is populated into the struct io_tlb_slot for each slot
313 memory separate from the default swiotlb pool, and that are dedicated for DMA
314 use by a particular device. Restricted pools provide a level of DMA memory