From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGlvi-0005c7-Ga for qemu-devel@nongnu.org; Thu, 29 Jan 2015 05:02:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGlve-0003gm-7h for qemu-devel@nongnu.org; Thu, 29 Jan 2015 05:02:30 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:2769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGlve-0003gf-0U for qemu-devel@nongnu.org; Thu, 29 Jan 2015 05:02:26 -0500 Message-ID: <54CA052B.2020106@imgtec.com> Date: Thu, 29 Jan 2015 10:02:19 +0000 From: Leon Alrae MIME-Version: 1.0 References: <1422289059-6849-1-git-send-email-leon.alrae@imgtec.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] target-mips: use CP0EnLo_XI instead of magic number List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Maciej W. Rozycki" Cc: qemu-devel@nongnu.org, Aurelien Jarno On 28/01/2015 23:11, Maciej W. Rozycki wrote: >> @@ -4947,7 +4947,7 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int reg, int sel) >> #if defined(TARGET_MIPS64) >> if (ctx->rxi) { >> TCGv tmp = tcg_temp_new(); >> - tcg_gen_andi_tl(tmp, arg, (3ull << 62)); >> + tcg_gen_andi_tl(tmp, arg, (3ull << CP0EnLo_XI)); >> tcg_gen_shri_tl(tmp, tmp, 32); > > ... don't we need to do: > > tcg_gen_andi_tl(arg, arg, ~(3ull << CP0EnLo_XI)); > > here and for EntryLo1 as well (for LPA-enabled processors)? Yes, this would be required if we supported LPA - good spot. > >> tcg_gen_or_tl(arg, arg, tmp); >> tcg_temp_free(tmp); > > And do we want to have CP0C3_LPA set in the few templates that do in the > first place? AFAICT we don't really implement LPA so this bit will > confuse software. Of course implementing it would be another option, not > very complicated AFAICS, and if we can track the requirement to update > MFC0 at that time, then the clean-up I mentioned above can be deferred > until then. In general I don't think it's a good idea to indicate presence of a feature in a CPU config if it isn't implemented at all in QEMU -- as you said, it will confuse software. As far as LPA goes I've got already an implementation of it (and XPA as well) which I haven't submitted upstream yet. I'll make sure it contains the change you suggested. Thanks, Leon