KVM: x86: expose cpuid_entry2_find for TDX
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Jan 2025 11:31:31 +0000 (06:31 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 14 Mar 2025 18:20:50 +0000 (14:20 -0400)
commita656dac80078def3dd7784e2bd5e6edc1c36e11c
treed0f28511c768a02df0632b2a475b3c500c347e7f
parentf94f4a97e66543bd51d86b4216cc5945041d11c3
KVM: x86: expose cpuid_entry2_find for TDX

CPUID values are provided for TDX virtual machines as part of the
KVM_TDX_INIT_VM ioctl.  Unlike KVM_SET_CPUID2, TDX will need to
examine the leaves, either to validate against the CPUIDs listed
in the TDX modules configuration or to fill other controls with
matching values.

Since there is an existing function to look up a leaf/index pair
into a given list of CPUID entries, export it as kvm_find_cpuid_entry2().

Reviewed-by: Kai Huang <kai.huang@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.c
arch/x86/kvm/cpuid.h