intel / tdx-linux

GNU General Public License v2.0
21 stars 4 forks source link

Workflow for Issuing SEAMCALLs #4

Open pansilup opened 1 month ago

pansilup commented 1 month ago

Hi there, I'm looking for some information on the workflow of issuing SEAMCALLs and have some basic questions. Can I check if TDX enlightened KVM has opened up new TDX specific ioctls for user space (e.g., QEMU) to initiate/issue SEAMCALLs as part of TDX-Env/TD management? For instance, 1.Who is supposed to call "tdx_enable()" in https://github.com/torvalds/linux/blob/ae90f6a6170d7a7a1aa4fddf664fbd093e3023bc/arch/x86/virt/vmx/tdx/tdx.c#L1215 2.How does a SEAMCALLs (such as TDH_MNG_CREATE) request arrive at https://github.com/torvalds/linux/blob/ae90f6a6170d7a7a1aa4fddf664fbd093e3023bc/arch/x86/virt/vmx/tdx/seamcall.S#L21 Any information or documentation on this would be greatly appreciated.

yu-chen-surf commented 1 month ago

@pansilup 1.The tdx_enable() is invoked during system bootup, usually by vt_init() . You can check the patchset here: https://github.com/intel/tdx-linux/blob/main/kernel-patch/kernel_patch-breakdown.tar.bz2

  1. SEAMCALL to TDH_MNG_CREATE is invoked by tdh_mng_create() when qemu issues KVM_TDX_INIT_VM ioctl to init the TD instance. Please also refer to the code mentioned above.
pansilup commented 1 month ago

@yu-chen-surf Thanks for the information.