This is a note to let you know that I've just added the patch titled

    KVM: x86 emulator: fix byte-sized MOVZX/MOVSX

to the 3.5-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kvm-x86-emulator-fix-byte-sized-movzx-movsx.patch
and it can be found in the queue-3.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From [email protected]  Fri Aug 17 11:07:31 2012
From: Avi Kivity <[email protected]>
Date: Wed, 15 Aug 2012 11:49:04 +0300
Subject: KVM: x86 emulator: fix byte-sized MOVZX/MOVSX
To: [email protected]
Cc: Marcelo Tosatti <[email protected]>
Message-ID: <[email protected]>

From: Avi Kivity <[email protected]>

(cherry picked from commit 361cad2b50a2c92b91b6f568db860fabad3bf149)

Commit 2adb5ad9fe1 removed ByteOp from MOVZX/MOVSX, replacing them by
SrcMem8, but neglected to fix the dependency in the emulation code
on ByteOp.  This caused the instruction not to have any effect in
some circumstances.

Fix by replacing the check for ByteOp with the equivalent src.op_bytes == 1.

Signed-off-by: Avi Kivity <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 arch/x86/kvm/emulate.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -4426,12 +4426,12 @@ twobyte_insn:
                break;
        case 0xb6 ... 0xb7:     /* movzx */
                ctxt->dst.bytes = ctxt->op_bytes;
-               ctxt->dst.val = (ctxt->d & ByteOp) ? (u8) ctxt->src.val
+               ctxt->dst.val = (ctxt->src.bytes == 1) ? (u8) ctxt->src.val
                                                       : (u16) ctxt->src.val;
                break;
        case 0xbe ... 0xbf:     /* movsx */
                ctxt->dst.bytes = ctxt->op_bytes;
-               ctxt->dst.val = (ctxt->d & ByteOp) ? (s8) ctxt->src.val :
+               ctxt->dst.val = (ctxt->src.bytes == 1) ? (s8) ctxt->src.val :
                                                        (s16) ctxt->src.val;
                break;
        case 0xc0 ... 0xc1:     /* xadd */


Patches currently in stable-queue which might be from [email protected] are

queue-3.5/kvm-vmx-fix-kvm_set_sregs-with-big-real-mode-segments.patch
queue-3.5/kvm-pic-call-ack-notifiers-for-irqs-that-are-dropped-form-irr.patch
queue-3.5/kvm-x86-apply-kvmclock-offset-to-guest-wall-clock-time.patch
queue-3.5/kvm-vmx-fix-ds-es-corruption-on-i386-with-preemption.patch
queue-3.5/kvm-x86-emulator-fix-byte-sized-movzx-movsx.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to