From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqHCe-0006Mg-Rz for qemu-devel@nongnu.org; Sat, 01 Oct 2016 06:07:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bqHCd-0007mT-Sl for qemu-devel@nongnu.org; Sat, 01 Oct 2016 06:07:32 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:34430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqHCd-0007m8-EA for qemu-devel@nongnu.org; Sat, 01 Oct 2016 06:07:31 -0400 Received: by mail-wm0-x244.google.com with SMTP id b201so1582199wmb.1 for ; Sat, 01 Oct 2016 03:07:31 -0700 (PDT) From: Artyom Tarasenko Date: Sat, 1 Oct 2016 12:05:21 +0200 Message-Id: <1475316333-9776-18-git-send-email-atar4qemu@gmail.com> In-Reply-To: <1475316333-9776-1-git-send-email-atar4qemu@gmail.com> References: <1475316333-9776-1-git-send-email-atar4qemu@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 17/29] target-sparc: replace the last tlb entry when no free entries left List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Richard Henderson , Mark Cave-Ayland , Artyom Tarasenko Implement the behavior described in the chapter 13.9.11 of UltraSPARC T1™ Supplement to the UltraSPARC Architecture 2005: "If a TLB Data-In replacement is attempted with all TLB entries locked and valid, the last TLB entry (entry 63) is replaced." Signed-off-by: Artyom Tarasenko --- target-sparc/ldst_helper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target-sparc/ldst_helper.c b/target-sparc/ldst_helper.c index 250c23f..11ca74e 100644 --- a/target-sparc/ldst_helper.c +++ b/target-sparc/ldst_helper.c @@ -246,9 +246,11 @@ static void replace_tlb_1bit_lru(SparcTLBEntry *tlb, } #ifdef DEBUG_MMU - DPRINTF_MMU("%s lru replacement failed: no entries available\n", strmmu); + DPRINTF_MMU("%s lru replacement: no free entries available, " + "replacing the last one\n", strmmu); #endif - /* error state? */ + /* corner case: the last entry is replaced anyway */ + replace_tlb_entry(&tlb[63], tlb_tag, tlb_tte, env1); } #endif -- 2.7.2