All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dor Laor <dor.laor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: kvm-devel <kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: [PATCH] VMX: inject high priority interrupts first
Date: Thu, 13 Dec 2007 15:17:54 +0200	[thread overview]
Message-ID: <47613102.1020200@qumranet.com> (raw)

 From 2e80a9eb15769443716ebd87eb2567cd0de9c84e Mon Sep 17 00:00:00 2001
From: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Date: Thu, 13 Dec 2007 15:07:08 +0200
Subject: [PATCH] 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. Noted by Joerg Roedel for SVM.

Signed-off-by: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
---
 drivers/kvm/vmx.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 8e43feb..8375eea 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1736,8 +1736,8 @@ static void vmx_inject_irq(struct kvm_vcpu *vcpu, 
int irq)
 
 static void kvm_do_inject_irq(struct kvm_vcpu *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.3.3


-------------------------------------------------------------------------
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://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

             reply	other threads:[~2007-12-13 13:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-13 13:17 Dor Laor [this message]
     [not found] ` <47613102.1020200-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-13 15:54   ` [PATCH] VMX: inject high priority interrupts first Dong, Eddie
     [not found]     ` <10EA09EFD8728347A513008B6B0DA77A0281F361-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-12-13 16:29       ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47613102.1020200@qumranet.com \
    --to=dor.laor-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.