From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 0/2] KVM: x86: Fix REP-string effect on RCX/RSI/RDI Date: Sun, 10 May 2015 17:28:39 +0200 Message-ID: <554F7927.6040303@redhat.com> References: <1430215561-6677-1-git-send-email-namit@cs.technion.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Nadav Amit Return-path: Received: from mx1.redhat.com ([209.132.183.28]:54925 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751381AbbEJP2r (ORCPT ); Sun, 10 May 2015 11:28:47 -0400 In-Reply-To: <1430215561-6677-1-git-send-email-namit@cs.technion.ac.il> Sender: kvm-owner@vger.kernel.org List-ID: On 28/04/2015 12:05, Nadav Amit wrote: > This patch-set fixes KVM behavior when handling a REP-string instruction that > runs with an address-size of 32-bit. In this case ECX/EDI/ESI are used as > counter and pointers, and the high 32-bits should be cleared. > > The first patch handles with the simple case. The second one handles the > corner-case in which ECX is initially zero. It appears that Intel and AMD > behave differently in this case (and some experiments suggest even different > Intel generations act differently), and I could not find any documentation that > describes it. Yet, the behavior of INS/OUTS can be observed by the guest and > VMware appears to get it right. > > Thanks for reviewing the patches. > > Nadav Amit (2): > KVM: x86: Fix update RCX/RDI/RSI on REP-string > KVM: x86: Fix zero iterations REP-string > > arch/x86/kvm/emulate.c | 33 +++++++++++++++++++++++++++------ > 1 file changed, 27 insertions(+), 6 deletions(-) > Applied, thanks. Paolo