From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Joerg Roedel" Subject: [PATCH] SVM: inject high priority interrupts first Date: Tue, 11 Dec 2007 21:01:49 +0100 Message-ID: <11974033091253-git-send-email-joerg.roedel@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Joerg Roedel , Markus Rechberger To: "Avi Kivity" Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This patch changes the order in which interrupts are injected when the in-kernel APIC is disabled. Now the IRQ with the highest priority is injected first. Signed-off-by: Joerg Roedel Signed-off-by: Markus Rechberger --- drivers/kvm/svm.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 839a75f..59ec261 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c @@ -1389,8 +1389,8 @@ static void kvm_reput_irq(struct vcpu_svm *svm) static void svm_do_inject_vector(struct vcpu_svm *svm) { struct kvm_vcpu *vcpu = &svm->vcpu; - int word_index = __ffs(vcpu->irq_summary); - int bit_index = __ffs(vcpu->irq_pending[word_index]); + int word_index = __fls(vcpu->irq_summary); + int bit_index = __fls(vcpu->irq_pending[word_index]); int irq = word_index * BITS_PER_LONG + bit_index; clear_bit(bit_index, &vcpu->irq_pending[word_index]); -- 1.5.2.5 ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php