From patchwork Sat Oct 1 10:05:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 9359129 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 E6A846086A for ; Sat, 1 Oct 2016 10:17:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7BCC2984D for ; Sat, 1 Oct 2016 10:17:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC56229851; Sat, 1 Oct 2016 10:17:09 +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 87B6A2984D for ; Sat, 1 Oct 2016 10:17:09 +0000 (UTC) Received: from localhost ([::1]:54968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqHLw-0005a7-Jt for patchwork-qemu-devel@patchwork.kernel.org; Sat, 01 Oct 2016 06:17:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqHCN-00061x-DZ for qemu-devel@nongnu.org; Sat, 01 Oct 2016 06:07:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bqHCK-0007Zz-0v for qemu-devel@nongnu.org; Sat, 01 Oct 2016 06:07:14 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:32814) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqHCJ-0007Za-QP for qemu-devel@nongnu.org; Sat, 01 Oct 2016 06:07:11 -0400 Received: by mail-wm0-x244.google.com with SMTP id p138so6757755wmb.0 for ; Sat, 01 Oct 2016 03:07:11 -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; bh=nls2woWOd8vf4DqdMNAYnIXzgrGUt1loShEStDX0du0=; b=09Pu3dz1liwrW5EiezX0/Q4vcPOY2a9uUNf/ENulD8+Q3XXeAosksqHGsvLLCDl5TJ R2i9ut77b8DErHtJh9P/LTV6NVnbdp7QnfJkLQe4YOSDlgy5JEY1tXiZp+A5pVwY5t0g lyZdjaQDDte+mSGkqchLcIoujyQ0aO7ROsanpRb0pmGqtXvIIndpWYjLq7qBbIgmAXDx g3+vwaCo5yxGPRgCj8NinT8ICXkmmxBI6PRVNSbX11Z7pOntxNgzPwEXWZvlL8/iTaNH PbLVs8bKEizYPo/ktpngPOejf/dRXCCHQUVfR2zvIdOCv2E7paxV+CHcl2X/kH7i4gQQ cBMg== 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; bh=nls2woWOd8vf4DqdMNAYnIXzgrGUt1loShEStDX0du0=; b=H2+3ptZJm7Zko2L+FhVaqQNb6FdXIAYr4zwaU9zyHM0FdFjWx4C3R/N/dP9ttXZ+iR g01XTuwRO+utB462eddsTIPIbDGzLx/SRoLW/8vr+vCAvOth8pMVpe4yJsej0+vUEXN3 TDSBUNI/tIVOY/57MpUP8dyMEFvoXeCT4IUjiM3nl8IBB9OVNjMYtkOWvT1qCGy5g0Ia hpSP0bChgWjOinBBm5v/rWkUjf2Y4GK++G82NIh1HHQxwBAz8zG93Wu4HVjq+5c9Wo+C SPxvwZSppno1eEN78bHjCfXmpbYr4k05R+WjL9DV2rrF85mlLe3a2mN5JlvrJnarE8Fx JYjA== X-Gm-Message-State: AA6/9Rmz9JnTlZGJ2gpnipteg3DstkbC+bfwbRunQCEPWxOaB6cNSL+1nk+nM5U6k1csWw== X-Received: by 10.28.66.6 with SMTP id p6mr1636472wma.59.1475316431100; Sat, 01 Oct 2016 03:07:11 -0700 (PDT) Received: from localhost (x55b4da19.dyn.telefonica.de. [85.180.218.25]) by smtp.gmail.com with ESMTPSA id rk14sm23882991wjb.6.2016.10.01.03.07.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Oct 2016 03:07:10 -0700 (PDT) From: Artyom Tarasenko To: qemu-devel@nongnu.org Date: Sat, 1 Oct 2016 12:05:10 +0200 Message-Id: <1475316333-9776-7-git-send-email-atar4qemu@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1475316333-9776-1-git-send-email-atar4qemu@gmail.com> References: <1475316333-9776-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] [PATCH 06/29] 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 74708f2..7607128 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;