KVM: x86: IN instruction emulation should ignore REP-prefix
authorNadav Amit <namit@cs.technion.ac.il>
Fri, 18 Apr 2014 00:35:10 +0000 (03:35 +0300)
committerMarcelo Tosatti <mtosatti@redhat.com>
Wed, 23 Apr 2014 20:46:59 +0000 (17:46 -0300)
commite6e39f0438bc4b0da9334ca42337775c7a00db21
treef45f3cd73bf5dfed71656891368654f3cc6c9bab
parent346874c9507a2582d0c00021f848de6e115f276c
KVM: x86: IN instruction emulation should ignore REP-prefix

The IN instruction is not be affected by REP-prefix as INS is.  Therefore, the
emulation should ignore the REP prefix as well.  The current emulator
implementation tries to perform writeback when IN instruction with REP-prefix
is emulated. This causes it to perform wrong memory write or spurious #GP
exception to be injected to the guest.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/emulate.c