From patchwork Tue Jan 19 16:07:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Murzin X-Patchwork-Id: 12030243 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.9 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,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 6F821C433DB for ; Tue, 19 Jan 2021 16:09:07 +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 238FB21D1B for ; Tue, 19 Jan 2021 16:09:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 238FB21D1B 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=ziK6KVYMeesAdKhgm+R4boZfPaztTDmWquZmBhEYFXo=; b=HzJmdYYh/fd1aPo98khLvDHpOq OFsTtdXiWXLdhHe9aer/qoYc9SV1+uCGRSLV0amHc3/lrXfKS9EW0bldTFQWyvrXSeFD26AkgTKcd R7UFLBPafJ9/rNkQq71QE2S8AYsldrh6rnuX+9oF+OFtam2AEkUND6amSzYDkIvdxWx6BzGXghIS1 WRLhtax5ao3q2upcNAIzmkCk0jPBux+Y4eKAFNTYo0CZhd2t4OenVDY+GflW6TP57Y3u3kQG/Bbp+ AHWU4tC03/kJANDPfbG5E3BDPGDDjQzmy98IPcjPetCRoNW3ffV+/Ot5U7zMLMmW9N0D7UxrGyV5K 8PKEQgYA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1tXp-0007xb-Jc; Tue, 19 Jan 2021 16:07:49 +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 1l1tXh-0007vP-9p for linux-arm-kernel@lists.infradead.org; Tue, 19 Jan 2021 16:07:42 +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 690DBD6E; Tue, 19 Jan 2021 08:07:33 -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 B6E0F3F66E; Tue, 19 Jan 2021 08:07:32 -0800 (PST) From: Vladimir Murzin To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 0/2] arm64: Support Enhanced PAN Date: Tue, 19 Jan 2021 16:07:21 +0000 Message-Id: <20210119160723.116983-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-20210119_110741_671818_7E0F527C X-CRM114-Status: GOOD ( 10.36 ) 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) v2 -> v3 - rebased on 5.11-rc4 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(-)