From patchwork Wed Jan 11 20:19:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 9511215 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 8428E606E1 for ; Wed, 11 Jan 2017 20:34:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71D3227AB2 for ; Wed, 11 Jan 2017 20:34:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62E5728697; Wed, 11 Jan 2017 20:34:48 +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 52BC627AB2 for ; Wed, 11 Jan 2017 20:34:47 +0000 (UTC) Received: from localhost ([::1]:56909 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRPba-0004ST-Eo for patchwork-qemu-devel@patchwork.kernel.org; Wed, 11 Jan 2017 15:34:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRPO2-0006SK-Hx for qemu-devel@nongnu.org; Wed, 11 Jan 2017 15:20:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRPO1-0000y4-PW for qemu-devel@nongnu.org; Wed, 11 Jan 2017 15:20:46 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:34031) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cRPO1-0000xv-J6 for qemu-devel@nongnu.org; Wed, 11 Jan 2017 15:20:45 -0500 Received: by mail-wm0-x241.google.com with SMTP id c85so574879wmi.1 for ; Wed, 11 Jan 2017 12:20:45 -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; bh=cmyPTE5dOqew0peyAhwX7NHS6EQnPnpGbSN+41agDrY=; b=KnENMLzS6nzhIN5ibZ8yGFt92XOjDlJMDXdiV3Sva0PGM9pv4gqw9QTmsmQhoNCL1C RCNOUMR+3PAM5r+GHskxSXSlGUN0Q1KeZ6HHJYFVDquxlfBc5jItkfHcmvQruzVK1upC 4Y9VRNIMmu3fI4ic6r1c8giUrdhTGkda3rm41NnwkANugWz+TtjHPs5AmHE5F2uFPnMO yM6cq2uJNmPYn6OUX6AZRBITycR6O1RDAKPiyoyLCII9hoob5YBodk61fs2D9IgG95s6 DjK+CbnCodw78AfNu4DZBw1dl8rVtGBvIk9XT24vYEzh44MWXiHlxdETYUQvUyFLBiWR KmWQ== 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; bh=cmyPTE5dOqew0peyAhwX7NHS6EQnPnpGbSN+41agDrY=; b=enarrjA9D1NtCVQ/akrKGhxqY/RfhS9qDgoStOp9C4cjrNLTR7kQZuNg5DwnBFb9dv AHH6lETfgPSG59elX3yH22yS4nNxhqaep8FBcgVWNU5KlcZrQSF1rIUat/UztFuuZNB6 yEtYbP0hcf5xlQ8c2pjERLxLLncfWkzylZhFFLIlPhIvyUGcB1LYAf0iA2vFmalcM15A Q33L0MhLiG+1QMJHu/cx9sMWN5cXP6UwAhzrd7QeZSuATWNLaaFXRd22DqT/AiVVS6EY +5Ahp+hcEgKRYotolEQW2HfzVFm5uXikWe0L+fo/dVjWGhY5OwitMrCofoXvWD3R/d9g Jhhg== X-Gm-Message-State: AIkVDXKqpGs/u2YUsZWC7OJwYpK3IJZuB9kP4a0XYpjQ3SRbuxS3Soy7p2ZO8uzJwbbZrg== X-Received: by 10.223.150.183 with SMTP id u52mr455524wrb.180.1484166044645; Wed, 11 Jan 2017 12:20:44 -0800 (PST) Received: from localhost (x55b4b54a.dyn.telefonica.de. [85.180.181.74]) by smtp.gmail.com with ESMTPSA id 4sm10065951wjz.1.2017.01.11.12.20.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 12:20:43 -0800 (PST) From: Artyom Tarasenko To: qemu-devel@nongnu.org Date: Wed, 11 Jan 2017 21:19:38 +0100 Message-Id: <65e7ea6ea1cd0ebf291b1ed76d5cb1cccff2d49e.1484165352.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::241 Subject: [Qemu-devel] [PATCH v2 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;