From patchwork Wed Nov 29 23:39:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 10083905 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 5E4F76020B for ; Wed, 29 Nov 2017 23:40:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FE8B2852D for ; Wed, 29 Nov 2017 23:40:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44C8C29B6F; Wed, 29 Nov 2017 23:40:19 +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 F0F402852D for ; Wed, 29 Nov 2017 23:40:18 +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: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:In-Reply-To: References:List-Owner; bh=2nP29dHrOTGuAMG+TasMgVMjTEIL3941BvkjPlBUESI=; b=m3c Dg2TP9T3fEBhS/7ULQzwkt3F5yeDv0eV3ypT0ili8XQ9JxebPI8+0MnQKDuhfixcBAf78ptX/cP9w rTIMWArAavOKhbSWfpZ1dcpsznK8oiEyaBK5lqRxPuIkOowOpPNuCaKaj6rkeACt0K/BoPG3g8/Za DqC4dU/Od89z5TtIZPzsvVIfl3Lso40qUGyb5lyC/Pai/LFqj8CSJQQsFFsteESm6LCVU2mfEfplA RMGjmMRps6iRxwBkOYs92tT1EOviiREZpiwnb3qNqzMCKogBA+LlZ06VcfJES8L1EL9u9HnzJ+S2E NjhUW3OereBFCTA01mj4R66/UCzlQHg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eKBxh-00034V-Ul; Wed, 29 Nov 2017 23:40:17 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eKBxa-0001pG-W5 for linux-arm-kernel@lists.infradead.org; Wed, 29 Nov 2017 23:40:16 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 359A06044B; Wed, 29 Nov 2017 23:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1511998790; bh=W3+/LNhAX06a4GVsLFVWw+sTb2ySduKF1ehSLcdO/jU=; h=From:To:Cc:Subject:Date:From; b=lM4fvpKygZCiB0gYz40krW4w+CQlFK9jKSSDnANiHn3sBmg2P7hq0e7vD8qOGi1AH 34a4jW0fyEs/dL9bsrNfoSR5Pnfg902ygstxw1McD3rbttFubKum8kU35MRtz8A3UA nNWvzlP8dHDns19063Cxy94j8/KRWht776/nArxs= Received: from sboyd-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id AA28C6024C; Wed, 29 Nov 2017 23:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1511998789; bh=W3+/LNhAX06a4GVsLFVWw+sTb2ySduKF1ehSLcdO/jU=; h=From:To:Cc:Subject:Date:From; b=X4KYJiSTWSvS8QYcGPdSb1oHuwQhuOItUAf03b5EVigJBCelPRBDwXZCntzvsODyk qy6RDUTtdsk0x8+rmL1xwvLloagzSvlNzbUv1ms6QxSocBwdNlKGDK8vLKRC3tA2Tb D+bMXJXrL4MLZdnzRRzSZKwvANTwppTq17GvMrAk= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org AA28C6024C Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sboyd@codeaurora.org From: Stephen Boyd To: Catalin Marinas , Will Deacon Subject: [PATCH] arm64: Inform user if software PAN is in use Date: Wed, 29 Nov 2017 15:39:49 -0800 Message-Id: <20171129233949.1284-1-sboyd@codeaurora.org> X-Mailer: git-send-email 2.15.0.374.g5f9953d2c365 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171129_154011_093081_24499511 X-CRM114-Status: GOOD ( 10.90 ) 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 It isn't entirely obvious if we're using software PAN because we don't say anything about it in the boot log. But if we're using hardware PAN we'll print a nice CPU feature message indicating it. Add a print for software PAN too so we know if it's being used or not. Signed-off-by: Stephen Boyd --- arch/arm64/kernel/cpufeature.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 21e2c95d24e7..c6f8da17146b 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1189,6 +1189,9 @@ void __init setup_cpu_features(void) if (system_supports_32bit_el0()) setup_elf_hwcaps(compat_elf_hwcaps); + if (system_uses_ttbr0_pan()) + pr_info("Emulating Privileged Access Never (PAN) using TTBR0_EL1 switching\n"); + /* Advertise that we have computed the system capabilities */ set_sys_caps_initialised();