Commit 57b76bdb authored by Paolo Bonzini's avatar Paolo Bonzini

x86: kvm: remove useless calls to kvm_para_available

Most code in arch/x86/kernel/kvm.c is called through x86_hyper_kvm, and thus only
runs if KVM has been detected.  There is no need to check again for the CPUID
base.

Cc: Sergio Lopez <slp@redhat.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 3e7093d0
...@@ -308,9 +308,6 @@ static notrace void kvm_guest_apic_eoi_write(u32 reg, u32 val) ...@@ -308,9 +308,6 @@ static notrace void kvm_guest_apic_eoi_write(u32 reg, u32 val)
static void kvm_guest_cpu_init(void) static void kvm_guest_cpu_init(void)
{ {
if (!kvm_para_available())
return;
if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF) && kvmapf) { if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF) && kvmapf) {
u64 pa = slow_virt_to_phys(this_cpu_ptr(&apf_reason)); u64 pa = slow_virt_to_phys(this_cpu_ptr(&apf_reason));
...@@ -625,9 +622,6 @@ static void __init kvm_guest_init(void) ...@@ -625,9 +622,6 @@ static void __init kvm_guest_init(void)
{ {
int i; int i;
if (!kvm_para_available())
return;
paravirt_ops_setup(); paravirt_ops_setup();
register_reboot_notifier(&kvm_pv_reboot_nb); register_reboot_notifier(&kvm_pv_reboot_nb);
for (i = 0; i < KVM_TASK_SLEEP_HASHSIZE; i++) for (i = 0; i < KVM_TASK_SLEEP_HASHSIZE; i++)
...@@ -847,8 +841,6 @@ asm( ...@@ -847,8 +841,6 @@ asm(
*/ */
void __init kvm_spinlock_init(void) void __init kvm_spinlock_init(void)
{ {
if (!kvm_para_available())
return;
/* Does host kernel support KVM_FEATURE_PV_UNHALT? */ /* Does host kernel support KVM_FEATURE_PV_UNHALT? */
if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT)) if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT))
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment