Received: by 10.223.185.116 with SMTP id b49csp3209842wrg; Mon, 5 Mar 2018 16:36:31 -0800 (PST) X-Google-Smtp-Source: AG47ELvMce4o1G9fGnwcKPIotpVa5pLZYRSQbnkNM8SXIgl/18EVyrOU9zkcK9GRKJ18mhCoGxAB X-Received: by 2002:a17:902:9898:: with SMTP id s24-v6mr14660219plp.382.1520296591646; Mon, 05 Mar 2018 16:36:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520296591; cv=none; d=google.com; s=arc-20160816; b=gmMA4AYJA3Dkf2Ow18Iu3u9r+aJvVfwBq0j8dp+nANZjAMNJkC5hNu5ev7vlugu1cQ E3fMD2hDxgyHMhpKinOycQIrnZjZU8y19QyvZJBtb7D3ExJkhcBw+g3ncg/6m7/BD2TV /XarKftaN8TbgO4hYztyLxk1WJ/NlJ9v+u/TlWT3dBPaP4q6zGNsNXBrFh4LebDJDyVq o3fIO6QmfeuqxDo2p2jjbwe1sKAGR30wW3VOkltJzn7JVMxymdm2AupuqKGgtzz/nYHR ydPivCTSo4GouNYhdqpgg0vXAMdtnRseT1rOSYcx0zR8ZY/BGnYLiuTdSPfSbgVVrqp8 N47w== 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=qNwpxnvqF5sfCd/CGo2ZPpRl567XksepB4GVvtBL48k=; b=rQ35pwqQ5YjOwsydBUlYcdeqto6PiVkErlninKFpqdttIkMAPvAoY2SoVhc/RB97rO YRsgU5dL2VRLOw76Nr5gpSppnXxK2JzntfOMRnQ5C2S9EgQLKWs1dT90tzCzvRDq6cua V91xi9DzLWxOhxF2Lw7UtkDztaHYYE326MJZl9BFy6/B1JTpvrS4z5gkvCde3w+FN0Md Eg5cwqX6Two7MugEdfMiQUn65Oz0QHvcJGKA0yiNreMB2HO3W26G4YJ26HeGdG5HHamZ Epr7cYnHa0ovqBYb9kihCtr0FhXmRr9RQTjEe6NHW+cd8frCn7mfhz/cTJSrbPTo76bY aaew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=fK9nrhRi; 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 l7-v6si10190483pls.331.2018.03.05.16.36.17; Mon, 05 Mar 2018 16:36:31 -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=fK9nrhRi; 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 S933545AbeCFAeV (ORCPT + 99 others); Mon, 5 Mar 2018 19:34:21 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:42904 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933292AbeCFA0i (ORCPT ); Mon, 5 Mar 2018 19:26:38 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w260Ln5L073973; Tue, 6 Mar 2018 00:26:34 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=qNwpxnvqF5sfCd/CGo2ZPpRl567XksepB4GVvtBL48k=; b=fK9nrhRipfV5viC7E6d/RdcBg2aJto0lU3KaHO+8dndH0MtH/cDbZHsqlaRCJZMs47K+ l00kXrdwI25VQbvmp0t/82JG0563buadOB3CNptkyiUUctu4ClR6dmO5+9hcdE8DdGcV V4I9ViBxBOz9cziqxIhbD8Q4nz7MmTAZA0CvuoE7wUl8qHi8fxND2p6x4e9OQUcyuxcP fLc50Az+HBXgoqMd78qZOUOgF6Jk0OitPbrwtqqvXPt5OP/GHi31gaTWoe9FM7nGnViM pGJajWI+fLWgK8BoBqyy0XKbEgVdD6KCwtvsSFZBnYhX3Cy6zTSnDtY/DyJHnvO3SLH6 HQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2ghe5xgf0t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Mar 2018 00:26:34 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w260QXlK025872 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Mar 2018 00:26:33 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 w260QXF5000365; Tue, 6 Mar 2018 00:26:33 GMT Received: from localhost.localdomain (/98.216.35.41) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 05 Mar 2018 16:26:33 -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 39/65] kaiser: name that 0x1000 KAISER_SHADOW_PGD_OFFSET Date: Mon, 5 Mar 2018 19:25:12 -0500 Message-Id: <20180306002538.1761-40-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=711 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803060003 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hugh Dickins There's a 0x1000 in various places, which looks better with a name. Signed-off-by: Hugh Dickins Acked-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman (cherry picked from commit aeda21d77e22fb382c51fd3f6bbb18df69bc032f) Signed-off-by: Pavel Tatashin Conflicts: arch/x86/entry/entry_64.S (not in this tree) arch/x86/kernel/entry_64.S (patched instead of that) --- arch/x86/include/asm/kaiser.h | 7 +++++-- arch/x86/kernel/entry_64.S | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/kaiser.h b/arch/x86/include/asm/kaiser.h index 7394ba9f9951..051acf678cda 100644 --- a/arch/x86/include/asm/kaiser.h +++ b/arch/x86/include/asm/kaiser.h @@ -13,13 +13,16 @@ * A minimalistic kernel mapping holds the parts needed to be mapped in user * mode, such as the entry/exit functions of the user space, or the stacks. */ + +#define KAISER_SHADOW_PGD_OFFSET 0x1000 + #ifdef __ASSEMBLY__ #ifdef CONFIG_KAISER .macro _SWITCH_TO_KERNEL_CR3 reg movq %cr3, \reg #ifdef CONFIG_KAISER_REAL_SWITCH -andq $(~0x1000), \reg +andq $(~KAISER_SHADOW_PGD_OFFSET), \reg #endif movq \reg, %cr3 .endm @@ -27,7 +30,7 @@ movq \reg, %cr3 .macro _SWITCH_TO_USER_CR3 reg movq %cr3, \reg #ifdef CONFIG_KAISER_REAL_SWITCH -orq $(0x1000), \reg +orq $(KAISER_SHADOW_PGD_OFFSET), \reg #endif movq \reg, %cr3 .endm diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 8e4056d4b1d6..5c6c11d9d779 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S @@ -1542,7 +1542,7 @@ ENTRY(nmi) movq %cr3, %rax pushq %rax #ifdef CONFIG_KAISER_REAL_SWITCH - andq $(~0x1000), %rax + andq $(~KAISER_SHADOW_PGD_OFFSET), %rax #endif movq %rax, %cr3 #endif @@ -1780,7 +1780,7 @@ end_repeat_nmi: movq %cr3, %rax pushq %rax #ifdef CONFIG_KAISER_REAL_SWITCH - andq $(~0x1000), %rax + andq $(~KAISER_SHADOW_PGD_OFFSET), %rax #endif movq %rax, %cr3 #endif -- 2.16.2