mirror of https://gitee.com/openkylin/linux.git
KVM: x86: Add Intel CPUID.1F cpuid emulation support
Add support to expose Intel V2 Extended Topology Enumeration Leaf for some new systems with multiple software-visible die within each package. Because unimplemented and unexposed leaves should be explicitly reported as zero, there is no need to limit cpuid.0.eax to the maximum value of feature configuration but limit it to the highest leaf implemented in the current code. A single clamping seems sufficient and cheaper. Co-developed-by: Xiaoyao Li <xiaoyao.li@linux.intel.com> Signed-off-by: Xiaoyao Li <xiaoyao.li@linux.intel.com> Signed-off-by: Like Xu <like.xu@linux.intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
1fc5d19472
commit
a87f2d3a6e
|
@ -436,7 +436,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
|
|||
|
||||
switch (function) {
|
||||
case 0:
|
||||
entry->eax = min(entry->eax, (u32)(f_intel_pt ? 0x14 : 0xd));
|
||||
/* Limited to the highest leaf implemented in KVM. */
|
||||
entry->eax = min(entry->eax, 0x1fU);
|
||||
break;
|
||||
case 1:
|
||||
entry->edx &= kvm_cpuid_1_edx_x86_features;
|
||||
|
@ -556,7 +557,11 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
|
|||
entry->edx = edx.full;
|
||||
break;
|
||||
}
|
||||
/* function 0xb has additional index. */
|
||||
/*
|
||||
* Per Intel's SDM, the 0x1f is a superset of 0xb,
|
||||
* thus they can be handled by common code.
|
||||
*/
|
||||
case 0x1f:
|
||||
case 0xb: {
|
||||
int i, level_type;
|
||||
|
||||
|
|
Loading…
Reference in New Issue