From patchwork Wed Jan 11 20:19:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 9511311 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 3CF366075C for ; Wed, 11 Jan 2017 20:46:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CF6D285E1 for ; Wed, 11 Jan 2017 20:46:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15D4E28655; Wed, 11 Jan 2017 20:46:41 +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 9792E285E1 for ; Wed, 11 Jan 2017 20:46:40 +0000 (UTC) Received: from localhost ([::1]:56988 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRPn5-000839-1l for patchwork-qemu-devel@patchwork.kernel.org; Wed, 11 Jan 2017 15:46:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRPOO-0006nQ-S6 for qemu-devel@nongnu.org; Wed, 11 Jan 2017 15:21:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRPON-0001Cy-R4 for qemu-devel@nongnu.org; Wed, 11 Jan 2017 15:21:08 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:36698) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cRPON-0001CH-Kc for qemu-devel@nongnu.org; Wed, 11 Jan 2017 15:21:07 -0500 Received: by mail-wm0-x244.google.com with SMTP id r126so555890wmr.3 for ; Wed, 11 Jan 2017 12:21:07 -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 :in-reply-to:references:mime-version:content-transfer-encoding; bh=++lzNll2eqDJU6wTj18h1uKyGxyqoKTadrnUHs7s00k=; b=pH0YFIQBVjfVPT6ilfnkseuN7uayYX6x5aYKZv18RQQC2ujpWKlgVvkM9guT6UkjlD KPyFLHp3OE8SFGW7eqTnz/Ehlt2Zec9LoNS70czbebLKkzYqZi3DMnaeJmcUybLranlH D3JWQcmK6Z4D+dy9fuI//SN3WcoSewm+r/QiCPK+N33zBH0gs4nDuUpJtynNFCei/sqI MQF+J147AITq5TxadYsLN+YnkO3uh5m5Yq6WDdHE/0s5XzYqF/Cuchr/0zE7qnewTvtj OA9/fgW4CMSS7Eo4wRlILsMdbZFx8tvEhjEh8gL46TNSCnrnaOVSH9pONJzVpq7KsYNK 3jqw== 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:in-reply-to:references:mime-version :content-transfer-encoding; bh=++lzNll2eqDJU6wTj18h1uKyGxyqoKTadrnUHs7s00k=; b=k/wP7a0LExF7F4I4FX6UoFyvIzr9ExnLuFwdNBofoNenrsWbxJ2f+MEySAWkSrWru9 plLAbOlr55kd1YKXrSRrLg6eBeKs5q2Pvxq+hZAHfGAscfn4RMpDcf0atGRkSzNWcJpl P1H77vLgqEfLC+mG8z1bcve7cD2Q2N+4OlEUHl++rZYNujjO2pU983q7qVLS4AjbuCNS eIRnkzbsK5SJSJkfG/ksZm0tvMeNrpcm3nPamm6gJkNvc9wm0/y3WvKfmyV5WBvfexrK 3DqzEMl5LN1EMHtdlO+9WTEm1VWgYbgk7Hochr0f4Zxx3SBwq/S+1tr6X8M1OyTbJUZK L9ug== X-Gm-Message-State: AIkVDXIkXlsD1khN5KVNUoMCn/wWCpO3y4Ul1UKQvqUKfGaZkEsUJ13H48Oqh9c8DeZGqg== X-Received: by 10.223.164.7 with SMTP id d7mr4870758wra.75.1484166066704; Wed, 11 Jan 2017 12:21:06 -0800 (PST) Received: from localhost (x55b4b54a.dyn.telefonica.de. [85.180.181.74]) by smtp.gmail.com with ESMTPSA id c81sm10595859wmf.22.2017.01.11.12.21.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 12:21:05 -0800 (PST) From: Artyom Tarasenko To: qemu-devel@nongnu.org Date: Wed, 11 Jan 2017 21:19:49 +0100 Message-Id: <86cbe148bfaf96575128f3d8394a17c48ad92f28.1484165352.git.atar4qemu@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: In-Reply-To: References: 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 v2 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 , 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 d524aaa..8cc8bb1 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