public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: x86: Fix REP-string effect on RCX/RSI/RDI
@ 2015-04-28 10:05 Nadav Amit
  2015-04-28 10:06 ` [PATCH 1/2] KVM: x86: Fix update RCX/RDI/RSI on REP-string Nadav Amit
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nadav Amit @ 2015-04-28 10:05 UTC (permalink / raw)
  To: pbonzini; +Cc: kvm, Nadav Amit

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(-)

-- 
2.1.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-10 15:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-28 10:05 [PATCH 0/2] KVM: x86: Fix REP-string effect on RCX/RSI/RDI Nadav Amit
2015-04-28 10:06 ` [PATCH 1/2] KVM: x86: Fix update RCX/RDI/RSI on REP-string Nadav Amit
2015-04-28 10:06 ` [PATCH 2/2] KVM: x86: Fix zero iterations REP-string Nadav Amit
2015-05-10 15:28 ` [PATCH 0/2] KVM: x86: Fix REP-string effect on RCX/RSI/RDI Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox