Skip to contentSkip to conversation

KVM: x86 emulator: fix test_cc() build failure on i386

PATCH Applied Avi Kivity 2 participants 2 messages Jan 26, 2013 – Jan 27, 2013

Subsystems (3)
lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

PATCH 1/1 KVM: x86 emulator: fix test_cc() build failure on i386

'pushq' doesn't exist on i386. Replace with 'push', which should work since the operand is a register.

---
 arch/x86/kvm/emulate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/emulate.c +1 -1
index e99fb72..2b11318 100644
@@ -1013,7 +1013,7 @@ static u8 test_cc(unsigned int condition, unsigned long flags)
 	void (*fop)(void) = (void *)em_setcc + 4 * (condition & 0xf);
 
 	flags = (flags & EFLAGS_MASK) | X86_EFLAGS_IF;
-	asm("pushq %[flags]; popf; call *%[fastop]"
+	asm("push %[flags]; popf; call *%[fastop]"
 	    : "=a"(rc) : [fastop]"r"(fop), [flags]"r"(flags));
 	return rc;
 }
Signature · 1 line
1.8.1
Applied
#1 lore raw
Quoted 4 lines · Avi Kivity

'pushq' doesn't exist on i386. Replace with 'push', which should work since the operand is a register.

Applied, thanks.

Quoted 19 lines
---
 arch/x86/kvm/emulate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/emulate.c +1 -1
index e99fb72..2b11318 100644
@@ -1013,7 +1013,7 @@ static u8 test_cc(unsigned int condition, unsigned long flags)
 	void (*fop)(void) = (void *)em_setcc + 4 * (condition & 0xf);
 
 	flags = (flags & EFLAGS_MASK) | X86_EFLAGS_IF;
-	asm("pushq %[flags]; popf; call *%[fastop]"
+	asm("push %[flags]; popf; call *%[fastop]"
 	    : "=a"(rc) : [fastop]"r"(fop), [flags]"r"(flags));
 	return rc;
 }
Signature · 1 line
1.8.1

--
Gleb.