Commit d71f5e03 authored by Miaohe Lin's avatar Miaohe Lin Committed by Paolo Bonzini

KVM: VMX: Add 'else' to split mutually exclusive case

Each if branch in handle_external_interrupt_irqoff() is mutually
exclusive. Add 'else' to make it clear and also avoid some unnecessary
check.
Signed-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Reviewed-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent e080e538
...@@ -6220,15 +6220,13 @@ static void handle_exception_nmi_irqoff(struct vcpu_vmx *vmx) ...@@ -6220,15 +6220,13 @@ static void handle_exception_nmi_irqoff(struct vcpu_vmx *vmx)
vmx->exit_intr_info = vmcs_read32(VM_EXIT_INTR_INFO); vmx->exit_intr_info = vmcs_read32(VM_EXIT_INTR_INFO);
/* if exit due to PF check for async PF */ /* if exit due to PF check for async PF */
if (is_page_fault(vmx->exit_intr_info)) if (is_page_fault(vmx->exit_intr_info)) {
vmx->vcpu.arch.apf.host_apf_reason = kvm_read_and_reset_pf_reason(); vmx->vcpu.arch.apf.host_apf_reason = kvm_read_and_reset_pf_reason();
/* Handle machine checks before interrupts are enabled */ /* Handle machine checks before interrupts are enabled */
if (is_machine_check(vmx->exit_intr_info)) } else if (is_machine_check(vmx->exit_intr_info)) {
kvm_machine_check(); kvm_machine_check();
/* We need to handle NMIs before interrupts are enabled */ /* We need to handle NMIs before interrupts are enabled */
if (is_nmi(vmx->exit_intr_info)) { } else if (is_nmi(vmx->exit_intr_info)) {
kvm_before_interrupt(&vmx->vcpu); kvm_before_interrupt(&vmx->vcpu);
asm("int $2"); asm("int $2");
kvm_after_interrupt(&vmx->vcpu); kvm_after_interrupt(&vmx->vcpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment