From patchwork Wed Jan 18 22:38:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 9524907 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 8B5EA601B7 for ; Wed, 18 Jan 2017 22:56:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E3152863D for ; Wed, 18 Jan 2017 22:56:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70BFA2863F; Wed, 18 Jan 2017 22:56:07 +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 263AD2863D for ; Wed, 18 Jan 2017 22:56:07 +0000 (UTC) Received: from localhost ([::1]:44861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTz9C-0003Gm-27 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 18 Jan 2017 17:56:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTytL-0006kc-RQ for qemu-devel@nongnu.org; Wed, 18 Jan 2017 17:39:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTytI-0002s3-Nz for qemu-devel@nongnu.org; Wed, 18 Jan 2017 17:39:43 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:33227) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cTytI-0002rl-HX for qemu-devel@nongnu.org; Wed, 18 Jan 2017 17:39:40 -0500 Received: by mail-wm0-x242.google.com with SMTP id r144so7568674wme.0 for ; Wed, 18 Jan 2017 14:39:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5ZPlBZBpGGo4zqHtw2k5XVuw+jBz+MF44bog37UIMC4=; b=PhUaNIsuskC0OAe25dW2oHIXfk4Puyj8/f/a9CG+jEtZIAx6EJJS9CSE0xvtl3PbrR lNPZli4PYs+HS+5GWRnClsdKdPqAbSt8sV1Zi31vHibzI3qoxlA3Se8FUXDMzE9VQ2AH q207bUaoALmBRc9etJrQW+ABdXfpDU+v5l2oTKaiGovdBleOKtqxkspa0yjP+N7KVGS/ T8XLNKQhQytbhV3LuoRql/TB873T+fz6GfGmOOVJ6m2e7FGyWyPQWayqBsTIB8f6QA1U pDoEJfoITPLpFGb9pFD5zzN+oy2b59ORBXDxMuXt0UzWbyKGmXjczjdAD717DsVzGNYo /Xzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5ZPlBZBpGGo4zqHtw2k5XVuw+jBz+MF44bog37UIMC4=; b=Cf1CL1DCm29Qirmc/f/ZFgyeOy25Uqrsr8ZKMN1zHIpCfXvyf+XBo6KJDZ319KVjJb e6jf5UfT/9WPBFE9IpNz52HJ71KvlUorXKRilngWR5y/IZyeCDmRBVwFkAb6Sgj3GjAq S7VunDaifc1HItKm4sHli3FAGOwzxq+M2nC9f7tXClY1jUmkNmNirfufl6INJ2L+uqGR R3HG8E8ypMJM4Yqcm2erXeBMW01VECpXR8yXIxwC2Y9ze878tDoXdQl6WWsmGkHWaTUt p1UIQ8sglWh19CzpILRr/vheQHQPHEF4gN+3ivU1xMuch7E9TrJ9hVnZ0BfWokoTqMru g6oQ== X-Gm-Message-State: AIkVDXIsGZlHztOVdSac6p959SW7Cnnw6P+EsJna5pcE9pmy9MUrhpWVHJKQ2dO1sFiRhA== X-Received: by 10.223.167.130 with SMTP id j2mr4735218wrc.154.1484779179535; Wed, 18 Jan 2017 14:39:39 -0800 (PST) Received: from localhost (x4e33e2b8.dyn.telefonica.de. [78.51.226.184]) by smtp.gmail.com with ESMTPSA id 81sm7978852wmw.7.2017.01.18.14.39.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jan 2017 14:39:38 -0800 (PST) From: Artyom Tarasenko To: peter.maydell@linaro.org Date: Wed, 18 Jan 2017 23:38:31 +0100 Message-Id: <1484779123-18968-19-git-send-email-atar4qemu@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1484779123-18968-1-git-send-email-atar4qemu@gmail.com> References: <1484779123-18968-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::242 Subject: [Qemu-devel] [PULL 18/30] 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@ilande.co.uk, qemu-devel@nongnu.org, Artyom Tarasenko , rth@twiddle.net 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 d3747cf..029120d 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