]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
KVM: VMX: Use vmx_get_rflags() to query RFLAGS in vmx_interrupt_blocked()
authorSean Christopherson <sean.j.christopherson@intel.com>
Thu, 23 Apr 2020 02:25:50 +0000 (19:25 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 13 May 2020 16:14:48 +0000 (12:14 -0400)
Use vmx_get_rflags() instead of manually reading vmcs.GUEST_RFLAGS when
querying RFLAGS.IF so that multiple checks against interrupt blocking in
a single run loop only require a single VMREAD.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200423022550.15113-14-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c

index 50a2e464562fa496054f935a9142fab14a14a4ef..71cd210ec368f797e24ae0c73c99607b56d1e9ae 100644 (file)
@@ -4536,7 +4536,7 @@ bool vmx_interrupt_blocked(struct kvm_vcpu *vcpu)
        if (is_guest_mode(vcpu) && nested_exit_on_intr(vcpu))
                return false;
 
-       return !(vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF) ||
+       return !(vmx_get_rflags(vcpu) & X86_EFLAGS_IF) ||
               (vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) &
                (GUEST_INTR_STATE_STI | GUEST_INTR_STATE_MOV_SS));
 }