From patchwork Wed Aug 6 20:39:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 35000 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f198.google.com (mail-ig0-f198.google.com [209.85.213.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 02A9720523 for ; Wed, 6 Aug 2014 21:38:35 +0000 (UTC) Received: by mail-ig0-f198.google.com with SMTP id h18sf12587299igc.5 for ; Wed, 06 Aug 2014 14:38:35 -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=h9w/LVDkEBBNDP0EY5ium2BY2+h2grNkqIhIfFTacys=; b=TQwEaXgaK8oLLFv5dbP5OhyujpH9Cjo7r4vIwsV1EzKcNxSs5yEC9e9h3b8jXKhJRn 7ZtgnAqtDQQ6zmvoUHBYAB8ZvkrZ47+cjx5EjePa7EVt5P9rvZdh6ZOYxvRypoH91Bup 4nv9tHajZSjq7ksqd4arBxsipNmumHPp7wTJJSWt+WQY9dqfqDUKC/w76sc9t0SqyEGG 7uhDNCxTzcXHvnRJ1MDsnfCWgTfN7JV87nMH3qOYgK9pLwEWgv6NI7couiunaqgohiXU 4F4EqKgbFPsB90MGki62Sxzc+a07pLnlrn48dtrdRGmkoufskJcHkWmGvmQVjIIugSeD YBEA== X-Gm-Message-State: ALoCoQkUBMxmnIAzoilqZytx+kpTwdYMXYB6yA33i5hT163m8vBlNSKvRiQDbEsJTTf3nttXmVUs X-Received: by 10.42.21.209 with SMTP id l17mr1685326icb.8.1407361115514; Wed, 06 Aug 2014 14:38:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.244 with SMTP id c107ls872122qgd.39.gmail; Wed, 06 Aug 2014 14:38:35 -0700 (PDT) X-Received: by 10.220.199.193 with SMTP id et1mr3328812vcb.58.1407361115389; Wed, 06 Aug 2014 14:38:35 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id u7si990017vdc.40.2014.08.06.14.38.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Aug 2014 14:38:35 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id ij19so4924913vcb.25 for ; Wed, 06 Aug 2014 14:38:35 -0700 (PDT) X-Received: by 10.220.59.65 with SMTP id k1mr12928591vch.22.1407361115294; Wed, 06 Aug 2014 14:38:35 -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.37.5 with SMTP id tc5csp59382vcb; Wed, 6 Aug 2014 14:38:34 -0700 (PDT) X-Received: by 10.224.97.66 with SMTP id k2mr20943542qan.21.1407361114347; Wed, 06 Aug 2014 14:38:34 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r1si3585197qak.82.2014.08.06.14.38.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 06 Aug 2014 14:38:34 -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]:41562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF8un-0003SA-RN for patch@linaro.org; Wed, 06 Aug 2014 17:38:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF85J-0003vj-PR for qemu-devel@nongnu.org; Wed, 06 Aug 2014 16:45:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF84r-0006Bf-9e for qemu-devel@nongnu.org; Wed, 06 Aug 2014 16:45:21 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:42510) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF84r-0006BU-2Q for qemu-devel@nongnu.org; Wed, 06 Aug 2014 16:44:53 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 Aug 2014 14:44:52 -0600 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e39.co.us.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 6 Aug 2014 14:44:51 -0600 Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 8F97038C8039; Wed, 6 Aug 2014 16:44:50 -0400 (EDT) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by b01cxnp22036.gho.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s76KioDD65798398; Wed, 6 Aug 2014 20:44:50 GMT Received: from d01av01.pok.ibm.com (localhost [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s76KioQO030509; Wed, 6 Aug 2014 16:44:50 -0400 Received: from localhost ([9.80.101.111]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s76Kin1m030484; Wed, 6 Aug 2014 16:44:50 -0400 From: Michael Roth To: qemu-devel@nongnu.org Date: Wed, 6 Aug 2014 15:39:58 -0500 Message-Id: <1407357598-21541-109-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1407357598-21541-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1407357598-21541-1-git-send-email-mdroth@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14080620-9332-0000-0000-0000019D3B63 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 32.97.110.160 Cc: qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH 108/108] hw/arm/boot: Set PC correctly when loading AArch64 ELF files 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.220.180 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 The code in do_cpu_reset() correctly handled AArch64 CPUs when running Linux kernels, but was missing code in the branch of the if() that deals with loading ELF files. Correctly jump to the ELF entry point on reset rather than leaving the reset PC at zero. Reported-by: Christopher Covington Signed-off-by: Peter Maydell Tested-by: Christopher Covington Cc: qemu-stable@nongnu.org (cherry picked from commit a9047ec3f6ab56295cba5b07e0d46cded9e2a7ff) Signed-off-by: Michael Roth --- hw/arm/boot.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 3d1f4a2..1241761 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -417,8 +417,12 @@ static void do_cpu_reset(void *opaque) if (info) { if (!info->is_linux) { /* Jump to the entry point. */ - env->regs[15] = info->entry & 0xfffffffe; - env->thumb = info->entry & 1; + if (env->aarch64) { + env->pc = info->entry; + } else { + env->regs[15] = info->entry & 0xfffffffe; + env->thumb = info->entry & 1; + } } else { if (CPU(cpu) == first_cpu) { if (env->aarch64) {