summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/kvm_emulate.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-08-26 14:31:30 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2010-11-22 11:00:18 -0800
commit4c3c3a114f20eb79e0fd09fba6dd13a373a73ced (patch)
tree4a973b648c026997dfb79f115b9d80fdbafb981d /arch/x86/include/asm/kvm_emulate.h
parente3a8550880f75c4ca34ac8009b8d8190d36d5c0b (diff)
KVM: x86 emulator: fix regression with cmpxchg8b on i386 hosts
commit 16518d5ada690643453eb0aef3cc7841d3623c2d upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/x86/include/asm/kvm_emulate.h')
-rw-r--r--arch/x86/include/asm/kvm_emulate.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h
index 0b2729bf2070..50de7b4b2db1 100644
--- a/arch/x86/include/asm/kvm_emulate.h
+++ b/arch/x86/include/asm/kvm_emulate.h
@@ -143,7 +143,15 @@ struct x86_emulate_ops {
struct operand {
enum { OP_REG, OP_MEM, OP_IMM, OP_NONE } type;
unsigned int bytes;
- unsigned long val, orig_val, *ptr;
+ union {
+ unsigned long orig_val;
+ u64 orig_val64;
+ };
+ unsigned long *ptr;
+ union {
+ unsigned long val;
+ u64 val64;
+ };
};
struct fetch_cache {