From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YElw6-0003XJ-Et for qemu-devel@nongnu.org; Fri, 23 Jan 2015 16:38:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YElw3-00072I-9s for qemu-devel@nongnu.org; Fri, 23 Jan 2015 16:38:38 -0500 Received: from mail-qg0-f44.google.com ([209.85.192.44]:50322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YElw3-00072D-6H for qemu-devel@nongnu.org; Fri, 23 Jan 2015 16:38:35 -0500 Received: by mail-qg0-f44.google.com with SMTP id l89so8137130qgf.3 for ; Fri, 23 Jan 2015 13:38:34 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1422037228-5363-3-git-send-email-peter.maydell@linaro.org> References: <1422037228-5363-1-git-send-email-peter.maydell@linaro.org> <1422037228-5363-3-git-send-email-peter.maydell@linaro.org> Date: Fri, 23 Jan 2015 15:38:34 -0600 Message-ID: From: Greg Bellows Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 02/11] target-arm: Make arm_current_el() return sensible values for M profile List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "Edgar E. Iglesias" , Andrew Jones , =?UTF-8?B?QWxleCBCZW5uw6ll?= , QEMU Developers , Patch Tracking On Fri, Jan 23, 2015 at 12:20 PM, Peter Maydell wrote: > Although M profile doesn't have the same concept of exception level > as A profile, it does have a notion of privileged versus not, which > we currently track in the privmode TB flag. Support returning this > information if arm_current_el() is called on an M profile core, so > that we can identify the correct MMU index to use (and put the MMU > index in the TB flags) without having to special-case M profile. > > Signed-off-by: Peter Maydell > --- > target-arm/cpu.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/target-arm/cpu.h b/target-arm/cpu.h > index cd7a9e8..3eb00f4 100644 > --- a/target-arm/cpu.h > +++ b/target-arm/cpu.h > @@ -1211,6 +1211,10 @@ static inline bool cptype_valid(int cptype) > */ > static inline int arm_current_el(CPUARMState *env) > { > + if (arm_feature(env, ARM_FEATURE_M)) { > + return !((env->v7m.exception == 0) && (env->v7m.control & 1)); > + } > + > if (is_a64(env)) { > return extract32(env->pstate, 2, 2); > } > -- > 1.9.1 > Reviewed-by: Greg Bellows