From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjS0g-0008Gy-8t for qemu-devel@nongnu.org; Tue, 06 Oct 2015 09:10:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjS0c-00074o-5e for qemu-devel@nongnu.org; Tue, 06 Oct 2015 09:10:26 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:65306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjS0b-0006y4-Va for qemu-devel@nongnu.org; Tue, 06 Oct 2015 09:10:22 -0400 References: <1443800041-57659-1-git-send-email-yongbok.kim@imgtec.com> From: Leon Alrae Message-ID: <5613C836.3070107@imgtec.com> Date: Tue, 6 Oct 2015 14:10:14 +0100 MIME-Version: 1.0 In-Reply-To: <1443800041-57659-1-git-send-email-yongbok.kim@imgtec.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] target-mips: fix updating XContext on mmu exception List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yongbok Kim , qemu-devel@nongnu.org Cc: aurelien@aurel32.net On 02/10/15 16:34, Yongbok Kim wrote: > Correct updating XContext.Region field on mmu exceptions. > If Config3.CTXTC = 0 then the R filed of XContext has to be updated s/filed/field > with the value of bits 63..62 of the virtual address upon a TLB > exception. > > Signed-off-by: Yongbok Kim > --- > target-mips/helper.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/target-mips/helper.c b/target-mips/helper.c > index 01c4461..8ffc990 100644 > --- a/target-mips/helper.c > +++ b/target-mips/helper.c > @@ -294,7 +294,7 @@ static void raise_mmu_exception(CPUMIPSState *env, target_ulong address, > #if defined(TARGET_MIPS64) > env->CP0_EntryHi &= env->SEGMask; > env->CP0_XContext = (env->CP0_XContext & ((~0ULL) << (env->SEGBITS - 7))) | > - ((address & 0xC00000000000ULL) >> (55 - env->SEGBITS)) | > + (((address >> 62) & 0x3) << (env->SEGBITS - 9)) | Did you consider using extract64? > ((address & ((1ULL << env->SEGBITS) - 1) & 0xFFFFFFFFFFFFE000ULL) >> 9); Care to fix this >80 chars line while you are on this? :) Thanks, Leon > #endif > cs->exception_index = exception; >