From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wnqj0-0004jL-2x for qemu-devel@nongnu.org; Fri, 23 May 2014 10:45:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wnqiu-0000qV-8v for qemu-devel@nongnu.org; Fri, 23 May 2014 10:45:33 -0400 Received: from mail-la0-f54.google.com ([209.85.215.54]:57679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wnqiu-0000q4-1j for qemu-devel@nongnu.org; Fri, 23 May 2014 10:45:28 -0400 Received: by mail-la0-f54.google.com with SMTP id pv20so4386189lab.13 for ; Fri, 23 May 2014 07:45:26 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1400805738-11889-6-git-send-email-edgar.iglesias@gmail.com> References: <1400805738-11889-1-git-send-email-edgar.iglesias@gmail.com> <1400805738-11889-6-git-send-email-edgar.iglesias@gmail.com> From: Peter Maydell Date: Fri, 23 May 2014 15:45:06 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v4 05/21] target-arm: A32: Use get_mem_index for load/stores List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Edgar E. Iglesias" Cc: Rob Herring , Peter Crosthwaite , Fabian Aggeler , QEMU Developers , Alexander Graf , John Williams , =?UTF-8?B?QWxleCBCZW5uw6ll?= , Christoffer Dall , Richard Henderson On 23 May 2014 01:42, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Avoid using IS_USER directly as the MMU-idx to simplify future > changes to the MMU layout. > > Reviewed-by: Peter Maydell > Signed-off-by: Edgar E. Iglesias > @@ -9946,6 +9950,8 @@ static int disas_thumb2_insn(CPUARMState *env, DisasContext *s, uint16_t insn_hw > } > if (insn & (1 << 20)) { > /* Load. */ > + user = user ? 0 : get_mem_index(s); > + > tmp = tcg_temp_new_i32(); > switch (op) { > case 0: This conversion from 'user is a flag which is true if in user mode' to 'user is the memory index we want to use' is being done only in the 'Load' part of this if, which means that all the stores in the 'else' clause are going to have the wrong memory index. I think we should fix this by replacing this 'user' variable with a simple 'mmuidx'. Then we can say mmuidx = get_mem_index(s); at the point which currently does user = IS_USER(); and mmuidx = MEM_USER_IDX; in the bit of decode that currently does user = 1; This is probably going to be clearest done as a separate patch before this one. thanks -- PMM