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=-10.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 6114CC433C1 for ; Fri, 26 Mar 2021 11:06:39 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 05CDA61A14 for ; Fri, 26 Mar 2021 11:06:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05CDA61A14 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc: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=3Ngrao9uSkgeJ8beiAi+1t/DVQAxUNYFFcO+7EFzs8U=; b=pH4Ozyz4Q2/nnw1bFJ//w9vcU 65fD7/tJqnJ8gJvc6VfMHsEgP+EFeAtI4uURwZjg3bblFUUy91GaHHpHCSn6MQAZMdellg2EVaIBf tm0HOw7HOI2bbDo7EmZw61XybfNixCLcqGK5wMVgCzGFTSp3Dsni5iOS12aAMJfeE6qjD3MDcgwbl 0N+bxhxoBFhS0Kit6AEpBlzV5cLFyMh5/UHvHUKEeDuRRjCrmcIjKeNzQQ9jiYTbfhgC2XubdAGr/ C3HeYN+8D/YWul2TdQlGkRv1BPoTdpEzyj6H3i3n63aDB6WIBC/zVCy+TVGc9ROP/dfFTHWwhfBf+ mmPURGpog==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPkGu-003NfF-8P; Fri, 26 Mar 2021 11:04:56 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lPkGo-003Ndn-GU for linux-arm-kernel@lists.infradead.org; Fri, 26 Mar 2021 11:04:52 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1C79461A0F; Fri, 26 Mar 2021 11:04:47 +0000 (UTC) Date: Fri, 26 Mar 2021 11:04:45 +0000 From: Catalin Marinas To: Vladimir Murzin Cc: linux-arm-kernel@lists.infradead.org, keescook@chromium.org, dave.martin@arm.com, will@kernel.org Subject: Re: [PATCH v4 1/2] arm64: Support execute-only permissions with Enhanced PAN Message-ID: <20210326110444.GB5126@arm.com> References: <20210312173811.58284-1-vladimir.murzin@arm.com> <20210312173811.58284-2-vladimir.murzin@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210312173811.58284-2-vladimir.murzin@arm.com> 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-20210326_110451_108149_BFF9A182 X-CRM114-Status: UNSURE ( 8.55 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Mar 12, 2021 at 05:38:10PM +0000, Vladimir Murzin wrote: > @@ -992,6 +995,18 @@ static inline bool arch_wants_old_prefaulted_pte(void) > } > #define arch_wants_old_prefaulted_pte arch_wants_old_prefaulted_pte > > +static inline pgprot_t arch_filter_pgprot(pgprot_t prot) > +{ > + if (cpus_have_const_cap(ARM64_HAS_EPAN)) > + return prot; > + > + if (pgprot_val(prot) != pgprot_val(PAGE_EXECONLY)) > + return prot; > + > + return PAGE_READONLY_EXEC; > +} Just a thought: we could allow exec-only permissions if !system_uses_hw_pan(), though not sure it's worth it. We'd have 8.0 CPUs with exec-only then a gap up to 8.7 when we add it back in (since most kernels will turn PAN on). -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel