From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v2 24/30] KVM: x86 emulator: during rep emulation decrement ECX only if emulation succeeded Date: Sun, 14 Mar 2010 18:42:21 +0200 Message-ID: <4B9D11ED.205@redhat.com> References: <1268583675-3101-1-git-send-email-gleb@redhat.com> <1268583675-3101-25-git-send-email-gleb@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]:33586 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759503Ab0CNQmX (ORCPT ); Sun, 14 Mar 2010 12:42:23 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2EGgM8V024099 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 14 Mar 2010 12:42:22 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2EGgLCu026904 for ; Sun, 14 Mar 2010 12:42:22 -0400 In-Reply-To: <1268583675-3101-25-git-send-email-gleb@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 03/14/2010 06:21 PM, Gleb Natapov wrote: > > @@ -2943,6 +2942,9 @@ writeback: > c->regs[VCPU_REGS_RDI]); > } > > + if (c->rep_prefix) > + register_address_increment(c,&c->regs[VCPU_REGS_RCX], -1); > + > Should be really (c->rep_prefix && (c->d & String)). Some sse instructions accept rep prefix, as well as pause (rep; nop). We don't emulate any of them now so breakage is only theoretical. -- error compiling committee.c: too many arguments to function