From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Gregory Haskins" Subject: Re: [PATCH 2/4] KVM: Add irqdevice object Date: Mon, 07 May 2007 10:39:37 -0400 Message-ID: <463F01C9.BA47.005A.0@novell.com> References: <20070502212713.16738.8133.stgit@novell1.haskins.net> <20070502214320.16738.21505.stgit@novell1.haskins.net> <463EF493.9070300@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: "Avi Kivity" Return-path: In-Reply-To: <463EF493.9070300-atKUWr5tajBWk0Htik3J/w@public.gmane.org> Content-Disposition: inline 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 >>> On Mon, May 7, 2007 at 5:42 AM, in message <463EF493.9070300-atKUWr5tajBWk0Htik3J/w@public.gmane.org>, Avi Kivity wrote: > >> +static void do_interrupt_requests(struct kvm_vcpu *vcpu, >> + struct kvm_run *kvm_run) >> +{ >> + int pending = __kvm_vcpu_irq_all_pending(vcpu); >> + int handled = 0; >> + >> + while (pending && !handled) { >> + kvm_irqpin_t pin = __fls(pending); >> + >> + switch (pin) { >> + case kvm_irqpin_localint: >> + case kvm_irqpin_extint: >> + case kvm_irqpin_nmi: >> + handled = do_intr_requests(vcpu, kvm_run, pin); >> + break; >> + case kvm_irqpin_smi: >> + /* ignored (for now) */ >> + printk(KERN_WARNING >> + "KVM: dropping unhandled SMI\n"); >> + __clear_bit(pin, &vcpu- >irq.pending); >> + break; >> + case kvm_irqpin_invalid: >> + /* drop */ >> + break; >> + default: >> + panic("KVM: unknown interrupt pin raised: %d\n", pin); >> + break; >> + } >> + >> + __clear_bit(pin, &pending); >> + } >> } >> > > This code can be shared with the svm function of the same name and moved > to kvm_main, no? You'll need a new arch op for do_inter_requests(). > Originally I was going to do exactly what you are proposing, but later (as you will see with my refresh coming shortly) they start to diverge between VMX and SVN. I will still be on the lookout for places where we can centralize, however. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/