From patchwork Sat Oct 1 10:05:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 9359181 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D2314607D6 for ; Sat, 1 Oct 2016 10:43:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF066298A8 for ; Sat, 1 Oct 2016 10:43:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BD88298B7; Sat, 1 Oct 2016 10:43:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 264B6298A8 for ; Sat, 1 Oct 2016 10:43:29 +0000 (UTC) Received: from localhost ([::1]:55117 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqHlQ-0002XN-SL for patchwork-qemu-devel@patchwork.kernel.org; Sat, 01 Oct 2016 06:43:28 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0RUx9l5AnXtRMcZbHNDbdQEDhRvv3ndE4BiD7Cey0pw=; b=aswo9pwboMH3ZYRknLTb5buMBkkUOdW4UacqLXmz0F6Y76+BDia1iLdwusjUotaPRS ZDNOIE68eBmLUKY+T8wkBe9kFROo2KGPB7T1xRkvQ+atJLPre9yljHX05fJB2QqqzVqu P6vxbT4eph5DlMNd7NPKwNrufcs0OLO2nRrwckceqBHZTDsO5YanwnzvXyJZJ6q2KK7p mnCIuuzcHPRqg6Eq2zNNNmX0jvBh6Ck2sBq2WSHaTyhIBGsa48+PnXtifNPZ5DIhhrmn 7P4EoAIe1pTCuoLsyLhEDUg39KJpL64+DkgzHrmushppAvFb04pN62L5al7lKy2sDVSq hK0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0RUx9l5AnXtRMcZbHNDbdQEDhRvv3ndE4BiD7Cey0pw=; b=JAMoDoDs+ZnRBbiiK3o2EZCI/0P+ctmArcoTnm+oELcOQujFy17UmD64TaFJ7lvdmS oDIr9aigNHfAGl4xSbRR1suSYMObtOfDs9fAe2Z++nq6+w4T20vlWR/6iGG+pkM3Evgi v3Bitmz/bvD6Su0su81k8GvmPrTib4AlMx5/UTU5I1nFy1wVlepKxK1u3pwHbmaHWMSS DVZQrATSDzTw7abGqV2QapicyGD+iPlnZUOWUbLaufvgRLBeKehfKvcJqRF9LVdSspYs jHqe+9J6W/p6/0KzKnbo8bdFCaTj3wkbPZzvbds3FXbbrwzuOPDOnEuAaXNs4IrO0AIn i0ZQ== X-Gm-Message-State: AA6/9Rkq5AX10LmWLiaM2U41FgaepzNyO9Imjkq/N6Rb570lFzM1y8fn7WfZgxzpg2osvw== X-Received: by 10.28.111.201 with SMTP id c70mr1542870wmi.126.1475316450712; Sat, 01 Oct 2016 03:07:30 -0700 (PDT) Received: from localhost (x55b4da19.dyn.telefonica.de. [85.180.218.25]) by smtp.gmail.com with ESMTPSA id t65sm8431588wmt.15.2016.10.01.03.07.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Oct 2016 03:07:29 -0700 (PDT) From: Artyom Tarasenko To: qemu-devel@nongnu.org Date: Sat, 1 Oct 2016 12:05:21 +0200 Message-Id: <1475316333-9776-18-git-send-email-atar4qemu@gmail.com> X-Mailer: git-send-email 1.8.3.1 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 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH 17/29] target-sparc: replace the last tlb entry when no free entries left X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Cave-Ayland , Artyom Tarasenko , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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