From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9391338B12E for ; Wed, 8 Jul 2026 23:48:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783554537; cv=none; b=Fz1IdUtF4YGu7KIidmm6HKXQtMrMBOgS8pfEov/mL2i9wCVh4mff+HQTutIZ+L0ma+c2N5lrTjHMJh2gH+R18fu5oboT3ZhZG2RwB65F8J/abWd3lid0rhP49DNsEwg62orgDNmw7aPsPs95OCSQLNWvlqARpPk8eJg1EbILWdU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783554537; c=relaxed/simple; bh=h9Dc4kDhlbGcQOLn0GzNWJ4d2rERceO8OMxpaRiUedg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=NlMkrWd8VaU+53Lld1pzIsFjaHgrsC2P52Qr+e/q6y4tqgbEBSYs4aTAA7Dyezmy4t+BlzeKlQElLvhXCinkP68uhOeEAPjarM+BTP5aKyiRKjWJ55dZC5UlfiKI9wjvbNonAqKQsOl1kzh+WwXZ8hg0Md7flpwAkvXThRCuW80= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--skhawaja.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=NVMKa8m8; arc=none smtp.client-ip=209.85.210.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--skhawaja.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="NVMKa8m8" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-848544a8496so490059b3a.0 for ; Wed, 08 Jul 2026 16:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1783554536; x=1784159336; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=1JfihMOdYGKLErlZtxkO4c74/sv22I0BBbL2ChDUSts=; b=NVMKa8m8wQuedncvcG6rcrld18t2Lxtf2G6z3GoGhkXgiN9/JG0e0D6mXaXmZejZCk wFJMC/mLiieWoEaRTg7qmpiWd680Zj9ItWpBp/qSTGj3TPetRe+15yQHYlRm5BUUiLBa MQRZEhbuM0PmWcqCo+6iePePZ/IhB68nWKyWPODRxfR8+MhaVr1Z1XXYnSlxfEEzQUs+ 7VkfxmljoLR8xJYSD7kW6HoWJ2U6Jm0dAhvjli7+LWfKKNCf+DwrUNZV7nFKoOnHpR6F tSnM3lRoLGSYHG9E9bzcqdC+ehOqIpLk0Sqm2z/eAgS65xOh9KafL3KikcVwYfKSXI32 ujvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783554536; x=1784159336; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=1JfihMOdYGKLErlZtxkO4c74/sv22I0BBbL2ChDUSts=; b=Cet9RMDzrY9HJ2vw2sn1/4Re3QLf9HI7LnrPRjEmkQPuNnDOqJAuU2NlUSzAPPPMbn 7VfdsnDBGGZs6PAfiwk7eYRgbZ8ref6fnPl2pdKsYAG/joDZMAnhIFZ21MV9p51y6bnB CpmMhATQfgu4XO1xVdBfIUVUrSYE6O4oA0v7AtxAEpAuapIXPsVRUIDbDCozEiuz7K1Q BoXunoH1uu0vECW/qRScJ2Bpnz5EcuBaaOevJ7disLYoLqfVB1DCHWdeRSLXrjZKOgn/ ose2qf9hLkgK6saffUB1FbWsNb1W/D3rXpJ6dpdKDxZ07KxDvkoQ+WI512HtVrsarPs/ sAvA== X-Forwarded-Encrypted: i=1; AHgh+RqCR0LOtEtuOYGZ91ezzGF+d6RtXujRsfqzdbvygZ16KSYWwfX9VuIlzspIFyzpM3+K3Wmvwom2rFP6QCA=@vger.kernel.org X-Gm-Message-State: AOJu0YxqqH/gVSjvzKyDchABTNJgZDgvlKgt9LT5Umt9rmlwTOUipQ6L SgIpqCdfbXv4nCnQbcr0N+IXVSeT6HYgpwQzJHii3HexhhNyXRtav0SZGm4dSVjrtyhPqYJRBVA o4e2FbuCbN2wIqw== X-Received: from pgcc16.prod.google.com ([2002:a63:1c10:0:b0:c8b:2706:11a7]) (user=skhawaja job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:1144:b0:845:ec31:26cd with SMTP id d2e1a72fcca58-84843436d38mr4585247b3a.46.1783554535737; Wed, 08 Jul 2026 16:48:55 -0700 (PDT) Date: Wed, 8 Jul 2026 23:48:45 +0000 In-Reply-To: <20260708234854.4044652-1-skhawaja@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260708234854.4044652-1-skhawaja@google.com> X-Mailer: git-send-email 2.55.0.795.g602f6c329a-goog Message-ID: <20260708234854.4044652-2-skhawaja@google.com> Subject: [RFC PATCH v2 01/10] dma: Add DMA allocation preservation KHO ABI From: Samiullah Khawaja To: Marek Szyprowski , Will Deacon , Jason Gunthorpe Cc: Samiullah Khawaja , Pasha Tatashin , Mike Rapoport , Pratyush Yadav , Alexander Graf , Robin Murphy , Kevin Tian , iommu@lists.linux.dev, kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, David Matlack , Andrew Morton , Pranjal Shrivastava , Vipin Sharma Content-Type: text/plain; charset="UTF-8" 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 --- 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 + +/** + * 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