All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pratyush Yadav <pratyush@kernel.org>
To: Mike Rapoport <rppt@kernel.org>
Cc: Pratyush Yadav <pratyush@kernel.org>,
	 Andrew Morton <akpm@linux-foundation.org>,
	 Alexander Graf <graf@amazon.com>,
	 Jason Miu <jasonmiu@google.com>,
	 Jonathan Corbet <corbet@lwn.net>,
	 Pasha Tatashin <pasha.tatashin@soleen.com>,
	 kexec@lists.infradead.org, linux-doc@vger.kernel.org,
	 linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 5/6] kho: Relocate vmalloc preservation structure to KHO ABI header
Date: Tue, 20 Jan 2026 18:56:16 +0000	[thread overview]
Message-ID: <2vxz5x8wcdv3.fsf@kernel.org> (raw)
In-Reply-To: <aW_Mqp6HcqLwQImS@kernel.org> (Mike Rapoport's message of "Tue, 20 Jan 2026 20:42:50 +0200")

On Tue, Jan 20 2026, Mike Rapoport wrote:

> On Tue, Jan 20, 2026 at 04:26:51PM +0000, Pratyush Yadav wrote:
>> On Mon, Jan 05 2026, Mike Rapoport wrote:
>> 
>> > From: Jason Miu <jasonmiu@google.com>
>> >
>> > The `struct kho_vmalloc` defines the in-memory layout for preserving
>> > vmalloc regions across kexec. This layout is a contract between kernels
>> > and part of the KHO ABI.
>> >
>> > To reflect this relationship, the related structs and helper macros are
>> > relocated to the ABI header, `include/linux/kho/abi/kexec_handover.h`.
>> > This move places the structure's definition under the protection of the
>> > KHO_FDT_COMPATIBLE version string.
>> >
>> > The structure and its components are now also documented within the
>> > ABI header to describe the contract and prevent ABI breaks.
>> >
>> > Signed-off-by: Jason Miu <jasonmiu@google.com>
>> > Co-developed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
>> > Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
>> [...]
>> > +/* Helper macro to define a union for a serializable pointer. */
>> > +#define DECLARE_KHOSER_PTR(name, type)	\
>> > +	union {                        \
>> > +		u64 phys;              \
>> > +		type ptr;              \
>> > +	} name
>> > +
>> > +/* Stores the physical address of a serializable pointer. */
>> > +#define KHOSER_STORE_PTR(dest, val)               \
>> > +	({                                        \
>> > +		typeof(val) v = val;              \
>> > +		typecheck(typeof((dest).ptr), v); \
>> > +		(dest).phys = virt_to_phys(v);    \
>> > +	})
>> > +
>> > +/* Loads the stored physical address back to a pointer. */
>> > +#define KHOSER_LOAD_PTR(src)						\
>> > +	({                                                                   \
>> > +		typeof(src) s = src;                                         \
>> > +		(typeof((s).ptr))((s).phys ? phys_to_virt((s).phys) : NULL); \
>> > +	})
>> 
>> Nit: not a fan of exposing code internals to the ABI header. But without
>> this the definition of kho_vmalloc_hdr won't make any sense to someone
>> reading the doc without looking at the code. Dunno if we can do anything
>> better though...
>
> These might be actually useful for other KHO users. 

Hmm, okay. Let's keep them here then.

[...]

-- 
Regards,
Pratyush Yadav


  reply	other threads:[~2026-01-20 18:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 16:58 [PATCH 0/6] kho: ABI headers and Documentation updates Mike Rapoport
2026-01-05 16:58 ` [PATCH 1/6] kho/abi: luo: make generated documentation more coherent Mike Rapoport
2026-01-20 15:48   ` Pratyush Yadav
2026-01-22 18:27   ` Pasha Tatashin
2026-01-05 16:58 ` [PATCH 2/6] kho/abi: memfd: " Mike Rapoport
2026-01-20 15:49   ` Pratyush Yadav
2026-01-22 18:28   ` Pasha Tatashin
2026-01-05 16:58 ` [PATCH 3/6] kho: docs: combine concepts and FDT documentation Mike Rapoport
2026-01-20 16:08   ` Pratyush Yadav
2026-01-20 18:35     ` Mike Rapoport
2026-01-20 18:36       ` Pratyush Yadav
2026-01-22 18:27   ` Pasha Tatashin
2026-01-05 16:58 ` [PATCH 4/6] kho: Introduce KHO FDT ABI header Mike Rapoport
2026-01-20 16:14   ` Pratyush Yadav
2026-01-22 18:29   ` Pasha Tatashin
2026-01-05 16:58 ` [PATCH 5/6] kho: Relocate vmalloc preservation structure to KHO " Mike Rapoport
2026-01-20 16:26   ` Pratyush Yadav
2026-01-20 18:42     ` Mike Rapoport
2026-01-20 18:56       ` Pratyush Yadav [this message]
2026-01-22 18:24         ` Pasha Tatashin
2026-01-05 16:58 ` [PATCH 6/6] kho/abi: add memblock " Mike Rapoport
2026-01-20 16:31   ` Pratyush Yadav
2026-01-20 18:44     ` Mike Rapoport
2026-01-22 18:25   ` Pasha Tatashin
2026-01-20 16:32 ` [PATCH 0/6] kho: ABI headers and Documentation updates Pratyush Yadav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2vxz5x8wcdv3.fsf@kernel.org \
    --to=pratyush@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=graf@amazon.com \
    --cc=jasonmiu@google.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=rppt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.