]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KVM: nVMX: vmx_complete_nested_posted_interrupt() can't fail
authorDavid Hildenbrand <david@redhat.com>
Fri, 23 Feb 2018 10:42:15 +0000 (11:42 +0100)
committerSasha Levin <alexander.levin@microsoft.com>
Sun, 4 Mar 2018 15:28:34 +0000 (10:28 -0500)
[ Upstream commit 6342c50ad12e8ce0736e722184a7dbdea4a3477f ]

vmx_complete_nested_posted_interrupt() can't fail, let's turn it into
a void function.

Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
arch/x86/kvm/vmx.c

index b76f9479b41376b110d3ec472fa21934ade63d05..ffd5502dd2157d6a7c59f91e9dbbe767cb74ef97 100644 (file)
@@ -4362,7 +4362,7 @@ static int vmx_vm_has_apicv(struct kvm *kvm)
        return enable_apicv && irqchip_in_kernel(kvm);
 }
 
-static int vmx_complete_nested_posted_interrupt(struct kvm_vcpu *vcpu)
+static void vmx_complete_nested_posted_interrupt(struct kvm_vcpu *vcpu)
 {
        struct vcpu_vmx *vmx = to_vmx(vcpu);
        int max_irr;
@@ -4373,13 +4373,13 @@ static int vmx_complete_nested_posted_interrupt(struct kvm_vcpu *vcpu)
            vmx->nested.pi_pending) {
                vmx->nested.pi_pending = false;
                if (!pi_test_and_clear_on(vmx->nested.pi_desc))
-                       return 0;
+                       return;
 
                max_irr = find_last_bit(
                        (unsigned long *)vmx->nested.pi_desc->pir, 256);
 
                if (max_irr == 256)
-                       return 0;
+                       return;
 
                vapic_page = kmap(vmx->nested.virtual_apic_page);
                __kvm_apic_update_irr(vmx->nested.pi_desc->pir, vapic_page);
@@ -4392,7 +4392,6 @@ static int vmx_complete_nested_posted_interrupt(struct kvm_vcpu *vcpu)
                        vmcs_write16(GUEST_INTR_STATUS, status);
                }
        }
-       return 0;
 }
 
 static inline bool kvm_vcpu_trigger_posted_interrupt(struct kvm_vcpu *vcpu)
@@ -9730,7 +9729,8 @@ static int vmx_check_nested_events(struct kvm_vcpu *vcpu, bool external_intr)
                return 0;
        }
 
-       return vmx_complete_nested_posted_interrupt(vcpu);
+       vmx_complete_nested_posted_interrupt(vcpu);
+       return 0;
 }
 
 static u32 vmx_get_preemption_timer_value(struct kvm_vcpu *vcpu)