From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: VMX: Enable memory mappedTPR shadow(FlexPriority) Date: Wed, 31 Oct 2007 02:47:26 +0200 Message-ID: <4727D09E.2040008@qumranet.com> References: <1193657732.4484.17.camel@izike-woof.qumranet.com> <10EA09EFD8728347A513008B6B0DA77A024CEC5E@pdsmsx411.ccr.corp.intel.com> <472719A1.6070709@qumranet.com> <10EA09EFD8728347A513008B6B0DA77A024CECAA@pdsmsx411.ccr.corp.intel.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: "Dong, Eddie" Return-path: In-Reply-To: <10EA09EFD8728347A513008B6B0DA77A024CECAA-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 Dong, Eddie wrote: >> Yes. FlexPriority will be both faster and safer for those who have it >> than my hack. >> >> It may turn out that patching can improve performance even with >> FlexPriority: we can patch the APIC EOI write to look if any >> interrupts are pending, and only exit if the EOI will result in a new >> interrupt being injected. But it is very possible that this will not >> be necessary if we can achieve good interrupt mitigation with virtio. >> >> > Mmm, I won't say so. The issues is: A guest EOI (level triggered IRQ) > need to clear remote IRR bit in IOAPIC side and resample that pin in > IOAPIC side. > This one is not easy to do in patched code. > > Hmm... The patched code needs to answer the question "what will happen if I EOI this vector now"? I think kvm can prepare the answer for that question, since it knows the irq is still asserted and that the mode is level-triggered. Basically the kvm lapic code has to calculate the IRR for a "speculative EOI" and post that in the shared memory block. If something changes (the IRQ line is de-asserted, for example) again it has to recalculate it. So yes, it will not be easy. -- Any sufficiently difficult bug is indistinguishable from a feature. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/