From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCHv4 3/5] KVM: emulator: move some address manipulation function out of emulator code. Date: Thu, 19 Jul 2012 16:34:50 +0300 Message-ID: <50080CFA.4040607@redhat.com> References: <1342683653-32114-1-git-send-email-gleb@redhat.com> <1342683653-32114-4-git-send-email-gleb@redhat.com> <5007E497.1040905@redhat.com> <20120719104951.GU26120@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, mtosatti@redhat.com To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:15751 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751253Ab2GSNey (ORCPT ); Thu, 19 Jul 2012 09:34:54 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6JDYs2e015379 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 19 Jul 2012 09:34:54 -0400 In-Reply-To: <20120719104951.GU26120@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 07/19/2012 01:49 PM, Gleb Natapov wrote: >> All those exports suggest it's better to move the fast path into the >> emulator. > > We've already being through that. Putting the code into emulator gives > us nothing unless it also works on emulator context and working on > partially initialized emulator context is first dangerous and second > slower. We can make it work on an x86_pio_ctxt. What it gives us is common code. (x86_emulate_ctxt can include a x86_pio_ctxt when it does pio). > >> Suppose we change register access to use callbacks instead of >> bulk load/save, could we reuse the exising code? >> > I do not see that problem. This helper function do basic arithmetics > on three values. The value itself will be fetched on demand by the emulator. I meant to reduce the emulator initialization cost, so it isn't slow. btw, I'm guessing that the main speedup comes not from avoiding the decode, but by doing page-at-a-time instead of word-at-a-time. -- error compiling committee.c: too many arguments to function