From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiByx-0003Sd-0n for qemu-devel@nongnu.org; Wed, 07 May 2014 20:14:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiByr-0003nF-2V for qemu-devel@nongnu.org; Wed, 07 May 2014 20:14:38 -0400 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]:44807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiByq-0003n6-SS for qemu-devel@nongnu.org; Wed, 07 May 2014 20:14:33 -0400 Received: by mail-pa0-f43.google.com with SMTP id hz1so1837739pad.16 for ; Wed, 07 May 2014 17:14:32 -0700 (PDT) Date: Thu, 8 May 2014 00:14:40 +0000 From: "Edgar E. Iglesias" Message-ID: <20140508001440.GF7381@hostname> References: <1399356506-5609-1-git-send-email-edgar.iglesias@gmail.com> <1399356506-5609-17-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 v1 16/22] target-arm: A64: Forbid ERET to unimplemented ELs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Rob Herring , Peter Crosthwaite , QEMU Developers , Alexander Graf , John Williams , Alex =?iso-8859-1?Q?Benn=E9e?= On Wed, May 07, 2014 at 10:00:11AM +0100, Peter Maydell wrote: > On 6 May 2014 07:08, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > > > Check for EL2 support before returning to it. > > > > Signed-off-by: Edgar E. Iglesias > > --- > > target-arm/op_helper.c | 8 +++----- > > 1 file changed, 3 insertions(+), 5 deletions(-) > > > > diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c > > index 770c776..f1ae05e 100644 > > --- a/target-arm/op_helper.c > > +++ b/target-arm/op_helper.c > > @@ -411,12 +411,10 @@ void HELPER(exception_return)(CPUARMState *env) > > env->regs[15] = env->elr_el[ELR_EL_IDX(1)] & ~0x1; > > } else { > > new_el = extract32(spsr, 2, 2); > > - if (new_el > cur_el) { > > + if (new_el > cur_el > > + || (new_el == 2 && !arm_feature(env, ARM_FEATURE_EL2))) { > > /* Disallow returns to higher ELs than the current one. */ > > - goto illegal_return; > > - } > > - if (new_el > 1) { > > - /* Return to unimplemented EL */ > > + /* Disallow returns to unimplemented ELs. */ > > Merge the comments rather than having two one-liners one after > the other, please. > /* Disallow return to an EL which is unimplemented or higher > * than the current one. > */ Fixed for v2, thanks. Cheers, Edgar