mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-30 23:10:38 +00:00
target/i386: disable VMX features if nested=0
If kvm does not support VMX feature by nested=0, the kvm_vmx_basic can't get the right value from MSR_IA32_VMX_BASIC register, which make qemu coredump when qemu do KVM_SET_MSRS. The coredump info: error: failed to set MSR 0x480 to 0x0 kvm_put_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed. Signed-off-by: Yang Zhong <yang.zhong@intel.com> Message-Id: <20191206071111.12128-1-yang.zhong@intel.com> Reported-by: Catherine Ho <catherine.hecx@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
1bdc319ab5
commit
2605188240
@ -2572,6 +2572,14 @@ static void kvm_msr_entry_add_vmx(X86CPU *cpu, FeatureWordArray f)
|
|||||||
uint64_t kvm_vmx_basic =
|
uint64_t kvm_vmx_basic =
|
||||||
kvm_arch_get_supported_msr_feature(kvm_state,
|
kvm_arch_get_supported_msr_feature(kvm_state,
|
||||||
MSR_IA32_VMX_BASIC);
|
MSR_IA32_VMX_BASIC);
|
||||||
|
|
||||||
|
if (!kvm_vmx_basic) {
|
||||||
|
/* If the kernel doesn't support VMX feature (kvm_intel.nested=0),
|
||||||
|
* then kvm_vmx_basic will be 0 and KVM_SET_MSR will fail.
|
||||||
|
*/
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint64_t kvm_vmx_misc =
|
uint64_t kvm_vmx_misc =
|
||||||
kvm_arch_get_supported_msr_feature(kvm_state,
|
kvm_arch_get_supported_msr_feature(kvm_state,
|
||||||
MSR_IA32_VMX_MISC);
|
MSR_IA32_VMX_MISC);
|
||||||
|
Loading…
Reference in New Issue
Block a user