From patchwork Wed Apr 20 14:31:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sylvain Garrigues X-Patchwork-Id: 8890471 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0635B9F46D for ; Wed, 20 Apr 2016 14:31:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 307D320125 for ; Wed, 20 Apr 2016 14:31:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B02FA2025A for ; Wed, 20 Apr 2016 14:31:32 +0000 (UTC) Received: from localhost ([::1]:50307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1astAC-00086P-4K for patchwork-qemu-devel@patchwork.kernel.org; Wed, 20 Apr 2016 10:31:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ast9u-0007rX-QY for qemu-devel@nongnu.org; Wed, 20 Apr 2016 10:31:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ast9r-0006RY-Jh for qemu-devel@nongnu.org; Wed, 20 Apr 2016 10:31:14 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:35428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ast9r-0006RI-DT for qemu-devel@nongnu.org; Wed, 20 Apr 2016 10:31:11 -0400 Received: by mail-wm0-f50.google.com with SMTP id e201so52967660wme.0 for ; Wed, 20 Apr 2016 07:31:08 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=m3ws3Ze5UOeexzpqlfCY7jOf2KzN8/2yizDPCPeHszs=; b=hyARdW4IjrulHOp0r81LrGwHf6AxGwHct0AJXWFE3ZbC9OG1MxKPjpOow+xD5+ys7O 9/rZboNSS4cttgxOpfWViiru9pTYElBS9E2oVXgI/OfDy7NI1wzbe0T/YitRouxgGWNz zkkGBHw4dQdteRzhu2oSi1zzjxHk+yxIwpE/p3SZsU4sohZv403T+ThZA5DopWjbJJw8 Nuxw0BmKpfa4InrKRpD7VWMO4yq8PjgZIVZmnIYFrX3gdiZTW3bPuRUItlqPMWspY5aM /dr6dQwoaCF5X0oYnzXAvHvBSPFLdLuSGFrZMUDIl41chxSXXtiAkr6v+GLMswSKroAS Xm6g== X-Gm-Message-State: AOPr4FXtTHhZctuke9DaHvLpyJCCfqIu4JhHSN0+o4uJlymN9roNuv50F+8K5S4rJoqWZw== X-Received: by 10.28.72.132 with SMTP id v126mr8067905wma.49.1461162668026; Wed, 20 Apr 2016 07:31:08 -0700 (PDT) Received: from [192.168.0.10] (plr75-1-82-226-218-68.fbx.proxad.net. [82.226.218.68]) by smtp.gmail.com with ESMTPSA id u16sm10015142wmd.5.2016.04.20.07.31.05 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Apr 2016 07:31:05 -0700 (PDT) Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) From: Sylvain Garrigues In-Reply-To: Date: Wed, 20 Apr 2016 16:31:04 +0200 Message-Id: <6484CC7F-79A8-4AE2-95FA-B1C2743A02A8@sylvaingarrigues.com> References: <20160419223417.25184.88206.malonedeb@wampee.canonical.com> To: Peter Maydell X-Mailer: Apple Mail (2.3124) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.50 Subject: Re: [Qemu-devel] [Bug 1572329] [NEW] ARM emulation: r0 != 0 on boot X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bug 1572329 <1572329@bugs.launchpad.net>, QEMU Developers , Peter Crosthwaite Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Sylvain Garrigues Fix link register patch follows: > Le 20 avr. 2016 à 16:21, Peter Maydell a écrit : > > On 19 April 2016 at 23:34, Sylvain wrote: >> # arm-softmmu/qemu-system-arm -M raspi2 -m 1024 -smp 4 -kernel >> kernel.bin -serial stdio -dtb rpi2.dtb >> >> My code shows r0 = 0x31 while it should be 0. > > Hi. Thanks for this bug report and the patch. In order > for us to be able to use your patch, we'll need you to > provide a signed-off-by line, which tells us you have > the legal right to submit it and are happy for us to > include it in QEMU under QEMU's licensing terms. > (You can look at > http://wiki.qemu.org/Contribute/SubmitAPatch#Patch_emails_must_include_a_Signed-off-by:_line > if you want more details.) > > You can provide a signoff just by replying to this email > with a line which reads > "Signed-off-by: Your Name ". > > A couple of notes: this bug only affects boards which > have a write_board_setup function, which means only > highbank/midway, raspi2, and xilinx_zynq; that's probably > why we didn't spot it earlier. > > thanks > -- PMM diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 5975fbf..5876945 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -68,7 +68,7 @@ static const ARMInsnFixup bootloader_aarch64[] = { */ static const ARMInsnFixup bootloader[] = { - { 0xe28fe008 }, /* add lr, pc, #8 */ + { 0xe28fe004 }, /* add lr, pc, #4 */ { 0xe51ff004 }, /* ldr pc, [pc, #-4] */ { 0, FIXUP_BOARD_SETUP }, #define BOOTLOADER_NO_BOARD_SETUP_OFFSET 3