aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/hyperv.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/hyperv.c')
-rw-r--r--arch/x86/kvm/hyperv.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index fff790a3f4ee..c0867b0aae3e 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -645,7 +645,9 @@ static int stimer_notify_direct(struct kvm_vcpu_hv_stimer *stimer)
645 .vector = stimer->config.apic_vector 645 .vector = stimer->config.apic_vector
646 }; 646 };
647 647
648 return !kvm_apic_set_irq(vcpu, &irq, NULL); 648 if (lapic_in_kernel(vcpu))
649 return !kvm_apic_set_irq(vcpu, &irq, NULL);
650 return 0;
649} 651}
650 652
651static void stimer_expiration(struct kvm_vcpu_hv_stimer *stimer) 653static void stimer_expiration(struct kvm_vcpu_hv_stimer *stimer)
@@ -1852,7 +1854,13 @@ int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid,
1852 1854
1853 ent->edx |= HV_FEATURE_FREQUENCY_MSRS_AVAILABLE; 1855 ent->edx |= HV_FEATURE_FREQUENCY_MSRS_AVAILABLE;
1854 ent->edx |= HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE; 1856 ent->edx |= HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE;
1855 ent->edx |= HV_STIMER_DIRECT_MODE_AVAILABLE; 1857
1858 /*
1859 * Direct Synthetic timers only make sense with in-kernel
1860 * LAPIC
1861 */
1862 if (lapic_in_kernel(vcpu))
1863 ent->edx |= HV_STIMER_DIRECT_MODE_AVAILABLE;
1856 1864
1857 break; 1865 break;
1858 1866