From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ufzdw-00051E-Vu for qemu-devel@nongnu.org; Fri, 24 May 2013 17:35:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ufzdu-00047A-5X for qemu-devel@nongnu.org; Fri, 24 May 2013 17:35:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ufzdt-00046w-UK for qemu-devel@nongnu.org; Fri, 24 May 2013 17:35:18 -0400 From: Laszlo Ersek Date: Fri, 24 May 2013 23:37:36 +0200 Message-Id: <1369431456-11887-1-git-send-email-lersek@redhat.com> Subject: [Qemu-devel] [PATCH] i386/translate: ignore 0x67 (PREFIX_ADR) on TARGET_X86_64 && CODE64() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-devel@nongnu.org The code reorganization in commit 4a6fd938 broke handling of PREFIX_ADR. Restore the previous behavior: If TARGET_X86_64 *and* CODE64(): (a) PREFIX_ADR set: no effect, "aflag" should stay at the original "s->code32" value, (b) PREFIX_ADR clear: "aflag" should be set to constant 2. Otherwise: (c) PREFIX_ADR set: the least significant bit in "aflag" (originally initialized form "s->code32") should be negated, (d) PREFIX_ADR clear: no effect, "aflag" should stay at the original "s->code32" value. Currently branch (a) is mishandled as branch (c). Please-review: Richard Henderson Signed-off-by: Laszlo Ersek --- target-i386/translate.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index 0aeccdb..86f2678 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -4813,7 +4813,11 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, /* 0x66 is ignored if rex.w is set */ dflag = 2; } - if (!(prefixes & PREFIX_ADR)) { + if (prefixes & PREFIX_ADR) { + /* flip it back, 0x67 should have no effect */ + aflag ^= 1; + } + else { aflag = 2; } } -- 1.7.1