Commit 5df56646 authored by Gleb Natapov's avatar Gleb Natapov Committed by Avi Kivity

KVM: Use kvm_arch_interrupt_allowed() instead of checking interrupt_window_open directly

kvm_arch_interrupt_allowed() also checks IF so drop the check.
Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 1f21e79a
...@@ -3071,8 +3071,7 @@ static int dm_request_for_irq_injection(struct kvm_vcpu *vcpu, ...@@ -3071,8 +3071,7 @@ static int dm_request_for_irq_injection(struct kvm_vcpu *vcpu,
{ {
return (!irqchip_in_kernel(vcpu->kvm) && !kvm_cpu_has_interrupt(vcpu) && return (!irqchip_in_kernel(vcpu->kvm) && !kvm_cpu_has_interrupt(vcpu) &&
kvm_run->request_interrupt_window && kvm_run->request_interrupt_window &&
vcpu->arch.interrupt_window_open && kvm_arch_interrupt_allowed(vcpu));
(kvm_x86_ops->get_rflags(vcpu) & X86_EFLAGS_IF));
} }
static void post_kvm_run_save(struct kvm_vcpu *vcpu, static void post_kvm_run_save(struct kvm_vcpu *vcpu,
...@@ -3085,7 +3084,7 @@ static void post_kvm_run_save(struct kvm_vcpu *vcpu, ...@@ -3085,7 +3084,7 @@ static void post_kvm_run_save(struct kvm_vcpu *vcpu,
kvm_run->ready_for_interrupt_injection = 1; kvm_run->ready_for_interrupt_injection = 1;
else else
kvm_run->ready_for_interrupt_injection = kvm_run->ready_for_interrupt_injection =
(vcpu->arch.interrupt_window_open && (kvm_arch_interrupt_allowed(vcpu) &&
!kvm_cpu_has_interrupt(vcpu)); !kvm_cpu_has_interrupt(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