From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v2 28/30] KVM: x86 emulator: restart string instruction without going back to a guest. Date: Mon, 15 Mar 2010 11:56:32 +0200 Message-ID: <4B9E0450.4090403@redhat.com> References: <1268583675-3101-1-git-send-email-gleb@redhat.com> <1268583675-3101-29-git-send-email-gleb@redhat.com> <4B9D1545.2020902@redhat.com> <20100314180625.GB5406@redhat.com> <4B9DE55A.5070003@redhat.com> <20100315094447.GG4294@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]:63287 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936058Ab0COJ4e (ORCPT ); Mon, 15 Mar 2010 05:56:34 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2F9uX4c001670 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 15 Mar 2010 05:56:34 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2F9uXna005705 for ; Mon, 15 Mar 2010 05:56:33 -0400 In-Reply-To: <20100315094447.GG4294@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 03/15/2010 11:44 AM, Gleb Natapov wrote: > On Mon, Mar 15, 2010 at 09:44:26AM +0200, Avi Kivity wrote: > >> On 03/14/2010 08:06 PM, Gleb Natapov wrote: >> >>>> Suggest simply reentering every N executions. >>>> >>>> >>> This restart mechanism is, in fact, needed for ins read ahead to work. >>> After reading ahead from IO port we need to avoid entering decoder >>> until entire cache is consumed otherwise decoder will clear cache and >>> data will be lost. So we can't just enter guest in arbitrary times, only >>> when read ahead cache is empty. Since read ahead is never done across >>> page boundary this is save place to re-enter guest. >>> >> Please make the two depend on each other directly then. We can't >> expect the reader of the emulator code know that. >> >> > We can document that. I wouldn't want to have different conditions for > guest re-entry for different opcodes. > We now have a write buffer size of one. It's just a matter of making the emulator know the size of the buffer (extra parameter to ->write_emulated). > >> Have the emulator ask the buffer when it is empty. >> >> > It will be always empty for all string ops except INS. > > Or we can make the buffer larger for everyone (outside this patchset though). -- error compiling committee.c: too many arguments to function