From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfpOZ-0003AA-A7 for qemu-devel@nongnu.org; Thu, 01 May 2014 07:43:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WfpOU-00032C-HW for qemu-devel@nongnu.org; Thu, 01 May 2014 07:43:19 -0400 Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]:44791) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfpOU-000328-AN for qemu-devel@nongnu.org; Thu, 01 May 2014 07:43:14 -0400 Received: by mail-pa0-f45.google.com with SMTP id kq14so3531891pab.18 for ; Thu, 01 May 2014 04:43:13 -0700 (PDT) Date: Thu, 1 May 2014 21:43:03 +1000 From: "Edgar E. Iglesias" Message-ID: <20140501114303.GA18802@zapo.iiNet> References: <1398926097-28097-1-git-send-email-edgar.iglesias@gmail.com> <1398926097-28097-3-git-send-email-edgar.iglesias@gmail.com> <87r44drhwo.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v1 2/4] target-arm: A64: Handle blr lr List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Alex =?iso-8859-1?Q?Benn=E9e?= , QEMU Developers On Thu, May 01, 2014 at 10:31:06AM +0100, Peter Maydell wrote: > On 1 May 2014 10:02, Alex Bennée wrote: > > > > Edgar E. Iglesias writes: > > > >> From: "Edgar E. Iglesias" > >> > >> For linked branches, updates to the link register happen > >> conceptually after the read of the branch target register. > >> > >> Signed-off-by: Edgar E. Iglesias > > > > I'm trying to think of a case where this could actually cause a problem > > but I can't. However from a clarity/correctness point of view it's > > better. > > Well, we actually misexecute "BLR LR" otherwise, right? > That's probably not very common but there's no reason it > might not occur (eg call to a function pointer from a > function where LR has been saved on entry and is free > for use as a generic tempreg). Right. For example, the kernel/kvm actually does this in arch/arm64/kvm/hyp.S:773: blr lr Thanks, Edgar