From patchwork Wed Dec 9 13:59:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Murzin X-Patchwork-Id: 11961587 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=-11.8 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_GIT 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 3EEF1C433FE for ; Wed, 9 Dec 2020 14:01:12 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 EFF1A23B31 for ; Wed, 9 Dec 2020 14:01:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EFF1A23B31 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=hAilS7AR5w3Oa/zoIrYu5TUKGMJ8BvHrSRBZtAT1o14=; b=EqDC1nNj3hFCNhwBwK3ptGb0Et NMhUW/srPbmRNETPdQo7oylHbiSHgqOn+0oE13KS5jNhC9aF2XuCRiB8AsdWBKw+xZAaZ9fY9gVx5 tMtXCA+1GR0erCDRnoqPDfBXA81Tmfuzme72NyyXwM+gTtg7+9sCwsgW/L5G//yNx9XtWHRZyEze3 ROpMdB61AsSH0eAX8mW4mhOjvzMw6plCSzO6htCY7egbg+HyD7gWeXllJ4UCVpKPU1dhX9Ifj6RDG ePWOxR5XL8ayJBtXxqPw03fCcL6UbClZII4NyAZmchm09lyyCsGlsDQ+eaJ9dUc4jbm8s8gw+CUZV rVk2sSuQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kn00I-0000RA-Ar; Wed, 09 Dec 2020 13:59:38 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kn00C-0000PV-5k for linux-arm-kernel@lists.infradead.org; Wed, 09 Dec 2020 13:59:34 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D35361FB; Wed, 9 Dec 2020 05:59:26 -0800 (PST) Received: from login2.euhpc.arm.com (login2.euhpc.arm.com [10.6.27.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2FA413F66B; Wed, 9 Dec 2020 05:59:26 -0800 (PST) From: Vladimir Murzin To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 0/2] arm64: Support Enhanced PAN Date: Wed, 9 Dec 2020 13:59:04 +0000 Message-Id: <20201209135906.39232-1-vladimir.murzin@arm.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201209_085932_308484_27D5575D X-CRM114-Status: GOOD ( 10.42 ) 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@arm.com, keescook@chromium.org, dave.martin@arm.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi ARM architecture gains support of Enhanced Privileged Access Never (EPAN) which allows Privileged Access Never to be used with Execute-only mappings. As a consequence 24cecc377463 ("arm64: Revert support for execute-only user mappings") can be revisited and re-enabled. Changelog: RFC -> v1 - removed cap check in pte_valid_not_user (per Catalin) - local_flush_tlb_all() in cpu_enable_epan() (per Catalin) - reordered with CnP (per Catalin) - s/HWCAP2_EPAN/HWCAP2_EXECONLY/ (per Catalin) v1 -> v2 - rebased on for-next/uaccess (for INIT_SCTLR_EL1_MMU_ON) - moved EPAN enable to proc.S (via INIT_SCTLR_EL1_MMU_ON), so no need in enable method from cpufeature, no need to keep ordering relative to CnP (per Catalin) Thanks! Vladimir Murzin (2): arm64: Support execute-only permissions with Enhanced PAN arm64: Introduce HWCAPS2_EXECONLY arch/arm64/Kconfig | 17 +++++++++++++++++ arch/arm64/include/asm/cpucaps.h | 3 ++- arch/arm64/include/asm/hwcap.h | 1 + arch/arm64/include/asm/pgtable-prot.h | 5 +++-- arch/arm64/include/asm/pgtable.h | 14 +++++++++++++- arch/arm64/include/asm/sysreg.h | 4 +++- arch/arm64/include/uapi/asm/hwcap.h | 1 + arch/arm64/kernel/cpufeature.c | 15 +++++++++++++++ arch/arm64/kernel/cpuinfo.c | 1 + arch/arm64/mm/fault.c | 3 +++ 10 files changed, 59 insertions(+), 5 deletions(-)