diff options
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r-- | arch/x86/kvm/vmx.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index fb93010beaa4..003618e324ce 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -2072,7 +2072,8 @@ static void vmx_vcpu_pi_load(struct kvm_vcpu *vcpu, int cpu) | |||
2072 | unsigned int dest; | 2072 | unsigned int dest; |
2073 | 2073 | ||
2074 | if (!kvm_arch_has_assigned_device(vcpu->kvm) || | 2074 | if (!kvm_arch_has_assigned_device(vcpu->kvm) || |
2075 | !irq_remapping_cap(IRQ_POSTING_CAP)) | 2075 | !irq_remapping_cap(IRQ_POSTING_CAP) || |
2076 | !kvm_vcpu_apicv_active(vcpu)) | ||
2076 | return; | 2077 | return; |
2077 | 2078 | ||
2078 | do { | 2079 | do { |
@@ -2180,7 +2181,8 @@ static void vmx_vcpu_pi_put(struct kvm_vcpu *vcpu) | |||
2180 | struct pi_desc *pi_desc = vcpu_to_pi_desc(vcpu); | 2181 | struct pi_desc *pi_desc = vcpu_to_pi_desc(vcpu); |
2181 | 2182 | ||
2182 | if (!kvm_arch_has_assigned_device(vcpu->kvm) || | 2183 | if (!kvm_arch_has_assigned_device(vcpu->kvm) || |
2183 | !irq_remapping_cap(IRQ_POSTING_CAP)) | 2184 | !irq_remapping_cap(IRQ_POSTING_CAP) || |
2185 | !kvm_vcpu_apicv_active(vcpu)) | ||
2184 | return; | 2186 | return; |
2185 | 2187 | ||
2186 | /* Set SN when the vCPU is preempted */ | 2188 | /* Set SN when the vCPU is preempted */ |
@@ -10714,7 +10716,8 @@ static int vmx_pre_block(struct kvm_vcpu *vcpu) | |||
10714 | struct pi_desc *pi_desc = vcpu_to_pi_desc(vcpu); | 10716 | struct pi_desc *pi_desc = vcpu_to_pi_desc(vcpu); |
10715 | 10717 | ||
10716 | if (!kvm_arch_has_assigned_device(vcpu->kvm) || | 10718 | if (!kvm_arch_has_assigned_device(vcpu->kvm) || |
10717 | !irq_remapping_cap(IRQ_POSTING_CAP)) | 10719 | !irq_remapping_cap(IRQ_POSTING_CAP) || |
10720 | !kvm_vcpu_apicv_active(vcpu)) | ||
10718 | return 0; | 10721 | return 0; |
10719 | 10722 | ||
10720 | vcpu->pre_pcpu = vcpu->cpu; | 10723 | vcpu->pre_pcpu = vcpu->cpu; |
@@ -10780,7 +10783,8 @@ static void vmx_post_block(struct kvm_vcpu *vcpu) | |||
10780 | unsigned long flags; | 10783 | unsigned long flags; |
10781 | 10784 | ||
10782 | if (!kvm_arch_has_assigned_device(vcpu->kvm) || | 10785 | if (!kvm_arch_has_assigned_device(vcpu->kvm) || |
10783 | !irq_remapping_cap(IRQ_POSTING_CAP)) | 10786 | !irq_remapping_cap(IRQ_POSTING_CAP) || |
10787 | !kvm_vcpu_apicv_active(vcpu)) | ||
10784 | return; | 10788 | return; |
10785 | 10789 | ||
10786 | do { | 10790 | do { |
@@ -10833,7 +10837,8 @@ static int vmx_update_pi_irte(struct kvm *kvm, unsigned int host_irq, | |||
10833 | int idx, ret = -EINVAL; | 10837 | int idx, ret = -EINVAL; |
10834 | 10838 | ||
10835 | if (!kvm_arch_has_assigned_device(kvm) || | 10839 | if (!kvm_arch_has_assigned_device(kvm) || |
10836 | !irq_remapping_cap(IRQ_POSTING_CAP)) | 10840 | !irq_remapping_cap(IRQ_POSTING_CAP) || |
10841 | !kvm_vcpu_apicv_active(kvm->vcpus[0])) | ||
10837 | return 0; | 10842 | return 0; |
10838 | 10843 | ||
10839 | idx = srcu_read_lock(&kvm->irq_srcu); | 10844 | idx = srcu_read_lock(&kvm->irq_srcu); |