diff options
author | Wanpeng Li <wanpengli@tencent.com> | 2018-02-13 09:05:42 +0800 |
---|---|---|
committer | Radim Krčmář <rkrcmar@redhat.com> | 2018-03-06 18:40:45 +0100 |
commit | 6beacf74c25711d5ee83412a3abc839af8ce6697 (patch) | |
tree | c1d447d139f2783978b2256341d126992656b62d /arch/x86 | |
parent | b2798ba0b8769b42f00899b44a538b5fcecb480d (diff) | |
download | linux-stable-6beacf74c25711d5ee83412a3abc839af8ce6697.tar.gz linux-stable-6beacf74c25711d5ee83412a3abc839af8ce6697.tar.bz2 linux-stable-6beacf74c25711d5ee83412a3abc839af8ce6697.zip |
KVM: X86: Don't use PV TLB flush with dedicated physical CPUs
vCPUs are very unlikely to get preempted when they are the only task
running on a CPU. PV TLB flush is slower that the native flush in that
case, so disable it.
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/kvm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index f803e89e0b47..4ccbff63cb86 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -546,6 +546,7 @@ static void __init kvm_guest_init(void) } if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) && + !kvm_para_has_hint(KVM_HINTS_DEDICATED) && !kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) pv_mmu_ops.flush_tlb_others = kvm_flush_tlb_others; @@ -640,6 +641,7 @@ static __init int kvm_setup_pv_tlb_flush(void) int cpu; if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) && + !kvm_para_has_hint(KVM_HINTS_DEDICATED) && !kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) { for_each_possible_cpu(cpu) { zalloc_cpumask_var_node(per_cpu_ptr(&__pv_tlb_mask, cpu), |