Received: by 10.223.185.116 with SMTP id b49csp551161wrg; Wed, 14 Feb 2018 03:20:55 -0800 (PST) X-Google-Smtp-Source: AH8x226xNjsxiZ88uJz0xsc+dcrvp7WG7FCGiS3gpDufS5IpwevjgQdQs8U1yrrKkbQ0L4q4y0yy X-Received: by 10.98.144.87 with SMTP id a84mr4398164pfe.96.1518607255416; Wed, 14 Feb 2018 03:20:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518607255; cv=none; d=google.com; s=arc-20160816; b=KxXwUlngA48XK9wwKK+lBx6Z9VpVpKX1xBKHmD4uPL0UEj8zeEHe+fErv2JYyaVbXn 2VQ1oNFC9VtHfPUxhEZYNjHacK02WDSEuzkowTEjzjQTVx/3KMIJwzm9loLukVOrsPuG y/cDib6y7F8gU5gtgCy3iPvfnesmbkTY4e0O/heAdBZAmFw6ADXoKYKWOuNpDNWevnQv H2v8eiYOaar6ni6215wrEEXUXC2qpjCfSs78IPBdPYbopQ33IZWN7xWW9D6VABFjnbSz 21CpN29Hk0V9VZKxrrXohchfHg+UDx7gWn/6D6pHmLPejagEiPFq+X58uPZCYOZGdiS0 TdcA== 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:cc:to:from:arc-authentication-results; bh=5l+8w90qMcC3oWT4XoZLqA/o4qklgK2K72fuz/4ZLKs=; b=loPO2Ujc8j2aFEAuz220qOr+u2neUbOcG97jCB/QPeunAJDoUAx/2YZSXBtyqqf9cS ABJQLKW3hcuX5EovclZnTU4F7+GTQwfCp+yq8axteD5nFFg/xXUdN1lFZgdbFUru3byh /XIKX5F88EmobZwuaLuDQjQQEvMYL7F8Zi61OMsqeQSxFbmtAZb+rESyGlTnnTr82Cor xTFgLFOwdzZWs3zr1dBEYGvc8kKtXF4FKC1ooRHoi8CwoA4mSMyy3ZkqJCX4U8l5Zw+U 5urG3mnlr11N/J/BAZ77QrYKAnAJP3xiE31UH+qqrc9pzVX9PXi9iUzQSWhTLL/poGhc FNHA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si961745pgp.663.2018.02.14.03.20.40; Wed, 14 Feb 2018 03:20:55 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967428AbeBNLTJ (ORCPT + 99 others); Wed, 14 Feb 2018 06:19:09 -0500 Received: from mga02.intel.com ([134.134.136.20]:5270 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967376AbeBNLRN (ORCPT ); Wed, 14 Feb 2018 06:17:13 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2018 03:17:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,512,1511856000"; d="scan'208";a="34604551" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 14 Feb 2018 03:17:09 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id 53C4AC5; Wed, 14 Feb 2018 13:17:08 +0200 (EET) From: "Kirill A. Shutemov" To: Ingo Molnar , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" Cc: Linus Torvalds , Andy Lutomirski , Borislav Petkov , Andi Kleen , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCH 1/9] x86/mm/64: Make __PHYSICAL_MASK_SHIFT always 52 Date: Wed, 14 Feb 2018 14:16:48 +0300 Message-Id: <20180214111656.88514-2-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180214111656.88514-1-kirill.shutemov@linux.intel.com> References: <20180214111656.88514-1-kirill.shutemov@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __PHYSICAL_MASK_SHIFT is used to define the mask that helps to extract physical address from a page table entry. Although, real physical address space available may differ between machines, it's safe to use 52 as __PHYSICAL_MASK_SHIFT. Unused bits above log2(MAXPHYADDR) up to bit 51 are reserved and must be 0. Signed-off-by: Kirill A. Shutemov --- arch/x86/include/asm/page_64_types.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h index e1407312c412..f68e6526891d 100644 --- a/arch/x86/include/asm/page_64_types.h +++ b/arch/x86/include/asm/page_64_types.h @@ -52,11 +52,12 @@ #define __START_KERNEL_map _AC(0xffffffff80000000, UL) /* See Documentation/x86/x86_64/mm.txt for a description of the memory map. */ -#ifdef CONFIG_X86_5LEVEL + #define __PHYSICAL_MASK_SHIFT 52 + +#ifdef CONFIG_X86_5LEVEL #define __VIRTUAL_MASK_SHIFT 56 #else -#define __PHYSICAL_MASK_SHIFT 46 #define __VIRTUAL_MASK_SHIFT 47 #endif -- 2.15.1