From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 0/7] Rework irq injection infrastructure Date: Thu, 06 Dec 2007 10:28:51 +0200 Message-ID: <4757B2C3.3000402@qumranet.com> References: <11967614542283-git-send-email-avi@qumranet.com> <10EA09EFD8728347A513008B6B0DA77A0279CC10@pdsmsx411.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0967430736==" Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: "Dong, Eddie" Return-path: In-Reply-To: <10EA09EFD8728347A513008B6B0DA77A0279CC10-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> 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 --===============0967430736== Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: quoted-printable Dong, Eddie wrote: > It is not a small change, I still need to study the whole patch :( > If I can get some question clarified earlier, that helps a lot. > > > =20 >> -----Original Message----- >> From: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org=20 >> [mailto:kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of=20 >> Avi Kivity >> Sent: 2007=C4=EA12=D4=C24=C8=D5 17:44 >> To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >> Subject: [kvm-devel] [PATCH 0/7] Rework irq injection infrastructure >> >> The current irq and exception injection infrastructure is=20 >> quite complex and >> has been the source of a number of bugs in the past. This=20 >> patchset simplifies >> irq and exception injection: >> >> - Much more work is carried out in common code rather than=20 >> vmx/svm specific >> code. Information is kept in C variables rather than=20 >> hardware registers >> >> - Exception and interrupts are separated into two independent=20 >> queues. This >> will allow later optimization on AMD where the hardware=20 >> supports two queues, >> and also simplifies the Intel case as now we don't need to=20 >> check the hardware >> whether an exception is pending when injecting and interrupt. >> >> - Interrupts are now only acked after they have been=20 >> successfully injected, >> =20 > > Mmm, how can you know if it is injected successfully? > From the patch, it looks like you know this by checking > IDT_Vectoring in next VM Exit. That means the virtual=20 > interrupt controller state in memory is incorrect temply. > > If the injection success & we can get VM Exit before=20 > next access to those virtual interrupt controller state, > that will be OK,=20 That's the idea. > but that means we eliminate future HW > optimization opportunity. I think we just pay too much > for coding style reason to narrow HW optimization space. > =20 I don't know enough about future hardware... But the motivation here is not coding style, it's to be able to do the injection non-atomically. The tpr-opt patchset wants to write the tpr to memory, and that is a sleeping operation. Similarly, if we emulate big real mode we need to simulate interrupt injection by writing to the stack= . Moving the logic to common code helps, but it could have been done with the original system as well. > If the injection fails, the previous logic will inject it back=20 > immediately; current logic will do normal irq inject path. > The potential differences are: > 1: If a new higher interrupt arrives, we inject new vector. > that is probably OK. > 2: If the fault VM Exit is due to nested exception, the > previous logic will probably inject double fault with the original > interrupt consumed (acked); the new logic will probably inject > double fault too, but keep the IRQ not consumed. I don't have > direct case, but worry about those kind of deviation from native > behavor. > =20 We can probably fix it to ack the interrupt when injecting a double fault= . --=20 error compiling committee.c: too many arguments to function --===============0967430736== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 --===============0967430736== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --===============0967430736==--