* [PATCH] VMX: inject high priority interrupts first
@ 2007-12-13 13:17 Dor Laor
[not found] ` <47613102.1020200-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Dor Laor @ 2007-12-13 13:17 UTC (permalink / raw)
To: kvm-devel
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
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <47613102.1020200-atKUWr5tajBWk0Htik3J/w@public.gmane.org>]
* Re: [PATCH] VMX: inject high priority interrupts first [not found] ` <47613102.1020200-atKUWr5tajBWk0Htik3J/w@public.gmane.org> @ 2007-12-13 15:54 ` Dong, Eddie [not found] ` <10EA09EFD8728347A513008B6B0DA77A0281F361-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Dong, Eddie @ 2007-12-13 15:54 UTC (permalink / raw) To: dor.laor-atKUWr5tajBWk0Htik3J/w, kvm-devel [-- Attachment #1: Type: text/plain, Size: 2679 bytes --] This is not necessary, vector doesn;t mean priority. Remember I ever had a talk with Avi that user level irqchip could only support one vector pending in kernel like you mentioned too. On the other hand, if we have multiple pending vectors, we will lose priority. The point here is that vector doesn;t stand for priority for example slave PIC has higher priority than IRQ3-7 of master PIC. Using ffs or fls doesn;t matter here. But I think we'd better clean the code to just use pending_vector instead of bitmap to reduce those kind of unnecessary bit scan/set/clear etc. Eddie >-----Original Message----- >From: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >[mailto:kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Dor Laor >Sent: 2007年12月13日 21:18 >To: kvm-devel >Subject: [kvm-devel] [PATCH] VMX: inject high priority interrupts first > > 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.ne >t/marketplace >_______________________________________________ >kvm-devel mailing list >kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >https://lists.sourceforge.net/lists/listinfo/kvm-devel > [-- Attachment #2: Type: text/plain, Size: 308 bytes --] ------------------------------------------------------------------------- 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 [-- Attachment #3: Type: text/plain, Size: 186 bytes --] _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <10EA09EFD8728347A513008B6B0DA77A0281F361-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>]
* Re: [PATCH] VMX: inject high priority interrupts first [not found] ` <10EA09EFD8728347A513008B6B0DA77A0281F361-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> @ 2007-12-13 16:29 ` Avi Kivity 0 siblings, 0 replies; 3+ messages in thread From: Avi Kivity @ 2007-12-13 16:29 UTC (permalink / raw) To: Dong, Eddie; +Cc: kvm-devel [-- Attachment #1: Type: text/plain, Size: 774 bytes --] Dong, Eddie wrote: > This is not necessary, vector doesn;t mean priority. > > Remember I ever had a talk with Avi that user level irqchip could only support > one vector pending in kernel like you mentioned too. On the other hand, > if we have multiple pending vectors, we will lose priority. The point here > is that vector doesn;t stand for priority for example slave PIC has higher priority > than IRQ3-7 of master PIC. Using ffs or fls doesn;t matter here. > > Yes. > But I think we'd better clean the code to just use pending_vector instead > of bitmap to reduce those kind of unnecessary bit scan/set/clear etc. > That's my plan; use a pending vector and put it in subarch independent code. -- error compiling committee.c: too many arguments to function [-- Attachment #2: Type: text/plain, Size: 308 bytes --] ------------------------------------------------------------------------- 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 [-- Attachment #3: Type: text/plain, Size: 186 bytes --] _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-12-13 16:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-13 13:17 [PATCH] VMX: inject high priority interrupts first Dor Laor
[not found] ` <47613102.1020200-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-13 15:54 ` Dong, Eddie
[not found] ` <10EA09EFD8728347A513008B6B0DA77A0281F361-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-12-13 16:29 ` Avi Kivity
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox