From patchwork Mon Jun 15 03:48:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 484133 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BC2A814027C for ; Mon, 15 Jun 2015 13:49:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=MJ6bnifc; dkim-atps=neutral Received: from localhost ([::1]:60258 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4LOo-0002Xh-MZ for incoming@patchwork.ozlabs.org; Sun, 14 Jun 2015 23:49:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4LOL-0001gn-Eu for qemu-devel@nongnu.org; Sun, 14 Jun 2015 23:48:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4LOI-0002LK-5k for qemu-devel@nongnu.org; Sun, 14 Jun 2015 23:48:57 -0400 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]:35453) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4LOH-0002Kt-Vw for qemu-devel@nongnu.org; Sun, 14 Jun 2015 23:48:54 -0400 Received: by pacyx8 with SMTP id yx8so56944943pac.2 for ; Sun, 14 Jun 2015 20:48:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=fquQTiV2pLZT22dTe88NDmTho/COnM6UR/9TjK3gTRg=; b=MJ6bnifctCX0xt1dHCuGBSGpzqWvjGZgV34lt/gVk7PPM5e2Rm1LB+RO/xSvTgDtbV R7ylLOV43q5/JMBKXsiQVFIf43Z5GjM24pkh2AyZx4jCFWqrOrFnrPqUyKOmiB4Xyus2 xMiuesTKSW2ZTKkcSs6QfRrBm4g7xuXdfbYRT03x1nk0WhDu+Svyqe9zYP37cNAWqP+M ruUIi6Fe494mPjJJ4KBLiU+V1SNgpWu+IprZ70D/0OWKc4yfY//74YwCTayBR5riXjVL 0DZOJ0Jk4VxFD6kBmGcVagj7r6dsGdf6ukS/cjWG3j0OcIxwPmIommF3gK3+YkWSSZfA 1FQw== X-Received: by 10.70.138.70 with SMTP id qo6mr43715162pdb.163.1434340133195; Sun, 14 Jun 2015 20:48:53 -0700 (PDT) Received: from pcrost-laptop.hsd1.ca.comcast.net (c-73-15-58-35.hsd1.ca.comcast.net. [73.15.58.35]) by mx.google.com with ESMTPSA id jz10sm10502999pbc.48.2015.06.14.20.48.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 14 Jun 2015 20:48:52 -0700 (PDT) From: Peter Crosthwaite X-Google-Original-From: Peter Crosthwaite To: qemu-devel@nongnu.org Date: Sun, 14 Jun 2015 20:48:30 -0700 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::22b Cc: peter.maydell@linaro.org, Peter Crosthwaite , afaerber@suse.de, edgar.iglesias@gmail.com Subject: [Qemu-devel] [PATCH 3/5] arm: Support thumb in set_pc routines 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 ARM program counters are always at least 16b aligned with the LSB being only used the indicate thumb mode in exchange situations. Mask this bit off in set_pc to ignore the exchange semantic (which must still be managed by the caller). Signed-off-by: Peter Crosthwaite --- --- target-arm/cpu.c | 2 +- target-arm/cpu64.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target-arm/cpu.c b/target-arm/cpu.c index 6181f28..5bb08a6 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -35,7 +35,7 @@ static void arm_cpu_set_pc(CPUState *cs, vaddr value) { ARMCPU *cpu = ARM_CPU(cs); - cpu->env.regs[15] = value; + cpu->env.regs[15] = value & 0xfffffffe; } static bool arm_cpu_has_work(CPUState *cs) diff --git a/target-arm/cpu64.c b/target-arm/cpu64.c index bf7dd68..1e26a48 100644 --- a/target-arm/cpu64.c +++ b/target-arm/cpu64.c @@ -279,7 +279,7 @@ static void aarch64_cpu_set_pc(CPUState *cs, vaddr value) if (is_a64(&cpu->env)) { cpu->env.pc = value; } else { - cpu->env.regs[15] = value; + cpu->env.regs[15] = value & 0xfffffffe; } }