From patchwork Fri Jan 13 06:28:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suraj Jitindar Singh X-Patchwork-Id: 9514685 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 74C3C60762 for ; Fri, 13 Jan 2017 06:53:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BBDE285CB for ; Fri, 13 Jan 2017 06:53:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E6BD28601; Fri, 13 Jan 2017 06:53:20 +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 1DCC4285CB for ; Fri, 13 Jan 2017 06:53:18 +0000 (UTC) Received: from localhost ([::1]:39420 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRvjh-0003XY-Cm for patchwork-qemu-devel@patchwork.kernel.org; Fri, 13 Jan 2017 01:53:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRvMg-0006fd-Vj for qemu-devel@nongnu.org; Fri, 13 Jan 2017 01:29:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRvMc-00028I-40 for qemu-devel@nongnu.org; Fri, 13 Jan 2017 01:29:31 -0500 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:36066) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cRvMZ-00027X-TY; Fri, 13 Jan 2017 01:29:24 -0500 Received: by mail-pf0-x242.google.com with SMTP id b22so6877544pfd.3; Thu, 12 Jan 2017 22:29:23 -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=8nBHIrsrPtQFjQHd1e6wLOn4gnkFM9a6yo6zFwnpJOI=; b=tqLV7AZaMKDaqWgZlstLn1fkRpS6a/GBGHbIjb2OaJW2Vj1aIY54yl4JKR/i8HST53 cz+MYRGfY9z+7kuDoEWSBf2G47xzOoahambsanjWCv/UDvLtg0HcelfsZ3C5/wZNwGJh Q5rbPKHm4ZqyfI+Sr07lFTZp2n2MGfEIfepyMpTxYUismFnvDQ1N9SZ3rS6CYgZwSUZH ga9LAkbmPQ3PjAXEHefJ8fF8BjsC7n1V1KLn3/W5oLelHRRpInH7LO8kefRtvpVqBAoR 7kWcgWoaQr67api2chcvVW8h90yEIxgYVjheEznhZhP0DPMdHwkWFFJ9vQyh5JPX4XGX l3Rw== 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=8nBHIrsrPtQFjQHd1e6wLOn4gnkFM9a6yo6zFwnpJOI=; b=TyJCC5iGv62z5yD8EwqGgGmJ3b6Lwo2fXi/U8lZ3KDqFRAph2xJbCrWExWfkqkELqT ALN+VfBOLHP1uMoSrCG0xBLYqT/rKvqrqEEKn0rzqTxg68RDaYtryQFGCTCsMvJPjcDi PgCqW4oYUaWGSrjgBZdjLIl+XDFvFRbzd3i60eYQQ1QFTUxxY+WpoDIQX+QWBij0T1fz aX6hlrglguK3/vGjo9bGZy8NjbI0DIxrKWa49s6xzqLcE76Te6fedUd9IVk27PpZg11A 69zspqNIkD1UZTwAd1hjxDP6QstJd+Duvpe+9T4WVJou7Q+ErZYTAa1/E/oPV/XcSUfY cLaw== X-Gm-Message-State: AIkVDXL7NbszfJcdPipIA8MY9p7jnyghD1BkMzqhDqqI/mPE72B8nlCTy1bgZ2tlqWQJIA== X-Received: by 10.84.199.194 with SMTP id d2mr27521151plh.134.1484288963153; Thu, 12 Jan 2017 22:29:23 -0800 (PST) Received: from dyn253.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id r2sm26004999pfi.67.2017.01.12.22.29.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jan 2017 22:29:22 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Fri, 13 Jan 2017 17:28:23 +1100 Message-Id: <1484288903-18807-18-git-send-email-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1484288903-18807-1-git-send-email-sjitindarsingh@gmail.com> References: <1484288903-18807-1-git-send-email-sjitindarsingh@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::242 Subject: [Qemu-devel] [RFC PATCH 17/17] target/ppc/mmu_hash64: Fix incorrect shift value in amr calculation 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: qemu-devel@nongnu.org, agraf@suse.de, Suraj Jitindar Singh , david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP We are calculating the authority mask register key value wrong. The pte entry contains the key value with the two upper bits and the three lower bits stored separately. We should use these two portions to get a 5 bit value, not or them together which will only give us a 3 bit value. Fix this. Signed-off-by: Suraj Jitindar Singh --- target/ppc/mmu-hash64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/ppc/mmu-hash64.h b/target/ppc/mmu-hash64.h index 73d7ce4..e8160c3 100644 --- a/target/ppc/mmu-hash64.h +++ b/target/ppc/mmu-hash64.h @@ -89,7 +89,7 @@ void ppc_hash64_update_rmls(CPUPPCState *env); #define HPTE64_R_C 0x0000000000000080ULL #define HPTE64_R_R 0x0000000000000100ULL #define HPTE64_R_KEY_LO 0x0000000000000e00ULL -#define HPTE64_R_KEY(x) ((((x) & HPTE64_R_KEY_HI) >> 60) | \ +#define HPTE64_R_KEY(x) ((((x) & HPTE64_R_KEY_HI) >> 57) | \ (((x) & HPTE64_R_KEY_LO) >> 9)) #define HPTE64_V_1TB_SEG 0x4000000000000000ULL