Skip to content

Commit

Permalink
KVM: nVMX: Add a return code to vmx_complete_nested_posted_interrupt
Browse files Browse the repository at this point in the history
No functional change intended.

Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Oliver Upton <oupton@google.com>
Message-Id: <20210604172611.281819-4-jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Jim Mattson authored and Paolo Bonzini committed Jun 17, 2021
1 parent d82ee28 commit 650293c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions arch/x86/kvm/vmx/nested.c
Original file line number Diff line number Diff line change
Expand Up @@ -3689,25 +3689,25 @@ void nested_mark_vmcs12_pages_dirty(struct kvm_vcpu *vcpu)
}
}

static void vmx_complete_nested_posted_interrupt(struct kvm_vcpu *vcpu)
static int vmx_complete_nested_posted_interrupt(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
int max_irr;
void *vapic_page;
u16 status;

if (!vmx->nested.pi_desc || !vmx->nested.pi_pending)
return;
return 0;

vmx->nested.pi_pending = false;
if (!pi_test_and_clear_on(vmx->nested.pi_desc))
return;
return 0;

max_irr = find_last_bit((unsigned long *)vmx->nested.pi_desc->pir, 256);
if (max_irr != 256) {
vapic_page = vmx->nested.virtual_apic_map.hva;
if (!vapic_page)
return;
return 0;

__kvm_apic_update_irr(vmx->nested.pi_desc->pir,
vapic_page, &max_irr);
Expand All @@ -3720,6 +3720,7 @@ static void vmx_complete_nested_posted_interrupt(struct kvm_vcpu *vcpu)
}

nested_mark_vmcs12_pages_dirty(vcpu);
return 0;
}

static void nested_vmx_inject_exception_vmexit(struct kvm_vcpu *vcpu,
Expand Down Expand Up @@ -3894,8 +3895,7 @@ static int vmx_check_nested_events(struct kvm_vcpu *vcpu)
}

no_vmexit:
vmx_complete_nested_posted_interrupt(vcpu);
return 0;
return vmx_complete_nested_posted_interrupt(vcpu);
}

static u32 vmx_get_preemption_timer_value(struct kvm_vcpu *vcpu)
Expand Down

0 comments on commit 650293c

Please sign in to comment.