From patchwork Wed Aug 27 17:36:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 36133 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F1896203C5 for ; Wed, 27 Aug 2014 17:43:04 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id i7sf2263506oag.8 for ; Wed, 27 Aug 2014 10:43:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=CueJpzmnsSfmdTRtMjBk3ei/QQG5RbQ68N56TGb9lUk=; b=Y6jYO7C8lHaA9L03WDRh8x0hcEeWUEC69qXbehH29/nD7YNBNisYV2Xn2PtXlQZiUI NQ4jQ2aJN+KgAeLg1CCDOzGKgxlwailBlAaDtUSeA7kBaDB4D2vWQvCy5DQTtHWeOhZo hUQ8LhtS0UbYD/cT7BN03jnJtjaIUd3K38HYKizi7FjpbJnraNhEvXEsZtRd64VbAT5w 1E2km1QHyVuf1sUUFjt/RrQg+I8ZlnBwD42ifQ/DCeRGkM4fOsm9RH7zMDB+FYrvwQY3 CAmYwQjLmJZ+pO4kzHCcmLvnt/7UVvTgI3Yp/zwU+FbbfTzyog8qYP/CRzLRmr3HlQAP Uueg== X-Gm-Message-State: ALoCoQlPxS5VGtCoE7YylyxHyA31KQeI2H+ftoHjFlRza9RoCGAdK3bEWvbNavNQucXjLFqDEueO X-Received: by 10.42.18.2 with SMTP id v2mr25936043ica.25.1409161384506; Wed, 27 Aug 2014 10:43:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.34 with SMTP id c31ls238832qge.92.gmail; Wed, 27 Aug 2014 10:43:04 -0700 (PDT) X-Received: by 10.236.31.4 with SMTP id l4mr3090799yha.158.1409161384372; Wed, 27 Aug 2014 10:43:04 -0700 (PDT) Received: from mail-yh0-f53.google.com (mail-yh0-f53.google.com [209.85.213.53]) by mx.google.com with ESMTPS id f65si1269895yhd.13.2014.08.27.10.43.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Aug 2014 10:43:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.213.53 as permitted sender) client-ip=209.85.213.53; Received: by mail-yh0-f53.google.com with SMTP id c41so599177yho.12 for ; Wed, 27 Aug 2014 10:43:04 -0700 (PDT) X-Received: by 10.220.81.132 with SMTP id x4mr30967868vck.0.1409161384232; Wed, 27 Aug 2014 10:43:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp116980vcb; Wed, 27 Aug 2014 10:43:03 -0700 (PDT) X-Received: by 10.220.130.131 with SMTP id t3mr18803454vcs.30.1409161383534; Wed, 27 Aug 2014 10:43:03 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id v17si1411946qgd.84.2014.08.27.10.43.03 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 27 Aug 2014 10:43:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:60815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMhFP-0003gp-4a for patch@linaro.org; Wed, 27 Aug 2014 13:43:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMh9v-0003et-3Z for qemu-devel@nongnu.org; Wed, 27 Aug 2014 13:37:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMh9k-0002yE-EV for qemu-devel@nongnu.org; Wed, 27 Aug 2014 13:37:23 -0400 Received: from e33.co.us.ibm.com ([32.97.110.151]:39413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMh9k-0002xw-3p for qemu-devel@nongnu.org; Wed, 27 Aug 2014 13:37:12 -0400 Received: from /spool/local by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Aug 2014 11:37:11 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 27 Aug 2014 11:37:09 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 044713E4003D; Wed, 27 Aug 2014 11:37:09 -0600 (MDT) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s7RFXBKV10289572; Wed, 27 Aug 2014 17:33:11 +0200 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s7RHb8Hl018056; Wed, 27 Aug 2014 11:37:08 -0600 Received: from localhost ([9.80.81.153]) by d03av04.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s7RHb6Vh017791; Wed, 27 Aug 2014 11:37:06 -0600 From: Michael Roth To: qemu-devel@nongnu.org Date: Wed, 27 Aug 2014 12:36:10 -0500 Message-Id: <1409160982-16389-14-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409160982-16389-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1409160982-16389-1-git-send-email-mdroth@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14082717-0928-0000-0000-0000045F4DAC X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 32.97.110.151 Cc: qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH 13/25] target-arm: Fix return address for A64 BRK instructions 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mdroth@linux.vnet.ibm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.213.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Peter Maydell When we take an exception resulting from a BRK instruction, the architecture requires that the "preferred return address" reported to the exception handler is the address of the BRK itself, not the following instruction (like undefined insns, and in contrast with SVC, HVC and SMC). Follow this, rather than incorrectly reporting the address of the following insn. (We do get this correct for the A32/T32 BKPT insns.) Signed-off-by: Peter Maydell Cc: qemu-stable@nongnu.org (cherry picked from commit 229a138d740142885dd4e7063e25147d7f71fdef) Signed-off-by: Michael Roth --- target-arm/translate-a64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index 33b5025..fc319d5 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -1454,7 +1454,7 @@ static void disas_exc(DisasContext *s, uint32_t insn) break; } /* BRK */ - gen_exception_insn(s, 0, EXCP_BKPT, syn_aa64_bkpt(imm16)); + gen_exception_insn(s, 4, EXCP_BKPT, syn_aa64_bkpt(imm16)); break; case 2: if (op2_ll != 0) {