Skip to contentSkip to conversation

Minor emulator cleanups

PATCH Applied Avi Kivity 2 participants 4 messages Nov 17, 2010 – Nov 18, 2010

Subsystems (3)
lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

cover Minor emulator cleanups

A couple of trivial patches that clean up a bit of cruft from the emulator.

Avi Kivity (2):
KVM: x86 emulator: drop unused #ifndef __KERNEL__
KVM: x86 emulator: drop DPRINTF()

 arch/x86/kvm/emulate.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)
Signature · 1 line
1.7.3.1
author
#1 lore raw

PATCH 1/2 KVM: x86 emulator: drop unused #ifndef __KERNEL__

---
 arch/x86/kvm/emulate.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)
arch/x86/kvm/emulate.c +0 -7
index 38b6e8d..ffd6e01 100644
@@ -20,16 +20,9 @@
  * From: xen-unstable 10676:af9809f51f81a3c43f276f00c81a52ef558afda4
  */
 
-#ifndef __KERNEL__
-#include <stdio.h>
-#include <stdint.h>
-#include <public/xen.h>
-#define DPRINTF(_f, _a ...) printf(_f , ## _a)
-#else
 #include <linux/kvm_host.h>
 #include "kvm_cache_regs.h"
 #define DPRINTF(x...) do {} while (0)
-#endif
 #include <linux/module.h>
 #include <asm/kvm_emulate.h>
 
Signature · 1 line
1.7.3.1
author
#2 lore raw

PATCH 2/2 KVM: x86 emulator: drop DPRINTF()

In reply to Avi Kivity

Failed emulation is reported via a tracepoint; the cmps printk is pointless.

---
 arch/x86/kvm/emulate.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
arch/x86/kvm/emulate.c +1 -6
index ffd6e01..3325b47 100644
@@ -22,7 +22,6 @@
 
 #include <linux/kvm_host.h>
 #include "kvm_cache_regs.h"
-#define DPRINTF(x...) do {} while (0)
 #include <linux/module.h>
 #include <asm/kvm_emulate.h>
 
@@ -2796,10 +2795,8 @@ done_prefixes:
 	c->execute = opcode.u.execute;
 
 	/* Unrecognised? */
-	if (c->d == 0 || (c->d & Undefined)) {
-		DPRINTF("Cannot emulate %02x\n", c->b);
+	if (c->d == 0 || (c->d & Undefined))
 		return -1;
-	}
 
 	if (mode == X86EMUL_MODE_PROT64 && (c->d & Stack))
 		c->op_bytes = 8;
@@ -3261,7 +3258,6 @@ special_insn:
 		break;
 	case 0xa6 ... 0xa7:	/* cmps */
 		c->dst.type = OP_NONE; /* Disable writeback. */
-		DPRINTF("cmps: mem1=0x%p mem2=0x%p\n", c->src.addr.mem, c->dst.addr.mem);
 		goto cmp;
 	case 0xa8 ... 0xa9:	/* test ax, imm */
 		goto test;
@@ -3778,6 +3774,5 @@ twobyte_insn:
 	goto writeback;
 
 cannot_emulate:
-	DPRINTF("Cannot emulate %02x\n", c->b);
 	return -1;
 }
Signature · 1 line
1.7.3.1
#3 lore raw
In reply to Avi Kivity
Quoted 8 lines · Avi Kivity

A couple of trivial patches that clean up a bit of cruft from the emulator.

Avi Kivity (2):
KVM: x86 emulator: drop unused #ifndef __KERNEL__
KVM: x86 emulator: drop DPRINTF()

 arch/x86/kvm/emulate.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)

Applied, thanks.