Re: [PATCH] x86/virt/tdx: Use precalculated TDVPR page physical address

Dave Hansen
2025-10-20T14:14:33Z

On 10/20/25 06:57, Sean Christopherson wrote:
> Why do these structures track struct page everywhere?

I asked for it at some point. It allows an unambiguous reference to
normal, (mostly) allocated physical memory. It means that you (mostly)
can't accidentally swap in a virtual address, pfn, or something else
that's not a physical address into the variable.

The TDX ABI is just littered with u64's. There's almost no type safety
anywhere. This is one place to bring a wee little bit of order to the chaos.

In a perfect world, we'd have sparse annotations for the vaddr, paddr,
pfn, dma_addr_t and all the other address spaces. Until then, I like
passing struct page around.