From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnGGp-0005Tz-4d for qemu-devel@nongnu.org; Wed, 21 May 2014 19:50:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnGGi-0008KB-Ar for qemu-devel@nongnu.org; Wed, 21 May 2014 19:50:03 -0400 Received: from mail-pa0-x234.google.com ([2607:f8b0:400e:c03::234]:58190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnGGi-0008H5-3V for qemu-devel@nongnu.org; Wed, 21 May 2014 19:49:56 -0400 Received: by mail-pa0-f52.google.com with SMTP id fa1so1867375pad.25 for ; Wed, 21 May 2014 16:49:54 -0700 (PDT) Date: Wed, 21 May 2014 23:50:25 +0000 From: "Edgar E. Iglesias" Message-ID: <20140521235025.GC30982@hostname> References: <1400491383-6725-1-git-send-email-edgar.iglesias@gmail.com> <1400491383-6725-10-git-send-email-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v3 09/22] target-arm: A64: Introduce aarch64_banked_spsr_index() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Rob Herring , Peter Crosthwaite , Fabian Aggeler , QEMU Developers , Alexander Graf , John Williams , Alex =?iso-8859-1?Q?Benn=E9e?= , Christoffer Dall , Richard Henderson On Wed, May 21, 2014 at 08:01:54PM +0100, Peter Maydell wrote: > On 19 May 2014 10:22, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > > > Add aarch64_banked_spsr_index(), used to map an Exception Level > > to an index in the banked_spsr array. > > > > diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c > > index f120b02..c05a839 100644 > > --- a/target-arm/op_helper.c > > +++ b/target-arm/op_helper.c > > @@ -386,7 +386,8 @@ void HELPER(msr_i_pstate)(CPUARMState *env, uint32_t op, uint32_t imm) > > > > void HELPER(exception_return)(CPUARMState *env) > > { > > - uint32_t spsr = env->banked_spsr[0]; > > + unsigned int spsr_idx = is_a64(env) ? aarch64_banked_spsr_index(1) : 0; > > This is unnecessary -- if we get here we must have is_a64(env) true, > because this is the helper for an A64 instruction. Yep, got confused while your previous comments. Fixed > > > + uint32_t spsr = env->banked_spsr[spsr_idx]; > > int new_el, i; > > > > if (env->pstate & PSTATE_SP) { > > thanks > -- PMM