From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takuya Yoshikawa Subject: Re: [PATCH 22/24] KVM: x86 emulator: restart string instruction without going back to a guest. Date: Wed, 10 Mar 2010 18:12:34 +0900 Message-ID: <4B976282.7020108@oss.ntt.co.jp> References: <1268143762-4000-1-git-send-email-gleb@redhat.com> <1268143762-4000-23-git-send-email-gleb@redhat.com> <4B966035.2050904@redhat.com> <20100309181157.GF9066@redhat.com> <4B97043C.2000603@oss.ntt.co.jp> <20100310090633.GS16909@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from serv2.oss.ntt.co.jp ([222.151.198.100]:36822 "EHLO serv2.oss.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750769Ab0CJJKE (ORCPT ); Wed, 10 Mar 2010 04:10:04 -0500 In-Reply-To: <20100310090633.GS16909@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Gleb Natapov wrote: > On Wed, Mar 10, 2010 at 11:30:20AM +0900, Takuya Yoshikawa wrote: >> Gleb Natapov wrote: >>> On Tue, Mar 09, 2010 at 04:50:29PM +0200, Avi Kivity wrote: >>>> On 03/09/2010 04:09 PM, Gleb Natapov wrote: >>>>> Currently when string instruction is only partially complete we go back >>>>> to a guest mode, guest tries to reexecute instruction and exits again >>>>> and at this point emulation continues. Avoid all of this by restarting >>>>> instruction without going back to a guest mode. >>>> What happens if rcx is really big? Going back into the guest gave >>>> us a preemption point. >>>> >>> Two solutions. We can check if reschedule is required and yield cpu if >>> needed. Or we can enter guest from time to time. >> One generic question: from the viewpoint of KVM's policy, is it OK to make >> the semantics different from real CPUs? >> >> Semantics, may be better to use other words, but I'm little bit worried that >> the second solution may change something, not mentioning about bugs but some >> behavior patterns depending on the "time to time". >> > Entering guest from time to time will not change semantics of the > processor (if code is not modified under processor's feet at least). > Currently we reenter guest mode after each iteration of string > instruction for all instruction but ins/outs. > E.g., is there no chance that during the repetitions, in the middle of the repetitions, page faults occur? If it can, without entering the guest, can we handle it? -- I lack some basic assumptions? > -- > Gleb. > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html