aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/kvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/kvm.c')
-rw-r--r--arch/x86/kernel/kvm.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index eba6485a59a392..088f4cac97e273 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -375,6 +375,14 @@ static void kvm_guest_cpu_init(void)
wrmsrl(MSR_KVM_PV_EOI_EN, pa);
}
+#ifdef CONFIG_PARAVIRT_SCHED
+ if (pv_sched_enabled()) {
+ unsigned long pa = pv_sched_pa() | KVM_MSR_ENABLED;
+
+ wrmsrl(MSR_KVM_PV_SCHED, pa);
+ }
+#endif
+
if (has_steal_clock)
kvm_register_steal_time();
}
@@ -744,6 +752,14 @@ static void __init kvm_guest_init(void)
alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, asm_sysvec_kvm_asyncpf_interrupt);
}
+#ifdef CONFIG_PARAVIRT_SCHED
+ if (kvm_para_has_feature(KVM_FEATURE_PV_SCHED)) {
+ pr_info("KVM host has PV_SCHED!\n");
+ pv_sched_enable();
+ } else
+ pr_info("KVM host does not support PV_SCHED!\n");
+#endif
+
#ifdef CONFIG_SMP
if (pv_tlb_flush_supported()) {
pv_ops.mmu.flush_tlb_multi = kvm_flush_tlb_multi;