From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmg1l-0003Sz-4c for qemu-devel@nongnu.org; Tue, 20 May 2014 05:08:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wmg1e-00082E-WA for qemu-devel@nongnu.org; Tue, 20 May 2014 05:08:05 -0400 Received: from mail-ve0-f171.google.com ([209.85.128.171]:39279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmg1e-000827-St for qemu-devel@nongnu.org; Tue, 20 May 2014 05:07:58 -0400 Received: by mail-ve0-f171.google.com with SMTP id oz11so212757veb.16 for ; Tue, 20 May 2014 02:07:58 -0700 (PDT) MIME-Version: 1.0 Sender: peter.crosthwaite@petalogix.com In-Reply-To: <1400491383-6725-23-git-send-email-edgar.iglesias@gmail.com> References: <1400491383-6725-1-git-send-email-edgar.iglesias@gmail.com> <1400491383-6725-23-git-send-email-edgar.iglesias@gmail.com> Date: Tue, 20 May 2014 19:07:58 +1000 Message-ID: From: Peter Crosthwaite Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v3 22/22] RFC: target-arm: Use a 1:1 mapping between EL and MMU index List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Edgar E. Iglesias" Cc: Peter Maydell , Rob Herring , Fabian Aggeler , Alexander Graf , "qemu-devel@nongnu.org Developers" , John Williams , =?UTF-8?B?QWxleCBCZW5uw6ll?= , Christoffer Dall , Richard Henderson On Mon, May 19, 2014 at 7:23 PM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Signed-off-by: Edgar E. Iglesias > --- > target-arm/cpu.h | 26 ++++---------------------- > target-arm/translate.h | 2 +- > 2 files changed, 5 insertions(+), 23 deletions(-) > > diff --git a/target-arm/cpu.h b/target-arm/cpu.h > index 566f9ed..3b7ef32 100644 > --- a/target-arm/cpu.h > +++ b/target-arm/cpu.h > @@ -1084,32 +1084,14 @@ static inline CPUARMState *cpu_init(const char *cpu_model) > #define cpu_list arm_cpu_list > > /* MMU modes definitions */ > -#define MMU_MODE0_SUFFIX _kernel > -#define MMU_MODE1_SUFFIX _user > -#define MMU_USER_IDX 1 > - > -static inline int arm_el_to_mmu_idx(int current_el) > -{ > -#ifdef CONFIG_USER_ONLY > - return MMU_USER_IDX; > -#else > - switch (current_el) { > - case 0: > - return MMU_USER_IDX; > - case 1: > - return 0; > - default: > - /* Unsupported EL. */ > - assert(0); > - return 0; > - } > -#endif > -} > +#define MMU_MODE0_SUFFIX _user > +#define MMU_MODE1_SUFFIX _kernel > +#define MMU_USER_IDX 0 > > static inline int cpu_mmu_index (CPUARMState *env) > { > int cur_el = arm_current_pl(env); > - return arm_el_to_mmu_idx(cur_el); > + return cur_el; > } > > #include "exec/cpu-all.h" > diff --git a/target-arm/translate.h b/target-arm/translate.h > index db6f0af..31a0104 100644 > --- a/target-arm/translate.h > +++ b/target-arm/translate.h > @@ -54,7 +54,7 @@ static inline int arm_dc_feature(DisasContext *dc, int feature) > > static inline int get_mem_index(DisasContext *s) > { > - return arm_el_to_mmu_idx(s->current_pl); > + return s->current_pl; > } > > /* target-specific extra values for is_jmp */ > -- > 1.8.3.2 > > I'm a fan of this change. Should it squash into earlier in the series? Regards, Peter