Re: [PATCH v4 07/16] x86/virt/tdx: Add tdx_alloc/free_page() helpers
From: Edgecombe, Rick P
Date: Thu Jan 29 2026 - 14:14:11 EST
On Thu, 2026-01-29 at 11:09 -0800, Sean Christopherson wrote:
> What you proposed is fundamentally quite different than what I'm
> proposing. I'm not complaining about the union, I'm complaining
> about providing a helper to grab a pointer to the middle of a struct
> and then open coding memcpy() calls using that pointer. I find that
> _extremely_ difficult to grok, because it does a poor job of
> capturing the intent (copy these values to this sequence of
> registers).
>
> The decouple pointer+memcpy() approach also bleeds gory details about
> how PAMT pages are passed in multiple args throughout all SEAMCALL
> APIs that have such args. I want the APIs to not have to care about
> the underlying mechanics of how PAMT pages are copied from an array
> to registers, e.g. so that readers of the code can focus on the
> semantics of the SEAMCALL and the pieces of logic that are
> unique to each SEAMCALL.
>
> In other words, I see the necessity for a union as being a symptom of
> the flawed approach.
Ah ok, fair enough.