From patchwork Mon Jan 15 15:23:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Kristina_Mart=C5=A1enko?= X-Patchwork-Id: 10164649 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 0A7C1601C0 for ; Mon, 15 Jan 2018 15:30:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8E9F284C3 for ; Mon, 15 Jan 2018 15:30:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD65D2891C; Mon, 15 Jan 2018 15:30:08 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 72A7528928 for ; Mon, 15 Jan 2018 15:30:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=kJqnI5zObBuMOL48mLnfdP29Rd3myjsTNedrTJZYPyQ=; b=AO00Z6nItAe9r+1zSCKyOoh1tA k96fIDOE2V5eTWzwTUghZN+CDYgfsFh7osMozd1rJbktsMs/XEao3ME1AT6wodn0a3vuEZTqkUiIi 2FHiNh1DUMK2jE0mmH6dEZYA+Lv90Iz0RKaw0D0/uqRotoOp1qYFt0UZlShvtbg2h97mRCHb1BBhF HY3pJCMTWYLyLG/32GCgIIStxd9WVNlrp0JVzb0MR6uyFTbey0nmJ9MXtKJw4HhrSIixWfHg+YCON qFG66SDxlyaR9Ef3RFGxjeWSneHSScNwDEE2QQ7k7TUv10qF9vF88tLxYLYEc3GHuNpxzACeWSzL8 xRaPSRWQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eb6i5-0007D7-GH; Mon, 15 Jan 2018 15:30:05 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eb6hw-0006zT-Ap for linux-arm-kernel@lists.infradead.org; Mon, 15 Jan 2018 15:30:01 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E80B81596; Mon, 15 Jan 2018 07:29:47 -0800 (PST) Received: from moonbear.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B5FB73F53D; Mon, 15 Jan 2018 07:29:46 -0800 (PST) From: Kristina Martsenko To: Catalin Marinas , Will Deacon Subject: [PATCH 1/3] arm64: fix ID map extension to 52 bits Date: Mon, 15 Jan 2018 15:23:48 +0000 Message-Id: <1516029830-12326-2-git-send-email-kristina.martsenko@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1516029830-12326-1-git-send-email-kristina.martsenko@arm.com> References: <1516029830-12326-1-git-send-email-kristina.martsenko@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180115_072956_409450_2E00E5DD X-CRM114-Status: GOOD ( 10.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Steve Capper , linux-arm-kernel@lists.infradead.org, "Suzuki K. Poulose" MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Commit fa2a8445b1d3 added support for extending the ID map to 52 bits, but accidentally dropped a required change to __cpu_uses_extended_idmap. As a result, the kernel fails to boot when VA_BITS = 48 and the ID map text is in 52-bit physical memory, because we reduce TCR.T0SZ to cover the ID map, but then never set it back to VA_BITS. Add back the change, and also clean up some double parentheses. Fixes: fa2a8445b1d3 ("arm64: allow ID map to be extended to 52 bits") Signed-off-by: Kristina Martsenko Reviewed-by: Suzuki K Poulose --- arch/arm64/include/asm/mmu_context.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h index 8f80fcb49252..5aee19905556 100644 --- a/arch/arm64/include/asm/mmu_context.h +++ b/arch/arm64/include/asm/mmu_context.h @@ -72,8 +72,7 @@ extern u64 idmap_ptrs_per_pgd; static inline bool __cpu_uses_extended_idmap(void) { - return (!IS_ENABLED(CONFIG_ARM64_VA_BITS_48) && - unlikely(idmap_t0sz != TCR_T0SZ(VA_BITS))); + return unlikely(idmap_t0sz != TCR_T0SZ(VA_BITS)); } /* @@ -82,7 +81,7 @@ static inline bool __cpu_uses_extended_idmap(void) */ static inline bool __cpu_uses_extended_idmap_level(void) { - return ARM64_HW_PGTABLE_LEVELS((64 - idmap_t0sz)) > CONFIG_PGTABLE_LEVELS; + return ARM64_HW_PGTABLE_LEVELS(64 - idmap_t0sz) > CONFIG_PGTABLE_LEVELS; } /*