Received: by 10.223.185.116 with SMTP id b49csp3203951wrg; Mon, 5 Mar 2018 16:29:01 -0800 (PST) X-Google-Smtp-Source: AG47ELumpK9WeRXGkDqWLzfXz9dbUJg/YwK8WZBQBCbf3O8OfPkYRyiNyIw4y1fqel2Um0GpMdbh X-Received: by 10.98.242.65 with SMTP id y1mr16721624pfl.232.1520296141075; Mon, 05 Mar 2018 16:29:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520296141; cv=none; d=google.com; s=arc-20160816; b=YHHD40upfOHG1i+nW1UoLocg+WKmJby6tPO8UPhMDPNPQW4YBTNGsfg4ZevR2mdcfl 3aUMgIl+sh9ISMn2kHHWedane/1KAcxoIO8pqcHfq74FFFrvZAlDs7iWCABAiv1TZuTh dynZoPaxkBQakxzALG4WX2fHWLb6D04S93vUPIdUiLJUxPOQptw1mTTBmO7mjZJTRt9b cud3IWTEqRfBLAMHeF1yFmJCuiTm5S1RW8nHeclHaUGNkWkxSNMm5VlucqaKa3bbM+pF qJD9V/8s0BQsFuD2ifQFWFNrFMnGutkCx0PQDeclVtAAm9QWoJL2JW7vEOAXHgRptcih tCxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:arc-authentication-results; bh=OaewJI8g4MfwOTnpM+ky4nONLp2IO1IGdaVjpMkiSDo=; b=RrlDyAanqYS44X2kEJy4LmXSqosJ3dMmmPZzKvkjkd4REfVBq4y0gWU01Yna6y9ESZ 8RFmGL1zIeHMjQP3kuoA423vYFd4IvLs6Okbpc+VtSUGaElq9NTBgHUa0D0+BksfdZ+S iFVRoMvpaTmemM8tt6fvqr2cm8Uup9JS/fC1cjY+fQKa6RIJPzTzwPSJkHQYExMCsTIu vah9DvnU+ogoYRbkC5ukLoWbGixRfhn55g7abOMzzvExZloedtOm0ApOenmxaKbeJA90 ydi1GSP7nuCRsDvbSgWxnF2Eym/PWH6gbsRsffQ+d9yv4tK7ORgu8L5brEOUSTnNUbCC hnyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=Z6SV7Y8V; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si11120177pfl.224.2018.03.05.16.28.47; Mon, 05 Mar 2018 16:29:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=Z6SV7Y8V; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933622AbeCFA1d (ORCPT + 99 others); Mon, 5 Mar 2018 19:27:33 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:56704 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933544AbeCFA1A (ORCPT ); Mon, 5 Mar 2018 19:27:00 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w260Qvkb038141; Tue, 6 Mar 2018 00:26:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=OaewJI8g4MfwOTnpM+ky4nONLp2IO1IGdaVjpMkiSDo=; b=Z6SV7Y8VYFlfkpARzmzz9nz8Sg/l3yS6vLGPRfU4RBk2L9Mb+GcLub1pk81k8Q8oLd4u rl3fHKRuSQeIymcTz8klYp6BdvLMdeCN4xflMrsXhpq3gsjVFG5l8OpKFDqUA5JPE/by /qeyQTrbk7/d5SgXIxzCDtUosc5b483i8yVIYpyGocDZXA5Q1O4sEdwAgFGSCfXe2LND UlMFuYvKHHc1ByaGcUzgZ5Cmnv0pZXXk5ycBbweeU0Bs4qWVNp72N2in/7I7e9wTUcGn wHgx5ab3iIelhntJ4uA+a12xf+p1+x0tPmvb67JyAkOTRc9pXflhRVGyYOwjlnrc3rVr Fg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2ghe3kgg4y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Mar 2018 00:26:57 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w260QuSC031576 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Mar 2018 00:26:56 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w260Qu2s000639; Tue, 6 Mar 2018 00:26:56 GMT Received: from localhost.localdomain (/98.216.35.41) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 05 Mar 2018 16:26:56 -0800 From: Pavel Tatashin To: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux-kernel@vger.kernel.org, Alexander.Levin@microsoft.com, dan.j.williams@intel.com, sathyanarayanan.kuppuswamy@intel.com, pankaj.laxminarayan.bharadiya@intel.com, akuster@mvista.com, cminyard@mvista.com, pasha.tatashin@oracle.com, gregkh@linuxfoundation.org, stable@vger.kernel.org Subject: [PATCH 4.1 64/65] pti: Rename X86_FEATURE_KAISER to X86_FEATURE_PTI Date: Mon, 5 Mar 2018 19:25:37 -0500 Message-Id: <20180306002538.1761-65-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180306002538.1761-1-pasha.tatashin@oracle.com> References: <20180306002538.1761-1-pasha.tatashin@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8823 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=852 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803060005 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org cat /proc/cpuinfo still shows kaiser feature, and want only pti to be visible to users. Therefore, rename this macro to get correct user visible output. Signed-off-by: Pavel Tatashin Signed-off-by: Brian Maly --- arch/x86/include/asm/cpufeature.h | 2 +- arch/x86/include/asm/kaiser.h | 6 +++--- arch/x86/kernel/entry_64.S | 12 ++++++------ arch/x86/mm/kaiser.c | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index a22aa8c5903c..fc790e2f0d4e 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h @@ -202,7 +202,7 @@ #define X86_FEATURE_KAISER ( 7*32+31) /* CONFIG_KAISER w/o nokaiser */ /* Because the ALTERNATIVE scheme is for members of the X86_FEATURE club... */ -#define X86_FEATURE_KAISER ( 7*32+31) /* CONFIG_PAGE_TABLE_ISOLATION w/o nokaiser */ +#define X86_FEATURE_PTI ( 7*32+31) /* CONFIG_PAGE_TABLE_ISOLATION w/o nopti */ /* Virtualization flags: Linux defined, word 8 */ #define X86_FEATURE_TPR_SHADOW ( 8*32+ 0) /* Intel TPR Shadow */ diff --git a/arch/x86/include/asm/kaiser.h b/arch/x86/include/asm/kaiser.h index 802bbbdfe143..5d85ddf26166 100644 --- a/arch/x86/include/asm/kaiser.h +++ b/arch/x86/include/asm/kaiser.h @@ -47,14 +47,14 @@ movq \reg, %cr3 .endm .macro SWITCH_KERNEL_CR3 -ALTERNATIVE "jmp 8f", "pushq %rax", X86_FEATURE_KAISER +ALTERNATIVE "jmp 8f", "pushq %rax", X86_FEATURE_PTI _SWITCH_TO_KERNEL_CR3 %rax popq %rax 8: .endm .macro SWITCH_USER_CR3 -ALTERNATIVE "jmp 8f", "pushq %rax", X86_FEATURE_KAISER +ALTERNATIVE "jmp 8f", "pushq %rax", X86_FEATURE_PTI _SWITCH_TO_USER_CR3 %rax %al popq %rax 8: @@ -63,7 +63,7 @@ popq %rax .macro SWITCH_KERNEL_CR3_NO_STACK ALTERNATIVE "jmp 8f", \ __stringify(movq %rax, PER_CPU_VAR(unsafe_stack_register_backup)), \ - X86_FEATURE_KAISER + X86_FEATURE_PTI _SWITCH_TO_KERNEL_CR3 %rax movq PER_CPU_VAR(unsafe_stack_register_backup), %rax 8: diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 95b57f4393b7..204dfb58c9f0 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S @@ -1327,7 +1327,7 @@ ENTRY(paranoid_entry) * unconditionally, but we need to find out whether the reverse * should be done on return (conveyed to paranoid_exit in %ebx). */ - ALTERNATIVE "jmp 2f", "movq %cr3, %rax", X86_FEATURE_KAISER + ALTERNATIVE "jmp 2f", "movq %cr3, %rax", X86_FEATURE_PTI testl $KAISER_SHADOW_PGD_OFFSET, %eax jz 2f orl $2, %ebx @@ -1361,7 +1361,7 @@ ENTRY(paranoid_exit) TRACE_IRQS_OFF_DEBUG TRACE_IRQS_IRETQ_DEBUG #ifdef CONFIG_PAGE_TABLE_ISOLATION - /* No ALTERNATIVE for X86_FEATURE_KAISER: paranoid_entry sets %ebx */ + /* No ALTERNATIVE for X86_FEATURE_PTI: paranoid_entry sets %ebx */ testl $2, %ebx /* SWITCH_USER_CR3 needed? */ jz paranoid_exit_no_switch SWITCH_USER_CR3 @@ -1567,7 +1567,7 @@ ENTRY(nmi) #ifdef CONFIG_PAGE_TABLE_ISOLATION /* Unconditionally use kernel CR3 for do_nmi() */ /* %rax is saved above, so OK to clobber here */ - ALTERNATIVE "jmp 2f", "movq %cr3, %rax", X86_FEATURE_KAISER + ALTERNATIVE "jmp 2f", "movq %cr3, %rax", X86_FEATURE_PTI /* If PCID enabled, NOFLUSH now and NOFLUSH on return */ ALTERNATIVE "", "bts $63, %rax", X86_FEATURE_PCID pushq %rax @@ -1583,7 +1583,7 @@ ENTRY(nmi) * kernel code that needs user CR3, but do we ever return * to "user mode" where we need the kernel CR3? */ - ALTERNATIVE "", "popq %rax; movq %rax, %cr3", X86_FEATURE_KAISER + ALTERNATIVE "", "popq %rax; movq %rax, %cr3", X86_FEATURE_PTI #endif /* * Return back to user mode. We must *not* do the normal exit @@ -1806,7 +1806,7 @@ end_repeat_nmi: #ifdef CONFIG_PAGE_TABLE_ISOLATION /* Unconditionally use kernel CR3 for do_nmi() */ /* %rax is saved above, so OK to clobber here */ - ALTERNATIVE "jmp 2f", "movq %cr3, %rax", X86_FEATURE_KAISER + ALTERNATIVE "jmp 2f", "movq %cr3, %rax", X86_FEATURE_PTI /* If PCID enabled, NOFLUSH now and NOFLUSH on return */ ALTERNATIVE "", "bts $63, %rax", X86_FEATURE_PCID pushq %rax @@ -1825,7 +1825,7 @@ end_repeat_nmi: * kernel code that needs user CR3, like just just before * a sysret. */ - ALTERNATIVE "", "popq %rax; movq %rax, %cr3", X86_FEATURE_KAISER + ALTERNATIVE "", "popq %rax; movq %rax, %cr3", X86_FEATURE_PTI #endif testl %ebx,%ebx /* swapgs needed? */ diff --git a/arch/x86/mm/kaiser.c b/arch/x86/mm/kaiser.c index 05fb616c9e2a..e37ac77e6cb6 100644 --- a/arch/x86/mm/kaiser.c +++ b/arch/x86/mm/kaiser.c @@ -289,14 +289,14 @@ skip: enable: if (enable) - setup_force_cpu_cap(X86_FEATURE_KAISER); + setup_force_cpu_cap(X86_FEATURE_PTI); return; disable: pr_info("Kernel/User page tables isolation: disabled\n"); kaiser_enabled = 0; - setup_clear_cpu_cap(X86_FEATURE_KAISER); + setup_clear_cpu_cap(X86_FEATURE_PTI); } /* -- 2.16.2