From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52293 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhvaF-0007hW-Tq for qemu-devel@nongnu.org; Tue, 25 Jan 2011 21:58:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhvaE-0001DC-RB for qemu-devel@nongnu.org; Tue, 25 Jan 2011 21:58:11 -0500 Received: from mail-gy0-f173.google.com ([209.85.160.173]:45006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhvaE-0001D6-MY for qemu-devel@nongnu.org; Tue, 25 Jan 2011 21:58:10 -0500 Received: by gye5 with SMTP id 5so2260475gye.4 for ; Tue, 25 Jan 2011 18:58:10 -0800 (PST) From: Alexandre Courbot Date: Wed, 26 Jan 2011 11:57:53 +0900 Message-Id: <1296010673-3841-1-git-send-email-gnurou@gmail.com> In-Reply-To: <20110125080510.GD23331@hall.aurel32.net> References: <20110125080510.GD23331@hall.aurel32.net> Subject: [Qemu-devel] [PATCH v2] target-sh4: update PTEH upon MMU exception List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: Alexandre Courbot , qemu-devel@nongnu.org Update the PTEH register to contain the VPN at which an MMU exception occured as specified by the SH4 reference. Signed-off-by: Alexandre Courbot --- target-sh4/helper.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/target-sh4/helper.c b/target-sh4/helper.c index 19b309b..8f8c66c 100644 --- a/target-sh4/helper.c +++ b/target-sh4/helper.c @@ -453,6 +453,10 @@ int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw, if (ret != MMU_OK) { env->tea = address; + if (ret != MMU_DTLB_MULTIPLE && ret != MMU_ITLB_MULTIPLE) { + env->pteh = (env->pteh & PTEH_ASID_MASK) | + (address & PTEH_VPN_MASK); + } switch (ret) { case MMU_ITLB_MISS: case MMU_DTLB_MISS_READ: -- 1.7.3.5