From patchwork Fri May 24 21:37:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 246292 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5AB332C0182 for ; Sat, 25 May 2013 07:35:43 +1000 (EST) Received: from localhost ([::1]:35190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfzeH-00051W-CJ for incoming@patchwork.ozlabs.org; Fri, 24 May 2013 17:35:41 -0400 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 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4OLZGPJ013982 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 24 May 2013 17:35:17 -0400 Received: from lacos-laptop.usersys.redhat.com (vpn1-6-105.ams2.redhat.com [10.36.6.105]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4OLZFpV016475; Fri, 24 May 2013 17:35:15 -0400 From: Laszlo Ersek To: Richard Henderson , qemu-devel@nongnu.org Date: Fri, 24 May 2013 23:37:36 +0200 Message-Id: <1369431456-11887-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] i386/translate: ignore 0x67 (PREFIX_ADR) on TARGET_X86_64 && CODE64() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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; } }