From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/2] kvm: Batch writes to MMIO Date: Wed, 23 Apr 2008 18:04:28 +0300 Message-ID: <480F4FFC.7070909@qumranet.com> References: <12089560583282-git-send-email-Laurent.Vivier@bull.net> <12089560581424-git-send-email-Laurent.Vivier@bull.net> <480F4826.5010301@qumranet.com> <1208962748.4281.28.camel@frecb07144> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net To: Laurent Vivier Return-path: In-Reply-To: <1208962748.4281.28.camel@frecb07144> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org Laurent Vivier wrote: >>> >>> >> This breaks ordering on smp guests. batch_data needs to be a kvm thing, >> not a vcpu thing, and locked, of course. >> > > - is ordering between vcpu important when we already delay operations ? > Yes. Ordering is very different from delaying. Also, we will only delay writes which don't matter (those that simply latch something into a register, which is later read). > - using vcpu avoids the lock > Correctness beats performance > - Why PIO (pio_data) are vcpu things and not kvm things, then ? > pio batching is used for just a single instruction that can work with batches (ins/outs), so a guest can't expect to see partial output. With mmio, you can have 1. mmio 2. raise flag in shared memory 3. other vcpu sees flag, does mmio 4. spin-wait for ack from other vcpu 5. mmio You can't do that with ins/outs. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone