diff options
author | Avi Kivity <avi@redhat.com> | 2010-08-26 07:31:30 -0400 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-09-08 13:50:55 -0400 |
commit | 16518d5ada690643453eb0aef3cc7841d3623c2d (patch) | |
tree | 1ecef3f87959e48d34f2815ddd66b49da1adfa3d /arch/x86/include | |
parent | d56557af19867edb8c0e96f8e26399698a08857f (diff) |
KVM: x86 emulator: fix regression with cmpxchg8b on i386 hosts
operand::val and operand::orig_val are 32-bit on i386, whereas cmpxchg8b
operands are 64-bit.
Fix by adding val64 and orig_val64 union members to struct operand, and
using them where needed.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/kvm_emulate.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h index 51cfd730ac5d..1f99ecfc48e1 100644 --- a/arch/x86/include/asm/kvm_emulate.h +++ b/arch/x86/include/asm/kvm_emulate.h | |||
@@ -152,9 +152,14 @@ struct x86_emulate_ops { | |||
152 | struct operand { | 152 | struct operand { |
153 | enum { OP_REG, OP_MEM, OP_IMM, OP_NONE } type; | 153 | enum { OP_REG, OP_MEM, OP_IMM, OP_NONE } type; |
154 | unsigned int bytes; | 154 | unsigned int bytes; |
155 | unsigned long orig_val, *ptr; | 155 | union { |
156 | unsigned long orig_val; | ||
157 | u64 orig_val64; | ||
158 | }; | ||
159 | unsigned long *ptr; | ||
156 | union { | 160 | union { |
157 | unsigned long val; | 161 | unsigned long val; |
162 | u64 val64; | ||
158 | char valptr[sizeof(unsigned long) + 2]; | 163 | char valptr[sizeof(unsigned long) + 2]; |
159 | }; | 164 | }; |
160 | }; | 165 | }; |