[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] bug in popcnt emulation with some register operand(s)?
From: |
malc |
Subject: |
Re: [Qemu-devel] bug in popcnt emulation with some register operand(s)? |
Date: |
Mon, 8 Oct 2012 11:52:30 +0400 (MSK) |
User-agent: |
Alpine 2.00 (LNX 1167 2008-08-23) |
On Mon, 8 Oct 2012, Andriy Gapon wrote:
>
> I am running Qemu (plain, no kvm, etc) on an AMD 10h machine that
> provides popcnt instruction. Qemu advertises availability of pocnt
> to a guest as well. What I see in the guest that popcnt
> 0x20(%r12),%r8 instruction actually placed its result into %rax.
> With %rdi and %rax operands the instruction worked fine though.
>
>
Does following work?
diff --git a/target-i386/translate.c b/target-i386/translate.c
index e896abf..c36cc3e 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -7818,7 +7818,7 @@ static target_ulong disas_insn(DisasContext *s,
target_ulong pc_start)
goto illegal_op;
modrm = cpu_ldub_code(cpu_single_env, s->pc++);
- reg = ((modrm >> 3) & 7);
+ reg = ((modrm >> 3) & 7) | rex_r;
if (s->prefix & PREFIX_DATA)
ot = OT_WORD;
--
mailto:address@hidden
- [Qemu-devel] bug in popcnt emulation with some register operand(s)?, Andriy Gapon, 2012/10/07
- Re: [Qemu-devel] bug in popcnt emulation with some register operand(s)?,
malc <=
- Re: [Qemu-devel] bug in popcnt emulation with some register operand(s)?, Andriy Gapon, 2012/10/08
- Re: [Qemu-devel] bug in popcnt emulation with some register operand(s)?, Andriy Gapon, 2012/10/10
- Re: [Qemu-devel] bug in popcnt emulation with some register operand(s)?, malc, 2012/10/10
- Re: [Qemu-devel] bug in popcnt emulation with some register operand(s)?, Andriy Gapon, 2012/10/14
- Re: [Qemu-devel] bug in popcnt emulation with some register operand(s)?, malc, 2012/10/14
- Re: [Qemu-devel] bug in popcnt emulation with some register operand(s)?, Andriy Gapon, 2012/10/14