From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ysq7V-00006a-4y for qemu-devel@nongnu.org; Thu, 14 May 2015 06:12:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ysq7Q-0007rP-2a for qemu-devel@nongnu.org; Thu, 14 May 2015 06:12:01 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:34574) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yspn1-0000RP-2w for qemu-devel@nongnu.org; Thu, 14 May 2015 05:50:51 -0400 Message-ID: <55546FF2.1030405@imgtec.com> Date: Thu, 14 May 2015 10:50:42 +0100 From: Leon Alrae MIME-Version: 1.0 References: <1431531457-17127-1-git-send-email-yongbok.kim@imgtec.com> <1431531457-17127-3-git-send-email-yongbok.kim@imgtec.com> <5553A5C4.6030902@twiddle.net> In-Reply-To: <5553A5C4.6030902@twiddle.net> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 2/2] target-mips: Misaligned memory accesses for MSA List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , Yongbok Kim , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, afaerber@suse.de On 13/05/2015 20:28, Richard Henderson wrote: > As an aside, consider moving away from >=20 > #define HELPER_LD(name, insn, type) = \ > static inline type do_##name(CPUMIPSState *env, target_ulong addr, = \ > int mem_idx) = \ > { = \ > switch (mem_idx) = \ > { = \ > case 0: return (type) cpu_##insn##_kernel(env, addr); break; = \ > case 1: return (type) cpu_##insn##_super(env, addr); break; = \ > default: = \ > case 2: return (type) cpu_##insn##_user(env, addr); break; = \ > } = \ > } >=20 > to using helper_ret_*_mmu directly. Which allows you to specify the mm= u_idx > directly rather than bouncing around different thunks. It also allows = you to > pass in GETRA(), which would allow these helpers to use cpu_restore_sta= te on > faults. Just to confirm -=96 before using helper_ret_*_mmu directly we should als= o check if we can take fast-path (not sure if =93fast-path=94 is correct te= rm in this case as we've already generated a call to helper function...): if (unlikely(env->tlb_table[mmu_idx][page_index].ADDR_READ !=3D (addr & (TARGET_PAGE_MASK | (DATA_SIZE - 1))))) { So basically we'll have similar functions to cpu_##insn##_* but allowing to pass mmu_idx, GETRA() and calling helper_ret_*_mmu directly. BTW what is the reason that we aren't passing GETRA() to cpu_##insn##_* and using helper_ret_*_mmu directly in general? Thanks, Leon