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.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 4e37d1a851a6..bc1a27280c4b 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -49,7 +49,7 @@
49 49
50static int kvmapf = 1; 50static int kvmapf = 1;
51 51
52static int parse_no_kvmapf(char *arg) 52static int __init parse_no_kvmapf(char *arg)
53{ 53{
54 kvmapf = 0; 54 kvmapf = 0;
55 return 0; 55 return 0;
@@ -58,7 +58,7 @@ static int parse_no_kvmapf(char *arg)
58early_param("no-kvmapf", parse_no_kvmapf); 58early_param("no-kvmapf", parse_no_kvmapf);
59 59
60static int steal_acc = 1; 60static int steal_acc = 1;
61static int parse_no_stealacc(char *arg) 61static int __init parse_no_stealacc(char *arg)
62{ 62{
63 steal_acc = 0; 63 steal_acc = 0;
64 return 0; 64 return 0;
@@ -67,7 +67,7 @@ static int parse_no_stealacc(char *arg)
67early_param("no-steal-acc", parse_no_stealacc); 67early_param("no-steal-acc", parse_no_stealacc);
68 68
69static int kvmclock_vsyscall = 1; 69static int kvmclock_vsyscall = 1;
70static int parse_no_kvmclock_vsyscall(char *arg) 70static int __init parse_no_kvmclock_vsyscall(char *arg)
71{ 71{
72 kvmclock_vsyscall = 0; 72 kvmclock_vsyscall = 0;
73 return 0; 73 return 0;
@@ -341,10 +341,10 @@ static void kvm_guest_cpu_init(void)
341#endif 341#endif
342 pa |= KVM_ASYNC_PF_ENABLED; 342 pa |= KVM_ASYNC_PF_ENABLED;
343 343
344 /* Async page fault support for L1 hypervisor is optional */ 344 if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF_VMEXIT))
345 if (wrmsr_safe(MSR_KVM_ASYNC_PF_EN, 345 pa |= KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT;
346 (pa | KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT) & 0xffffffff, pa >> 32) < 0) 346
347 wrmsrl(MSR_KVM_ASYNC_PF_EN, pa); 347 wrmsrl(MSR_KVM_ASYNC_PF_EN, pa);
348 __this_cpu_write(apf_reason.enabled, 1); 348 __this_cpu_write(apf_reason.enabled, 1);
349 printk(KERN_INFO"KVM setup async PF for cpu %d\n", 349 printk(KERN_INFO"KVM setup async PF for cpu %d\n",
350 smp_processor_id()); 350 smp_processor_id());
@@ -545,7 +545,8 @@ static void __init kvm_guest_init(void)
545 pv_time_ops.steal_clock = kvm_steal_clock; 545 pv_time_ops.steal_clock = kvm_steal_clock;
546 } 546 }
547 547
548 if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH)) 548 if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
549 !kvm_para_has_feature(KVM_FEATURE_STEAL_TIME))
549 pv_mmu_ops.flush_tlb_others = kvm_flush_tlb_others; 550 pv_mmu_ops.flush_tlb_others = kvm_flush_tlb_others;
550 551
551 if (kvm_para_has_feature(KVM_FEATURE_PV_EOI)) 552 if (kvm_para_has_feature(KVM_FEATURE_PV_EOI))
@@ -633,7 +634,8 @@ static __init int kvm_setup_pv_tlb_flush(void)
633{ 634{
634 int cpu; 635 int cpu;
635 636
636 if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH)) { 637 if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
638 !kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {
637 for_each_possible_cpu(cpu) { 639 for_each_possible_cpu(cpu) {
638 zalloc_cpumask_var_node(per_cpu_ptr(&__pv_tlb_mask, cpu), 640 zalloc_cpumask_var_node(per_cpu_ptr(&__pv_tlb_mask, cpu),
639 GFP_KERNEL, cpu_to_node(cpu)); 641 GFP_KERNEL, cpu_to_node(cpu));