Commit 488808e6 authored by Xiaoyao Li's avatar Xiaoyao Li Committed by Paolo Bonzini
Browse files

KVM: x86: Introduce KVM_TDX_GET_CPUID



Implement an IOCTL to allow userspace to read the CPUID bit values for a
configured TD.

The TDX module doesn't provide the ability to set all CPUID bits. Instead
some are configured indirectly, or have fixed values. But it does allow
for the final resulting CPUID bits to be read. This information will be
useful for userspace to understand the configuration of the TD, and set
KVM's copy via KVM_SET_CPUID2.

Signed-off-by: default avatarXiaoyao Li <xiaoyao.li@intel.com>
Co-developed-by: default avatarTony Lindgren <tony.lindgren@linux.intel.com>
Signed-off-by: default avatarTony Lindgren <tony.lindgren@linux.intel.com>
Signed-off-by: default avatarRick Edgecombe <rick.p.edgecombe@intel.com>
---
 - Fix subleaf mask check (Binbin)
 - Search all possible sub-leafs (Francesco Lavra)
 - Reduce off-by-one error sensitve code (Francesco, Xiaoyao)
 - Handle buffers too small from userspace (Xiaoyao)
 - Read max CPUID from TD instead of using fixed values (Xiaoyao)
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent a50f673f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment