- best = kvm_find_cpuid_entry(vcpu, 0xD, 1);
+ best = cpuid_entry2_find(entries, nent, 0xD, 1);
if (best && (cpuid_entry_has(best, X86_FEATURE_XSAVES) ||
cpuid_entry_has(best, X86_FEATURE_XSAVEC)))
best->ebx = xstate_required_size(vcpu->arch.xcr0, true);
- best = kvm_find_kvm_cpuid_features(vcpu);
+ best = __kvm_find_kvm_cpuid_features(vcpu, vcpu->arch.cpuid_entries,
+ vcpu->arch.cpuid_nent);
if (kvm_hlt_in_guest(vcpu->kvm) && best &&
+ case 0x1:
+ /* Only initial LAPIC id is allowed to change */
+ if (e->eax ^ best->eax || ((e->ebx ^ best->ebx) >> 24) ||
+ e->ecx ^ best->ecx || e->edx ^ best->edx)
+ return -EINVAL;
+ break;
+ default:
+ if (e->eax ^ best->eax || e->ebx ^ best->ebx ||
+ e->ecx ^ best->ecx || e->edx ^ best->edx)
+ return -EINVAL;