From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrNzF-0004i1-PQ for qemu-devel@nongnu.org; Mon, 02 Jun 2014 04:53:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrNz9-0003YQ-K3 for qemu-devel@nongnu.org; Mon, 02 Jun 2014 04:52:57 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:5802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrNz9-0003YK-Du for qemu-devel@nongnu.org; Mon, 02 Jun 2014 04:52:51 -0400 Message-ID: <538C3B5F.5020408@imgtec.com> Date: Mon, 2 Jun 2014 09:52:47 +0100 From: Leon Alrae MIME-Version: 1.0 References: <1401461279-59617-1-git-send-email-leon.alrae@imgtec.com> <1401461279-59617-12-git-send-email-leon.alrae@imgtec.com> <20140530224101.GA12523@ohm.rr44.fr> In-Reply-To: <20140530224101.GA12523@ohm.rr44.fr> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 11/21] target-mips: Status.UX/SX/KX enable 32-bit address wrapping List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: yongbok.kim@imgtec.com, cristian.cuna@imgtec.com, qemu-devel@nongnu.org On 30/05/14 23:41, Aurelien Jarno wrote: >> In R6 the special behaviour for data references is also specified for Kernel >> and Supervisor mode. Therefore MIPS_HFLAG_UX is replaced by generic MIPS_HFLAG_X >> indicating whether 64-bit mode is enabled in current operating mode. > > I haven't found any indication of that in the MIPS64R6 manual (MD00091 > version 6.00). Section 4.10 still only mentions the user mode. > > Did I miss something? You can find it in the Volume-II document (MD00087): Section "2.2.2.4.3 memory_address". It seems that some parts of MD00091 document haven't been fully updated yet. >> +#if defined(TARGET_MIPS64) >> +static inline int is_wrapping_needed(DisasContext *ctx) >> +{ >> + if (!(ctx->hflags & MIPS_HFLAG_X)) { >> + /* If not R6 then wrap only in User Mode */ >> + if ((ctx->insn_flags & ISA_MIPS64R6) || >> + ((ctx->hflags & MIPS_HFLAG_KSU) == MIPS_HFLAG_UM)) { >> + return 1; >> + } >> + } >> + return 0; >> +} >> +#endif > > As Richard said, this code should be moved above, and the HFLAG semantic > should be changed to "address wrapping needed". The current code is > already wrong (and I am afraid I am the author...). > > So this could be done by renaming the HFLAG to for exemple > MIPS_HFLAG_AWRAP, and checking only for this flag in gen_op_addr_add. > Then the checks have to be adapted in compute_hflags, including the R6 > case. I'll correct this. Thanks for the suggestion. Leon