Commit 61c50edf authored by Gleb Natapov's avatar Gleb Natapov Committed by Avi Kivity

KVM: SVM: Remove duplicate code in svm_do_inject_vector()

svm_do_inject_vector() reimplements pop_irq().
Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 7fe29e0f
...@@ -2346,15 +2346,7 @@ static void kvm_reput_irq(struct vcpu_svm *svm) ...@@ -2346,15 +2346,7 @@ static void kvm_reput_irq(struct vcpu_svm *svm)
static void svm_do_inject_vector(struct vcpu_svm *svm) static void svm_do_inject_vector(struct vcpu_svm *svm)
{ {
struct kvm_vcpu *vcpu = &svm->vcpu; svm_inject_irq(svm, pop_irq(&svm->vcpu));
int word_index = __ffs(vcpu->arch.irq_summary);
int bit_index = __ffs(vcpu->arch.irq_pending[word_index]);
int irq = word_index * BITS_PER_LONG + bit_index;
clear_bit(bit_index, &vcpu->arch.irq_pending[word_index]);
if (!vcpu->arch.irq_pending[word_index])
clear_bit(word_index, &vcpu->arch.irq_summary);
svm_inject_irq(svm, irq);
} }
static void do_interrupt_requests(struct kvm_vcpu *vcpu, static void do_interrupt_requests(struct kvm_vcpu *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