From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F9CEC54E8B for ; Tue, 12 May 2020 10:39:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 61728206DD for ; Tue, 12 May 2020 10:39:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GLz3GeG5"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="E5CJxnHJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 61728206DD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SpmBjhR6mDEdWi1ef1/HHTYiaSqClKlz6zMtX4/9XRM=; b=GLz3GeG53Zs87J yfi/oVjR7IkWoXSToZLxI2JxqQybuLxirL3rAgIMLaYtER/2eecNoE4e4UdgUhqu9ClVQgz6iHbe5 AXjcIbgIIxLmGKBB7DS2dZfv92d+61OyfCND4mvaEdQT10oM6t5+dvY9HDC8z8xDaVyRLopMqro8D T6NWeEmAVrP2YOTAQnvJL0aB3/YkjKJhPwoYyJgFhYpeoSyLaz8K9ILEyX1KIE7Ry0r+O3a0jjgjr oMd7M1BldLPZk1NMLtOYyylou1OXeJFCoHvDXFkinyCLAEyGFzLW7UNAiMbIsu/YNvUxKHQIp3KOB 2qwRd5Qs0Kebv7OVZnOA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYSJh-0008EG-1V; Tue, 12 May 2020 10:39:17 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYSJe-0008Ds-8P for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 10:39:15 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CE334206DD; Tue, 12 May 2020 10:39:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589279953; bh=67Q9fnQD3iRgc2Hqw38NJ/V+neTBan8Gtp9IuNhAMeE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E5CJxnHJkH9rwGNsGTJ9jRYQHcFVjBm2Ox+5C68XCwaWgqBTqjE5Ui5VSN2mj7mHc n642XAw2Y2CkHThua18kYkakLdLI/kiTm/wEc8dvTVd8VvtPmqB+llSLYhKAiTkh2u K8kEwKal873f3DEnSn3tbYE0LsrlY7zhMp4Af8+o= Date: Tue, 12 May 2020 11:39:09 +0100 From: Will Deacon To: Mark Brown Subject: Re: [PATCH] arm64: bti: Fix support for userspace only BTI Message-ID: <20200512103908.GB3021@willie-the-truck> References: <20200512092155.56931-1-broonie@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200512092155.56931-1-broonie@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_033914_316066_3FB1A63C X-CRM114-Status: GOOD ( 15.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 12, 2020 at 10:21:55AM +0100, Mark Brown wrote: > When setting PTE_MAYBE_GP we check system_supports_bti() but this is > true for systems where only CONFIG_BTI is set causing us to enable BTI > on some kernel text. Add an extra check for the kernel mode option, > using an ifdef due to line length. > > Fixes: c8027285e366 (arm64: Set GP bit in kernel page tables to enable BTI for the kernel) > Signed-off-by: Mark Brown > --- > arch/arm64/include/asm/pgtable-prot.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/include/asm/pgtable-prot.h > index 310690332896..3f07a044bdfb 100644 > --- a/arch/arm64/include/asm/pgtable-prot.h > +++ b/arch/arm64/include/asm/pgtable-prot.h > @@ -32,7 +32,11 @@ extern bool arm64_use_ng_mappings; > #define PTE_MAYBE_NG (arm64_use_ng_mappings ? PTE_NG : 0) > #define PMD_MAYBE_NG (arm64_use_ng_mappings ? PMD_SECT_NG : 0) > Might be worth a comment here in case somebody tries to "clean this up" later on! > +#ifdef CONFIG_ARM64_BTI_KERNEL > #define PTE_MAYBE_GP (system_supports_bti() ? PTE_GP : 0) > +#else > +#define PTE_MAYBE_GP 0 > +#endif I also notice we have a funny check in the vdso code: if (IS_ENABLED(CONFIG_ARM64_BTI_KERNEL) && system_supports_bti()) but why do we care about CONFIG_ARM64_BTI_KERNEL for the vdso pages? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel