Skip to contentSkip to conversation

KVM: x86 emulator: simplify two-byte opcode check

PATCH Applied Wei Yongjun 2 participants 2 messages Aug 5, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: x86 emulator: simplify two-byte opcode check

Two-byte opcode always start with 0x0F and the decode flags of opcode 0xF0 is always 0, so remove dup check.

---
 arch/x86/kvm/emulate.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
arch/x86/kvm/emulate.c +5 -7
index 8763708..a465823 100644
@@ -2405,13 +2405,11 @@ done_prefixes:
 
 	/* Opcode byte(s). */
 	opcode = opcode_table[c->b];
-	if (opcode.flags == 0) {
-		/* Two-byte opcode? */
-		if (c->b == 0x0f) {
-			c->twobyte = 1;
-			c->b = insn_fetch(u8, 1, c->eip);
-			opcode = twobyte_table[c->b];
-		}
+	/* Two-byte opcode? */
+	if (c->b == 0x0f) {
+		c->twobyte = 1;
+		c->b = insn_fetch(u8, 1, c->eip);
+		opcode = twobyte_table[c->b];
 	}
 	c->d = opcode.flags;
 
Signature · 1 line
1.7.0.4
Applied
#1 lore raw
Quoted 2 lines · Wei Yongjun

Two-byte opcode always start with 0x0F and the decode flags of opcode 0xF0 is always 0, so remove dup check.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function