From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGbpE-0008JI-8J for qemu-devel@nongnu.org; Wed, 28 Jan 2015 18:15:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGbpB-000374-2h for qemu-devel@nongnu.org; Wed, 28 Jan 2015 18:15:08 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:56921 helo=cvs.linux-mips.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGbpA-0002zr-Py for qemu-devel@nongnu.org; Wed, 28 Jan 2015 18:15:05 -0500 Received: from localhost.localdomain ([127.0.0.1]:37038 "EHLO localhost.localdomain" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S27011996AbbA1XLtsRMtS (ORCPT ); Thu, 29 Jan 2015 00:11:49 +0100 Date: Wed, 28 Jan 2015 23:11:49 +0000 (GMT) From: "Maciej W. Rozycki" In-Reply-To: <1422289059-6849-1-git-send-email-leon.alrae@imgtec.com> Message-ID: References: <1422289059-6849-1-git-send-email-leon.alrae@imgtec.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: Leon Alrae Cc: qemu-devel@nongnu.org, Aurelien Jarno On Mon, 26 Jan 2015, Leon Alrae wrote: > Signed-off-by: Leon Alrae > --- Enthusiastically: Reviewed-by: Maciej W. Rozycki However... > diff --git a/target-mips/translate.c b/target-mips/translate.c > index 635192c..77d89be 100644 > --- a/target-mips/translate.c > +++ b/target-mips/translate.c > @@ -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)? > 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. Maciej