Lines Matching refs:best
75 struct kvm_cpuid_entry2 *best; in kvm_update_cpuid() local
78 best = kvm_find_cpuid_entry(vcpu, 1, 0); in kvm_update_cpuid()
79 if (!best) in kvm_update_cpuid()
83 if (boot_cpu_has(X86_FEATURE_XSAVE) && best->function == 0x1) { in kvm_update_cpuid()
84 best->ecx &= ~F(OSXSAVE); in kvm_update_cpuid()
86 best->ecx |= F(OSXSAVE); in kvm_update_cpuid()
89 best->edx &= ~F(APIC); in kvm_update_cpuid()
91 best->edx |= F(APIC); in kvm_update_cpuid()
94 if (best->ecx & F(TSC_DEADLINE_TIMER)) in kvm_update_cpuid()
100 best = kvm_find_cpuid_entry(vcpu, 7, 0); in kvm_update_cpuid()
101 if (best) { in kvm_update_cpuid()
103 if (boot_cpu_has(X86_FEATURE_PKU) && best->function == 0x7) { in kvm_update_cpuid()
104 best->ecx &= ~F(OSPKE); in kvm_update_cpuid()
106 best->ecx |= F(OSPKE); in kvm_update_cpuid()
110 best = kvm_find_cpuid_entry(vcpu, 0xD, 0); in kvm_update_cpuid()
111 if (!best) { in kvm_update_cpuid()
116 (best->eax | ((u64)best->edx << 32)) & in kvm_update_cpuid()
118 vcpu->arch.guest_xstate_size = best->ebx = in kvm_update_cpuid()
122 best = kvm_find_cpuid_entry(vcpu, 0xD, 1); in kvm_update_cpuid()
123 if (best && (best->eax & (F(XSAVES) | F(XSAVEC)))) in kvm_update_cpuid()
124 best->ebx = xstate_required_size(vcpu->arch.xcr0, true); in kvm_update_cpuid()
130 best = kvm_find_cpuid_entry(vcpu, 0x80000008, 0); in kvm_update_cpuid()
131 if (best) { in kvm_update_cpuid()
132 int vaddr_bits = (best->eax & 0xff00) >> 8; in kvm_update_cpuid()
175 struct kvm_cpuid_entry2 *best; in cpuid_query_maxphyaddr() local
177 best = kvm_find_cpuid_entry(vcpu, 0x80000000, 0); in cpuid_query_maxphyaddr()
178 if (!best || best->eax < 0x80000008) in cpuid_query_maxphyaddr()
180 best = kvm_find_cpuid_entry(vcpu, 0x80000008, 0); in cpuid_query_maxphyaddr()
181 if (best) in cpuid_query_maxphyaddr()
182 return best->eax & 0xff; in cpuid_query_maxphyaddr()
869 struct kvm_cpuid_entry2 *best = NULL; in kvm_find_cpuid_entry() local
878 best = e; in kvm_find_cpuid_entry()
882 return best; in kvm_find_cpuid_entry()
911 struct kvm_cpuid_entry2 *best; in kvm_cpuid() local
914 best = kvm_find_cpuid_entry(vcpu, function, index); in kvm_cpuid()
916 if (!best) { in kvm_cpuid()
921 best = check_cpuid_limit(vcpu, function, index); in kvm_cpuid()
925 if (best) { in kvm_cpuid()
926 *eax = best->eax; in kvm_cpuid()
927 *ebx = best->ebx; in kvm_cpuid()
928 *ecx = best->ecx; in kvm_cpuid()
929 *edx = best->edx; in kvm_cpuid()