[RFC PATCH v2 01/10] dma: Add DMA allocation preservation KHO ABI
Samiullah Khawaja <[email protected]>
| Newsgroups | org.infradead.lists.kexec,dev.linux.lists.iommu,org.kernel.vger.linux-kernel,org.kvack.linux-mm |
|---|---|
| Message-ID | <[email protected]> |
The DMA allocations can be backed by a variety of allocators. Add KHO ABI for the preservation of contiguous allocations that are done through dma-direct. Signed-off-by: Samiullah Khawaja <[email protected]> --- include/linux/kho/abi/dma_alloc.h | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/linux/kho/abi/dma_alloc.h diff --git a/include/linux/kho/abi/dma_alloc.h b/include/linux/kho/abi/dma_alloc.h new file mode 100644 index 000000000000..ae38cf1a1fc9 --- /dev/null +++ b/include/linux/kho/abi/dma_alloc.h @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_KHO_ABI_DMA_ALLOC_H +#define _LINUX_KHO_ABI_DMA_ALLOC_H + +#include <linux/types.h> + +/** + * DOC: DMA Alloc ABI + * + * This header defines the structures used to serialize the state of DMA + * allocations, done by device driver, across a Live Update. + * + * Only DMA allocations done through dma-direct that are contiguous and + * allocated using alloc_page are supported. + */ + +/** + * struct dma_alloc_ser - Serialized state of a single DMA allocation + * @page_phys: Physical address of the preserved pages + * @size: Size of the DMA allocation + * @attrs: DMA allocation attributes + * @force_decrypted: Whether the memory is force decrypted in previous kernel + */ +struct dma_alloc_ser { + u64 page_phys; + u64 size; + u64 attrs; + u8 force_decrypted; + u8 padding[7]; +} __packed; + +#endif /* _LINUX_KHO_ABI_DMA_ALLOC_H */ -- 2.55.0.795.g602f6c329a-goog