From patchwork Wed Jan 18 22:38:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 9524899 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 8515C601B7 for ; Wed, 18 Jan 2017 22:51:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76D992855A for ; Wed, 18 Jan 2017 22:51:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A3242852C; Wed, 18 Jan 2017 22:51:39 +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 E92552852C for ; Wed, 18 Jan 2017 22:51:38 +0000 (UTC) Received: from localhost ([::1]:44838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTz4r-0007qz-Rd for patchwork-qemu-devel@patchwork.kernel.org; Wed, 18 Jan 2017 17:51:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTyt0-0006PY-1t for qemu-devel@nongnu.org; Wed, 18 Jan 2017 17:39:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTysy-0002cy-Iz for qemu-devel@nongnu.org; Wed, 18 Jan 2017 17:39:22 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35653) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cTysy-0002cX-Ci for qemu-devel@nongnu.org; Wed, 18 Jan 2017 17:39:20 -0500 Received: by mail-wm0-x244.google.com with SMTP id d140so7555939wmd.2 for ; Wed, 18 Jan 2017 14:39:20 -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; bh=M8aYQHc3rR0huhxwf7e+i0A/pMpXFH9o3v5NteVoF0k=; b=qtHQhAcejuLxiIbDDCSTS8cH3fBpZ4rFf0ibemLakhSg833H4aWHnWJ1IPdTTWYTZ4 mBJVX21f3s9a/Q4tpomMYo5B5IcAr9seTmZ1MU3jE2Umhy+NLJ6k2vPxMrxqHSz4yBkk oVpiO2d1YhcATalyeXmTUFIZhF/ai6/R7hQSY7ZbVkMu01ARA7/GiW2mXOxXQyz0pRux UOS4a+9ZbnI+qACP3tiap3QgobHq0T0pg5xi9yufYZmSYGg2fZuBiBClHf2pWp7KKO/y /F0vXZmutrjkftRuUYZmb/mHh5T4i44bjYbfV4lfzPNx8CzsPjgFIWDW1oWI/IjAYt+5 G0qA== 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; bh=M8aYQHc3rR0huhxwf7e+i0A/pMpXFH9o3v5NteVoF0k=; b=o4/NeFunUmpMJS+0t8Ix+JR6PAaQMojy/lrUmthMaMW5u9rzV8afPDjkXEJZsG6ob8 vAofh+Iw4yFPG7sHd4uQI+WMTCgsCaRQUEyynJhHGmxslhLz+/hhwOlOm8u+GnmxuqXl Rf5Lf+IF/4DGPvThtQEQ8me1elAKoN16CUc2MXeDw2M+o79ajtWk7f8WMwjP41yfaEOb SqmFpZYFsEjipFJ+tIuT1+uaWCxQtOGRj3+V+GBw8lhKq1QMHtxsYfJ6HnhTxbIHJQnd 1hYRQ4XTD+++OBqUG7Db5XodNuSWxEcrc+ZJ7vQHowMztEE/KRkxfXpfRPFmcdeYBrF8 1QtQ== X-Gm-Message-State: AIkVDXIHvW2I0FYl7iyUvH+BBPEdv0wAGhciMsXHOnvlQJ7A+IJ+QalYMROmquUSH72pHw== X-Received: by 10.223.178.87 with SMTP id y23mr4463264wra.91.1484779159398; Wed, 18 Jan 2017 14:39:19 -0800 (PST) Received: from localhost (x4e33e2b8.dyn.telefonica.de. [78.51.226.184]) by smtp.gmail.com with ESMTPSA id c81sm7923443wmf.22.2017.01.18.14.39.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jan 2017 14:39:18 -0800 (PST) From: Artyom Tarasenko To: peter.maydell@linaro.org Date: Wed, 18 Jan 2017 23:38:20 +0100 Message-Id: <1484779123-18968-8-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> 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] [PULL 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@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 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 20e202b..7a134b3 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;