From patchwork Thu May 24 19:09:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Langsdorf X-Patchwork-Id: 10425339 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 28F5F602D8 for ; Thu, 24 May 2018 19:10:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AB0A29619 for ; Thu, 24 May 2018 19:10:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F11C729667; Thu, 24 May 2018 19:10:18 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 5C53929619 for ; Thu, 24 May 2018 19:10: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:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fsIsg5VKK834+rYOGh/ARZHA9DE1CpRDOzlcTUI+gg8=; b=cvnxT714Ast/6p j4eJyyvsGRKZkoX5ZFfFE9xnRKrmxAEL7YuHtbCU3UubVVcs8zYKDflMYFGJYz4aFdMT0v8XKKaAg Kp9bKhdEQ2G4rAP+dLAfqXluRU6MORMBD9S0/X+q+bmhsbzEuSAXZOsYbT2ZmHidsYNJwJyLx3nHe zyn2zXDXptbdK5QITs26dDc5WsgVFgWD/A9CHhdyiDYmTb4tH08y83Y7rjYT/ljXxhrM727HkrxjM fW/OEDed212Zd1s9ogP4+3Ss4AX0TBdhEtygbV3wumAmHKo2wH1/PtoM8pGStBfTwy/vn8hEZT/uq jywwyi1ivk4nY6ZtpsQQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLvcm-0003Uq-Ud; Thu, 24 May 2018 19:10:08 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLvck-0003GR-VW for linux-arm-kernel@bombadil.infradead.org; Thu, 24 May 2018 19:10:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:To:From:Sender:Reply-To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=JbIQ8JL2yexzFABRmg/lDFEKLEOg8OBNpG4U0601OME=; b=i0CCfGG76pXsNArOvN1udvPIZ kF9Z3cREWNMLXNW4lJXY1f2MZd7ULA5/v+mw+eGiFoSG97Ofy5bXTBowwK+P6SPXZXHGGHE4S8tic m7DrPdnS+XytQlGRsghMDY54vwnBjTJzwPGNBG2fBAG+RB9N7HmroDCrwRCI2sE24rhU0/ZfrMGej I8tHFteRbb4kLpPvLyz3Gx2QBP9cIT6H+A9JeGkdEDRXf5C0YSzJNvvaZUbau/bM++tYchnsUui8E 4hXO6TTZRXbrTaw3ghaPct0Q0owpTO1Sz1cvDlsqTNrFLZJbfygjSlDys4x7WYHlJxHIPYj4fxve+ PYvS0dpRw==; Received: from mx1.redhat.com ([209.132.183.28]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLvch-0004D4-Ri for linux-arm-kernel@lists.infradead.org; Thu, 24 May 2018 19:10:04 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 79B2EA1E6E for ; Thu, 24 May 2018 19:09:36 +0000 (UTC) Received: from redhatnow.redhat.com (ovpn-116-144.phx2.redhat.com [10.3.116.144]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3771767659 for ; Thu, 24 May 2018 19:09:36 +0000 (UTC) From: Mark Langsdorf To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/4] arm64: capabilities: add nopti command line argument Date: Thu, 24 May 2018 14:09:29 -0500 Message-Id: <20180524190932.32118-2-mlangsdo@redhat.com> In-Reply-To: <20180524190932.32118-1-mlangsdo@redhat.com> References: <20180524190932.32118-1-mlangsdo@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 24 May 2018 19:09:36 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180524_151003_985267_88B67E10 X-CRM114-Status: GOOD ( 18.12 ) 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: , 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 The x86 kernel and the documentation use 'nopti' as the kernel command line argument to disable kernel page table isolation, so add nopti to the arm64 kernel for compatibility. Signed-off-by: Mark Langsdorf --- Documentation/admin-guide/kernel-parameters.txt | 6 +++--- arch/arm64/kernel/cpufeature.c | 11 ++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index f2040d4..a987725 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -3342,8 +3342,8 @@ pt. [PARIDE] See Documentation/blockdev/paride.txt. - pti= [X86_64] Control Page Table Isolation of user and - kernel address spaces. Disabling this feature + pti= [X86_64, ARM64] Control Page Table Isolation of user + and kernel address spaces. Disabling this feature removes hardening, but improves performance of system calls and interrupts. @@ -3354,7 +3354,7 @@ Not specifying this option is equivalent to pti=auto. - nopti [X86_64] + nopti [X86_64, ARM64] Equivalent to pti=off pty.legacy_count= diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 9d1b06d..7c5d8712 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -934,10 +934,19 @@ static int __init parse_kpti(char *str) if (ret) return ret; - __kpti_forced = enabled ? 1 : -1; + if (!__kpti_forced) + __kpti_forced = enabled ? 1 : -1; return 0; } __setup("kpti=", parse_kpti); + +/* for compatibility with documentation and x86 nopti command line arg */ +static int __init force_nokpti(char *arg) +{ + __kpti_forced = -1; + return 0; +} +early_param("nopti", force_nokpti); #endif /* CONFIG_UNMAP_KERNEL_AT_EL0 */ #ifdef CONFIG_ARM64_HW_AFDBM