Re: [PATCH v14 10/22] KVM: selftests: Set up TDX boot code region
From: Xiaoyao Li
Date: Thu Jul 23 2026 - 06:33:37 EST
On 7/23/2026 7:13 AM, Lisa Wang wrote:
From: Sagi Shahar <sagis@xxxxxxxxxx>
Add memory for TDX boot code in a separate memslot.
Use virt_map() to get identity map in this memory region to allow for
seamless transition from paging disabled to paging enabled code.
Copy the boot code into the memory region and set up the reset vector
at this point. While it's possible to separate the memory allocation and
boot code initialization into separate functions, having all the
calculations for memory size and offsets in one place simplifies the
code and avoids duplications.
Handcode the reset vector as suggested by Sean Christopherson.
Reviewed-by: Binbin Wu <binbin.wu@xxxxxxxxxxxxxxx>
Suggested-by: Sean Christopherson <seanjc@xxxxxxxxxx>
Co-developed-by: Erdem Aktas <erdemaktas@xxxxxxxxxx>
Signed-off-by: Erdem Aktas <erdemaktas@xxxxxxxxxx>
Signed-off-by: Sagi Shahar <sagis@xxxxxxxxxx>
Signed-off-by: Lisa Wang <wyihan@xxxxxxxxxx>
Reviewed-by: Xiaoyao Li <xiaoyao.li@xxxxxxxxx>