提交 ad15a296 编写于 作者: P Paolo Bonzini

kvm: vmx: fix oops with explicit flexpriority=0 option

A function pointer was not NULLed, causing kvm_vcpu_reload_apic_access_page to
go down the wrong path and OOPS when doing put_page(NULL).

This did not happen on old processors, only when setting the module option
explicitly.
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 8a395363
...@@ -5879,16 +5879,16 @@ static __init int hardware_setup(void) ...@@ -5879,16 +5879,16 @@ static __init int hardware_setup(void)
if (!cpu_has_vmx_unrestricted_guest()) if (!cpu_has_vmx_unrestricted_guest())
enable_unrestricted_guest = 0; enable_unrestricted_guest = 0;
if (!cpu_has_vmx_flexpriority()) { if (!cpu_has_vmx_flexpriority())
flexpriority_enabled = 0; flexpriority_enabled = 0;
/* /*
* set_apic_access_page_addr() is used to reload apic access * set_apic_access_page_addr() is used to reload apic access
* page upon invalidation. No need to do anything if the * page upon invalidation. No need to do anything if not
* processor does not have the APIC_ACCESS_ADDR VMCS field. * using the APIC_ACCESS_ADDR VMCS field.
*/ */
if (!flexpriority_enabled)
kvm_x86_ops->set_apic_access_page_addr = NULL; kvm_x86_ops->set_apic_access_page_addr = NULL;
}
if (!cpu_has_vmx_tpr_shadow()) if (!cpu_has_vmx_tpr_shadow())
kvm_x86_ops->update_cr8_intercept = NULL; kvm_x86_ops->update_cr8_intercept = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册