Skip to content

Commit

Permalink
KVM: x86 emulator: introduce NoWrite flag
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Avi Kivity authored and Marcelo Tosatti committed Jan 9, 2013
1 parent b7d491e commit b6744dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
#define Unaligned ((u64)1 << 42) /* Explicitly unaligned (e.g. MOVDQU) */
#define Avx ((u64)1 << 43) /* Advanced Vector Extensions */
#define Fastop ((u64)1 << 44) /* Use opcode::u.fastop */
#define NoWrite ((u64)1 << 45) /* No writeback */

#define X2(x...) x, x
#define X3(x...) X2(x), x
Expand Down Expand Up @@ -1633,6 +1634,9 @@ static int writeback(struct x86_emulate_ctxt *ctxt)
{
int rc;

if (ctxt->d & NoWrite)
return X86EMUL_CONTINUE;

switch (ctxt->dst.type) {
case OP_REG:
write_register_operand(&ctxt->dst);
Expand Down

0 comments on commit b6744dc

Please sign in to comment.