[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87mu8knys8.fsf@vitty.brq.redhat.com>
Date: Fri, 13 Mar 2020 14:56:55 +0100
From: Vitaly Kuznetsov <vkuznets@...hat.com>
To: Sean Christopherson <sean.j.christopherson@...el.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, Xiaoyao Li <xiaoyao.li@...el.com>
Subject: Re: [PATCH 07/10] KVM: nVMX: Cast exit_reason to u16 to check for nested EXTERNAL_INTERRUPT
Sean Christopherson <sean.j.christopherson@...el.com> writes:
> Explicitly check only the basic exit reason when emulating an external
> interrupt VM-Exit in nested_vmx_vmexit(). Checking the full exit reason
> doesn't currently cause problems, but only because the only exit reason
> modifier support by KVM is FAILED_VMENTRY, which is mutually exclusive
> with EXTERNAL_INTERRUPT. Future modifiers, e.g. ENCLAVE_MODE, will
> coexist with EXTERNAL_INTERRUPT.
>
> Signed-off-by: Sean Christopherson <sean.j.christopherson@...el.com>
> ---
> arch/x86/kvm/vmx/nested.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index 8fbbe2152ab7..86b12a2918c5 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -4337,7 +4337,7 @@ void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 exit_reason,
> vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
>
> if (likely(!vmx->fail)) {
> - if (exit_reason == EXIT_REASON_EXTERNAL_INTERRUPT &&
> + if ((u16)exit_reason == EXIT_REASON_EXTERNAL_INTERRUPT &&
> nested_exit_intr_ack_set(vcpu)) {
> int irq = kvm_cpu_get_interrupt(vcpu);
> WARN_ON(irq < 0);
Reviewed-by: Vitaly Kuznetsov <vkuznets@...hat.com>
--
Vitaly
Powered by blists - more mailing lists