mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
i386/tdx: Set value of <GetTdVmCallInfo> based on capabilities of both KVM and QEMU
KVM reports the supported TDVMCALL sub leafs in TDX capabilities.
one for kernel-supported
TDVMCALLs (userspace can set those blindly) and one for user-supported
TDVMCALLs (userspace can set those if it knows how to handle them)
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://lore.kernel.org/r/20250703024021.3559286-4-xiaoyao.li@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
committed by
Paolo Bonzini
parent
25c98a1350
commit
55be385b10
@@ -1256,14 +1256,21 @@ out_free:
|
||||
g_free(task);
|
||||
}
|
||||
|
||||
#define SUPPORTED_TDVMCALLINFO_1_R11 (0)
|
||||
#define SUPPORTED_TDVMCALLINFO_1_R12 (0)
|
||||
|
||||
void tdx_handle_get_tdvmcall_info(X86CPU *cpu, struct kvm_run *run)
|
||||
{
|
||||
if (run->tdx.get_tdvmcall_info.leaf != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
run->tdx.get_tdvmcall_info.r11 = 0;
|
||||
run->tdx.get_tdvmcall_info.r12 = 0;
|
||||
run->tdx.get_tdvmcall_info.r11 = (tdx_caps->user_tdvmcallinfo_1_r11 &
|
||||
SUPPORTED_TDVMCALLINFO_1_R11) |
|
||||
tdx_caps->kernel_tdvmcallinfo_1_r11;
|
||||
run->tdx.get_tdvmcall_info.r12 = (tdx_caps->user_tdvmcallinfo_1_r12 &
|
||||
SUPPORTED_TDVMCALLINFO_1_R12) |
|
||||
tdx_caps->kernel_tdvmcallinfo_1_r12;
|
||||
run->tdx.get_tdvmcall_info.r13 = 0;
|
||||
run->tdx.get_tdvmcall_info.r14 = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user