aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-01-30 10:18:49 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2015-01-30 10:18:49 -0500
commitad15a296471d40703be647b11ddc56df0f1c0cdd (patch)
tree5ec3cbf964598a222f228491ae22d6be7404e235
parent8a395363e2f9f52ec44a1cd892881e8ee1a53269 (diff)
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: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/kvm/vmx.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index de5ce82b2436..81152a070b1f 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -5879,16 +5879,16 @@ static __init int hardware_setup(void)
5879 if (!cpu_has_vmx_unrestricted_guest()) 5879 if (!cpu_has_vmx_unrestricted_guest())
5880 enable_unrestricted_guest = 0; 5880 enable_unrestricted_guest = 0;
5881 5881
5882 if (!cpu_has_vmx_flexpriority()) { 5882 if (!cpu_has_vmx_flexpriority())
5883 flexpriority_enabled = 0; 5883 flexpriority_enabled = 0;
5884 5884
5885 /* 5885 /*
5886 * set_apic_access_page_addr() is used to reload apic access 5886 * set_apic_access_page_addr() is used to reload apic access
5887 * page upon invalidation. No need to do anything if the 5887 * page upon invalidation. No need to do anything if not
5888 * processor does not have the APIC_ACCESS_ADDR VMCS field. 5888 * using the APIC_ACCESS_ADDR VMCS field.
5889 */ 5889 */
5890 if (!flexpriority_enabled)
5890 kvm_x86_ops->set_apic_access_page_addr = NULL; 5891 kvm_x86_ops->set_apic_access_page_addr = NULL;
5891 }
5892 5892
5893 if (!cpu_has_vmx_tpr_shadow()) 5893 if (!cpu_has_vmx_tpr_shadow())
5894 kvm_x86_ops->update_cr8_intercept = NULL; 5894 kvm_x86_ops->update_cr8_intercept = NULL;