From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: emulator: do not needlesly sync registers from emulator ctxt to vcpu Date: Wed, 30 Mar 2011 12:50:53 +0200 Message-ID: <4D930B0D.4090809@redhat.com> References: <20110329120838.GQ7766@redhat.com> <4D93083D.6000806@redhat.com> <20110330104727.GS7766@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: mtosatti@redhat.com, kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47726 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754317Ab1C3Ku5 (ORCPT ); Wed, 30 Mar 2011 06:50:57 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2UAovCR001354 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 30 Mar 2011 06:50:57 -0400 In-Reply-To: <20110330104727.GS7766@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 03/30/2011 12:47 PM, Gleb Natapov wrote: > On Wed, Mar 30, 2011 at 12:38:53PM +0200, Avi Kivity wrote: > > On 03/29/2011 02:08 PM, Gleb Natapov wrote: > > >Currently we sync registers back and forth before/after exiting > > >to userspace for IO, but during IO device model shouldn't need to > > >read/write the registers, so we can as well skip those sync points. The > > >only exaception is broken vmware backdor interface. The new code sync > > >registers content during IO only if registers are read from/written to > > >by userspace in the middle of the IO operation and this almost never > > >happens in practise. > > > > While this is a nice idea, how much does it save in practice? It > > does introduce more complexity. > > > > I haven't measured, but can try to do so. It eliminates two copies of > all registers on each MMIO/PIO read. I expect this to be measurable in > workloads that do many such reads. > I don't, especially if these are mmios to userspace. Perhaps it's better to remove the copy on kernel mmio, since it's much faster, if the result is simpler (there can be no KVM_SET_REGS in that context). -- error compiling committee.c: too many arguments to function