Skip to content

Commit d71f5e0

Browse files
MiaoheLinbonzini
authored andcommitted
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: Miaohe Lin <linmiaohe@huawei.com> Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent e080e53 commit d71f5e0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

arch/x86/kvm/vmx/vmx.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6220,15 +6220,13 @@ static void handle_exception_nmi_irqoff(struct vcpu_vmx *vmx)
62206220
vmx->exit_intr_info = vmcs_read32(VM_EXIT_INTR_INFO);
62216221

62226222
/* if exit due to PF check for async PF */
6223-
if (is_page_fault(vmx->exit_intr_info))
6223+
if (is_page_fault(vmx->exit_intr_info)) {
62246224
vmx->vcpu.arch.apf.host_apf_reason = kvm_read_and_reset_pf_reason();
6225-
62266225
/* Handle machine checks before interrupts are enabled */
6227-
if (is_machine_check(vmx->exit_intr_info))
6226+
} else if (is_machine_check(vmx->exit_intr_info)) {
62286227
kvm_machine_check();
6229-
62306228
/* We need to handle NMIs before interrupts are enabled */
6231-
if (is_nmi(vmx->exit_intr_info)) {
6229+
} else if (is_nmi(vmx->exit_intr_info)) {
62326230
kvm_before_interrupt(&vmx->vcpu);
62336231
asm("int $2");
62346232
kvm_after_interrupt(&vmx->vcpu);

0 commit comments

Comments
 (0)