[RFC PATCH 1/5] kho: add KHOSER_CLEAR_PTR()

Pratyush Yadav pratyush at kernel.org
Mon Nov 16 05:40:06 PST 2026


From: "Pratyush Yadav (Google)" <pratyush at kernel.org>

Add a helper to reset a KHO serialized pointer to NULL, as a counterpart
to KHOSER_STORE_PTR().

Signed-off-by: Pratyush Yadav (Google) <pratyush at kernel.org>
---
 include/linux/kho/abi/kexec_handover.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/kho/abi/kexec_handover.h b/include/linux/kho/abi/kexec_handover.h
index 2f4fb9c639421..5fe9c5e10ac89 100644
--- a/include/linux/kho/abi/kexec_handover.h
+++ b/include/linux/kho/abi/kexec_handover.h
@@ -132,6 +132,11 @@
 		(dest).phys = virt_to_phys(v);    \
 	})
 
+#define KHOSER_CLEAR_PTR(dest)			\
+	({					\
+		(dest).phys = 0;		\
+	})
+
 /* Loads the stored physical address back to a pointer. */
 #define KHOSER_LOAD_PTR(src)						\
 	({                                                                   \
-- 
2.56.0.611.g1030f0b940-goog




More information about the kexec mailing list