From patchwork Fri Nov 4 20:50:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 9413181 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 3718260585 for ; Fri, 4 Nov 2016 20:56:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EEC62ABCA for ; Fri, 4 Nov 2016 20:56:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 133692AD68; Fri, 4 Nov 2016 20:56:21 +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 A2D4A2ABCA for ; Fri, 4 Nov 2016 20:56:20 +0000 (UTC) Received: from localhost ([::1]:40732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2lX9-0004Uq-Oa for patchwork-qemu-devel@patchwork.kernel.org; Fri, 04 Nov 2016 16:56:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2lSM-0000dK-BY for qemu-devel@nongnu.org; Fri, 04 Nov 2016 16:51:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2lSL-0003qE-JW for qemu-devel@nongnu.org; Fri, 04 Nov 2016 16:51:22 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:35922) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c2lSL-0003pJ-DF for qemu-devel@nongnu.org; Fri, 04 Nov 2016 16:51:21 -0400 Received: by mail-wm0-x242.google.com with SMTP id c17so5605470wmc.3 for ; Fri, 04 Nov 2016 13:51:21 -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; bh=sKsJ4lZ48BdKoyVSxVLGcJ7iQ5IvouzniODyFgQsenY=; b=0d2tLCLMRDVWsYcXUntNVy8+A/I+ecB+BMF4VT8OhimYxfECCPMUzbSAgJ6iEUc2WQ blCLPXWw7aS1MPNudmNdQztPO0paLSpjdZ7MNr2V4HcqOBnp0Qp+NgYMqQgsM8FuK7u6 Uw0rRgvMbIcZBAz1vhbHXPxlaDmIDxQ0r1API/ozvPW9pcpI2RQ1WBp7TUey2vEIW9de u4U0PF/D/R8lXmLSsWI5fnHpKWx9kHZy+ggaZxVaxtLJfgwfGHIKfLg2kUS2UAkVJYPP NRv3We0LxoIKfS/ARg+YQxEJi3wpFH8zEolgsyC0+6tVUuXF34GF9z0bHhsr1yNHCMQ/ gKhg== 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; bh=sKsJ4lZ48BdKoyVSxVLGcJ7iQ5IvouzniODyFgQsenY=; b=MBWi29qgPpLdyEcsrZnEBecLYtEIGipwxZGD2Gyh6qVs8IT1HxtSIgZCm2PCKMUCF8 5yd+mpm1R73otmMgfV+ssmCYcQFakHgKWXU93w6XKCFmi1dqhviCbnqc3C6CUmWsb8Dw Gf09ZqciQMOHm1YKRBsTF8wKJr9aLkWCvAvBOeGAKCpueEqDiHAeLdMwyrE0eto7OSZ/ y9Bq7zFVarb5zG/MyWOrkaGv5wCj6pSQt5nDm+q9fViuFEy3bhC0QkPTomP0afVCjBAc xcPx+cfmXiAvVpEp5IXKHn/sBx4noqhSP5fo0FYpWb2Lw6u0U0iJlB2NfeTJ256WVQnq Ydgg== X-Gm-Message-State: ABUngveDpUG32cidGTaClpM4KtdKXgYKW2m+qn1FtSgKf/mv8r0GvyWGQWxgVadsBWOrXQ== X-Received: by 10.28.157.200 with SMTP id g191mr189630wme.33.1478292680325; Fri, 04 Nov 2016 13:51:20 -0700 (PDT) Received: from localhost (x55b4b5cf.dyn.telefonica.de. [85.180.181.207]) by smtp.gmail.com with ESMTPSA id m5sm6432796wmd.17.2016.11.04.13.51.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Nov 2016 13:51:19 -0700 (PDT) From: Artyom Tarasenko To: qemu-devel@nongnu.org Date: Fri, 4 Nov 2016 21:50:08 +0100 Message-Id: <7b429f983b35d7c81b1aa1b344f2ac2356c66464.1478291230.git.atar4qemu@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: In-Reply-To: References: 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] [PATCH v1 07/30] target-sparc: simplify replace_tlb_entry by using TTE_PGSIZE 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 Signed-off-by: Artyom Tarasenko Reviewed-by: Richard Henderson --- target-sparc/ldst_helper.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target-sparc/ldst_helper.c b/target-sparc/ldst_helper.c index 043cbf8..68eca86 100644 --- a/target-sparc/ldst_helper.c +++ b/target-sparc/ldst_helper.c @@ -127,9 +127,8 @@ static void replace_tlb_entry(SparcTLBEntry *tlb, if (TTE_IS_VALID(tlb->tte)) { CPUState *cs = CPU(sparc_env_get_cpu(env1)); - mask = 0xffffffffffffe000ULL; - mask <<= 3 * ((tlb->tte >> 61) & 3); - size = ~mask + 1; + size = 8192ULL << 3 * TTE_PGSIZE(tlb->tte); + mask = 1ULL + ~size; va = tlb->tag & mask;