x86: don't clear high 32 bits of RAX on sub-word guest I/O port reads
authorJan Beulich <jbeulich@suse.com>
Mon, 11 May 2015 08:37:58 +0000 (10:37 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 11 May 2015 08:37:58 +0000 (10:37 +0200)
1- or 2-byte operations never alter the high halves of registers.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/traps.c

index 22cdfc48ae8e4e19d5d3a930d1266ce2baed735e..4b42b2d20a37bd3539b4645b4102db7747882009 100644 (file)
@@ -2238,7 +2238,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
             if ( op_bytes == 4 )
                 regs->eax = 0;
             else
-                regs->eax &= ~((1u << (op_bytes * 8)) - 1);
+                regs->eax &= ~((1 << (op_bytes * 8)) - 1);
             regs->eax |= guest_io_read(port, op_bytes, v, regs);
         }
         bpmatch = check_guest_io_breakpoint(v, port, op_bytes);