Lines Matching +full:- +full:kvm
2 * x86 KVM CPU type initialization
7 * See the COPYING file in the top-level directory.
12 #include "host-cpu.h"
19 #include "accel/accel-cpu-target.h"
26 eax = kvm_arch_get_supported_cpuid(cs->kvm_state, 0x80000008, 0, R_EAX); in kvm_set_guest_phys_bits()
31 cpu->guest_phys_bits = guest_phys_bits; in kvm_set_guest_phys_bits()
32 if (cpu->guest_phys_bits > cpu->phys_bits) { in kvm_set_guest_phys_bits()
33 cpu->guest_phys_bits = cpu->phys_bits; in kvm_set_guest_phys_bits()
36 if (cpu->host_phys_bits && cpu->host_phys_bits_limit && in kvm_set_guest_phys_bits()
37 cpu->guest_phys_bits > cpu->host_phys_bits_limit) { in kvm_set_guest_phys_bits()
38 cpu->guest_phys_bits = cpu->host_phys_bits_limit; in kvm_set_guest_phys_bits()
46 CPUX86State *env = &cpu->env; in kvm_cpu_realizefn()
52 * cpu->ucode_rev and cpu->phys_bits, and updates the CPUID results in in kvm_cpu_realizefn()
66 * cpu_common_realizefn() (via xcc->parent_realize) in kvm_cpu_realizefn()
68 if (xcc->max_features) { in kvm_cpu_realizefn()
71 env->features[FEAT_7_0_ECX] |= CPUID_7_0_ECX_WAITPKG; in kvm_cpu_realizefn()
74 if (env->features[FEAT_1_ECX] & CPUID_EXT_MONITOR) { in kvm_cpu_realizefn()
75 host_cpuid(5, 0, &cpu->mwait.eax, &cpu->mwait.ebx, in kvm_cpu_realizefn()
76 &cpu->mwait.ecx, &cpu->mwait.edx); in kvm_cpu_realizefn()
79 if (cpu->ucode_rev == 0) { in kvm_cpu_realizefn()
80 cpu->ucode_rev = in kvm_cpu_realizefn()
90 if ((env->features[FEAT_8000_0001_EDX] & CPUID_EXT2_LM) && in kvm_cpu_realizefn()
91 cpu->guest_phys_bits == -1) { in kvm_cpu_realizefn()
101 cs->num_ases = x86_machine_is_smm_enabled(X86_MACHINE(current_machine)) ? 2 : 1; in kvm_cpu_realizefn()
102 cpu_address_space_init(cs, X86ASIdx_MEM, "cpu-memory", cs->memory); in kvm_cpu_realizefn()
119 CPUX86State *env = &cpu->env; in kvm_cpu_max_instance_init()
128 env->cpuid_min_level = in kvm_cpu_max_instance_init()
130 env->cpuid_min_xlevel = in kvm_cpu_max_instance_init()
132 env->cpuid_min_xlevel2 = in kvm_cpu_max_instance_init()
154 if (!esa->size) { in kvm_cpu_xsave_init()
159 assert(esa->size == eax); in kvm_cpu_xsave_init()
160 esa->offset = ebx; in kvm_cpu_xsave_init()
161 esa->ecx = ecx; in kvm_cpu_xsave_init()
167 * KVM-specific features that are automatically added/removed
168 * from cpudef models when KVM is enabled.
173 * by the KVM accelerator (see "OS requirements" section at
174 * docs/system/target-i386.rst)
178 { "kvm-nopiodelay", "on" },
179 { "kvm-asyncpf", "on" },
180 { "kvm-steal-time", "on" },
181 { "kvm-pv-eoi", "on" },
182 { "kvmclock-stable-bit", "on" },
184 { "kvm-msi-ext-dest-id", "off" },
197 for (pv = kvm_default_props; pv->prop; pv++) { in x86_cpu_change_kvm_default()
198 if (!strcmp(pv->prop, prop)) { in x86_cpu_change_kvm_default()
199 pv->value = value; in x86_cpu_change_kvm_default()
208 assert(pv->prop); in x86_cpu_change_kvm_default()
218 if (xcc->model) { in kvm_cpu_instance_init()
223 x86_cpu_change_kvm_default("kvm-msi-ext-dest-id", "on"); in kvm_cpu_instance_init()
230 if (xcc->max_features) { in kvm_cpu_instance_init()
241 acc->cpu_target_realize = kvm_cpu_realizefn; in kvm_cpu_accel_class_init()
242 acc->cpu_instance_init = kvm_cpu_instance_init; in kvm_cpu_accel_class_init()
245 .name = ACCEL_CPU_NAME("kvm"),