From patchwork Thu May 31 17:08:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Langsdorf X-Patchwork-Id: 10441395 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 9D490603B5 for ; Thu, 31 May 2018 17:10:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9549628F81 for ; Thu, 31 May 2018 17:10:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8771E28F4E; Thu, 31 May 2018 17:10:45 +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 269C328F81 for ; Thu, 31 May 2018 17:10:45 +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=cSsdSZeaBjMszHIu4ys7mBCvuZ3LRCndJqSgBDDgzLM=; b=JtuAZT2GNXyH6x KYuW38pUpBBENDlHTqrgVm72wP+RavalVqhVXaEBU4sJgNIoLhFPE23NZtvVRtAy2FuIZwkMj/fhT UDTC1kxqRlT28yJkRaxkpIzMzICw5QwS5o43jJ3ojLl0olg0BKRhTAbkTrdM67luJuEv4MnCf0QJL hFaaSuLpgaydWR9cr9OyemW1f+XBAeI8axpDqBBKyOemsJ+l8CYhIw65sBdMU+zvjN3WT83iQl0Sn VLC4CyUouJfKFmeKtu4sTZ32aJvGVKsZWkxiOYqK7BYvI0a0GsFWKvi1QfdwmlSqLG3qER/073po2 zNIhSqxHrqAx6C9O5AyQ==; 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 1fOR5u-0007u9-TH; Thu, 31 May 2018 17:10:34 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOR4C-0005gu-0b for linux-arm-kernel@lists.infradead.org; Thu, 31 May 2018 17:08:51 +0000 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7FBCD30C5125 for ; Thu, 31 May 2018 17:08:36 +0000 (UTC) Received: from redhatnow.redhat.com (ovpn-116-158.phx2.redhat.com [10.3.116.158]) by smtp.corp.redhat.com (Postfix) with ESMTP id 435A91001917 for ; Thu, 31 May 2018 17:08:36 +0000 (UTC) From: Mark Langsdorf To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/2] arm64: capabilities: add nopti command line argument Date: Thu, 31 May 2018 12:08:31 -0500 Message-Id: <20180531170832.14263-2-mlangsdo@redhat.com> In-Reply-To: <20180531170832.14263-1-mlangsdo@redhat.com> References: <20180531170832.14263-1-mlangsdo@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 31 May 2018 17:08:36 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180531_100848_085665_99B48825 X-CRM114-Status: GOOD ( 16.10 ) 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 | 19 +++++++++++++++---- arch/arm64/kernel/cpufeature.c | 11 ++++++++++- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index f2040d4..cf0c728 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] Control Page Table Isolation of user + and kernel address spaces. Disabling this feature removes hardening, but improves performance of system calls and interrupts. @@ -3354,8 +3354,19 @@ Not specifying this option is equivalent to pti=auto. - nopti [X86_64] - Equivalent to pti=off + kpti= [ARM64] Control Page Table Isolation of user + and kernel address spaces. Disabling this feature + removes hardening, but improves performance of + system calls and interrupts. + + on - unconditionally enable + off - unconditionally disable + + Not specifying this option will enable kpti on all + systems that support it. + + nopti [X86_64, ARM64] + Equivalent to pti=off on X86_64 or kpti=off on ARM64 pty.legacy_count= [KNL] Number of legacy pty's. Overwrites compiled-in 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