Return-Path: Received: from mail-dm3nam03on0131.outbound.protection.outlook.com ([104.47.41.131]:48288 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032608AbeCAPjf (ORCPT ); Thu, 1 Mar 2018 10:39:35 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: David Hildenbrand , Paolo Bonzini , Sasha Levin Subject: [added to the 4.1 stable tree] KVM: nVMX: vmx_complete_nested_posted_interrupt() can't fail Date: Thu, 1 Mar 2018 15:27:50 +0000 Message-ID: <20180301152116.1486-502-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: David Hildenbrand This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit 6342c50ad12e8ce0736e722184a7dbdea4a3477f ] vmx_complete_nested_posted_interrupt() can't fail, let's turn it into a void function. Signed-off-by: David Hildenbrand Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin --- arch/x86/kvm/vmx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index b76f9479b413..ffd5502dd215 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -4362,7 +4362,7 @@ static int vmx_vm_has_apicv(struct kvm *kvm) return enable_apicv && irqchip_in_kernel(kvm); } =20 -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 =3D to_vmx(vcpu); int max_irr; @@ -4373,13 +4373,13 @@ static int vmx_complete_nested_posted_interrupt(str= uct kvm_vcpu *vcpu) vmx->nested.pi_pending) { vmx->nested.pi_pending =3D false; if (!pi_test_and_clear_on(vmx->nested.pi_desc)) - return 0; + return; =20 max_irr =3D find_last_bit( (unsigned long *)vmx->nested.pi_desc->pir, 256); =20 if (max_irr =3D=3D 256) - return 0; + return; =20 vapic_page =3D 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(struc= t kvm_vcpu *vcpu) vmcs_write16(GUEST_INTR_STATUS, status); } } - return 0; } =20 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 *v= cpu, bool external_intr) return 0; } =20 - return vmx_complete_nested_posted_interrupt(vcpu); + vmx_complete_nested_posted_interrupt(vcpu); + return 0; } =20 static u32 vmx_get_preemption_timer_value(struct kvm_vcpu *vcpu) --=20 2.14.1