From patchwork Fri Nov 4 20:50:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 9413235 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 8C6CB60573 for ; Fri, 4 Nov 2016 21:09:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E50E2AF51 for ; Fri, 4 Nov 2016 21:09:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 733A42AF79; Fri, 4 Nov 2016 21:09:43 +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 364A82AF51 for ; Fri, 4 Nov 2016 21:09:43 +0000 (UTC) Received: from localhost ([::1]:40794 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2lk6-0007hu-DR for patchwork-qemu-devel@patchwork.kernel.org; Fri, 04 Nov 2016 17:09:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2lSg-00013K-U8 for qemu-devel@nongnu.org; Fri, 04 Nov 2016 16:51:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2lSf-0004GB-PJ for qemu-devel@nongnu.org; Fri, 04 Nov 2016 16:51:42 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35942) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c2lSf-0004F7-Il for qemu-devel@nongnu.org; Fri, 04 Nov 2016 16:51:41 -0400 Received: by mail-wm0-x244.google.com with SMTP id c17so5606624wmc.3 for ; Fri, 04 Nov 2016 13:51:41 -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 :in-reply-to:references:mime-version:content-transfer-encoding; bh=z8Efccp8C0S1rYUfe+xcNd+4ArToI91A1fF821ryq5Q=; b=UNOE+hW2+ElM1PMOKbt1dyZ3c49DtJdR+foSCRYlVQd58puNvlnfBNELgeobADlRKI ds1hjz7AwFNcqIDGPrWlrpPNx4p2r/todogPRKesc7U49tsigxUr7Ts6Uke65NA7RMKN HRCQJ1F7ZtqdPyDiR1W8MxMNtTMgDh/DMPaJb9dnd6u7jwAOFzNJb+vbhTyfOL19RR3P zaIiEwI8h/vbSGM50eVIVR7jHiQtNLEpGBcKVfjv+LM36jJt5hPE1RvnJGXC0zHwNk6B 6jspKTd6nK4paTVvBSG3DD/yXLdUyEQxhkHnqAESQY989iDG0mqk+IpxccE1VQ1AtPEF G5Dw== 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:in-reply-to:references:mime-version :content-transfer-encoding; bh=z8Efccp8C0S1rYUfe+xcNd+4ArToI91A1fF821ryq5Q=; b=i1xI3SDGi4yg9doBN6PP5grIv7VQfKIdiFI+ymiO88RG0wMwjgazSBr7zhU43wudWO Q1Apm4MV2ROVjLoasYdmT+UDmmcislYzdt4JKBFP/61ITUoWWU5ogYvkSg3/lun/iNV8 yOVi6FNP7s3Pe49m8AWYRkNmqj8cAOH0WrNoZt9j/zcLaXBIFuYYzdthIwSm4MLhha47 ducXszpOJ1eipDLTOPi0t8zaJd9Sfyvff5I/mcxKPKF9mv7www7gnIMsb0ThmOyIVADN 9LJXc2eDLGxemmnLGkSkl5nEpwn23W3MeUCiY4JjNxzf8eaUvAzNhcIm/R0ynIDKpH9o kfrg== X-Gm-Message-State: ABUngvfKX9FtnyO6qtoWjSO6k8M0Z/d2dGOeET0JxUX2oAKByP6I9hGVJQaZdYSmJMGcfQ== X-Received: by 10.194.22.103 with SMTP id c7mr13038051wjf.34.1478292700477; Fri, 04 Nov 2016 13:51:40 -0700 (PDT) Received: from localhost (x55b4b5cf.dyn.telefonica.de. [85.180.181.207]) by smtp.gmail.com with ESMTPSA id y3sm16147009wjg.3.2016.11.04.13.51.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Nov 2016 13:51:39 -0700 (PDT) From: Artyom Tarasenko To: qemu-devel@nongnu.org Date: Fri, 4 Nov 2016 21:50:19 +0100 Message-Id: <2667c7a1fbc68742ad87602524e8d760b05d910a.1478291230.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 v1 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