diff options
author | Avi Kivity <avi.kivity@gmail.com> | 2013-01-04 09:18:50 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2013-01-09 14:39:18 -0500 |
commit | b6744dc3fb55fda7cfcb53beecfa056f02415e6d (patch) | |
tree | 4e0103e988c64576910bca7a7540f6b20a875f38 /arch/x86/kvm/emulate.c | |
parent | b7d491e7f065b5b957a27a65c9e7cd3ef96b2736 (diff) |
KVM: x86 emulator: introduce NoWrite flag
Instead of disabling writeback via OP_NONE, just specify NoWrite.
Acked-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi.kivity@gmail.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | arch/x86/kvm/emulate.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 42c53c8071be..fe113fbb3737 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -151,6 +151,7 @@ | |||
151 | #define Unaligned ((u64)1 << 42) /* Explicitly unaligned (e.g. MOVDQU) */ | 151 | #define Unaligned ((u64)1 << 42) /* Explicitly unaligned (e.g. MOVDQU) */ |
152 | #define Avx ((u64)1 << 43) /* Advanced Vector Extensions */ | 152 | #define Avx ((u64)1 << 43) /* Advanced Vector Extensions */ |
153 | #define Fastop ((u64)1 << 44) /* Use opcode::u.fastop */ | 153 | #define Fastop ((u64)1 << 44) /* Use opcode::u.fastop */ |
154 | #define NoWrite ((u64)1 << 45) /* No writeback */ | ||
154 | 155 | ||
155 | #define X2(x...) x, x | 156 | #define X2(x...) x, x |
156 | #define X3(x...) X2(x), x | 157 | #define X3(x...) X2(x), x |
@@ -1633,6 +1634,9 @@ static int writeback(struct x86_emulate_ctxt *ctxt) | |||
1633 | { | 1634 | { |
1634 | int rc; | 1635 | int rc; |
1635 | 1636 | ||
1637 | if (ctxt->d & NoWrite) | ||
1638 | return X86EMUL_CONTINUE; | ||
1639 | |||
1636 | switch (ctxt->dst.type) { | 1640 | switch (ctxt->dst.type) { |
1637 | case OP_REG: | 1641 | case OP_REG: |
1638 | write_register_operand(&ctxt->dst); | 1642 | write_register_operand(&ctxt->dst); |