Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2307549pxb; Fri, 5 Feb 2021 14:34:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZyH3XY8Mu8js36nHJaBVzncwjEF1oqJEM24SWSq3nbZtivbuZBR3+Sw4uI2dDBt0cqvCS X-Received: by 2002:a17:906:4eda:: with SMTP id i26mr5902606ejv.467.1612564467632; Fri, 05 Feb 2021 14:34:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612564467; cv=none; d=google.com; s=arc-20160816; b=o2xjXZrQMB5serAgAI5pVRriOLqUydgiZk2J9Fga4mRnoBfL2qZV3vshyC2Cw4SXjI 3O45p7gXvLGMJvYS+QZzyz+aQ0Dp9ZUs8YxWrvWxpQtfTLTuREBBCU/itgalIV+wBLHy MzRh5W1tU+F2zja8HOTIfVHzdAHJqORVzMw1KJDziTgtOVgx1gsryuqbfhLR9SIN+NFp kjSlP3tg9lKOIcY7znoETgU5WEIzFOgf+nq+0K2OTLKiIkdoRR9KFam/q/zwUhZ0+r/M iioUm1yjG24iTE313w9gHCcQ3NUZN3Xvgee92ErfF+kz1tn6mC1akPhWwY+UNpo51DnT SX0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=gb4anlbblKf//YuCGkxAmsEKClU77uxinLOH9MELi0Q=; b=CLw8qeg+B5fJSpqfSCCryFrl0JjV/AryQ2B5+zY1vJkNtx2U2XVFlqN4wiY6H4iDvD +Fa3Igxk0gcSsJIX0+b8BnV9FyTN/jRSGIfs8RhkbzxFN7Rw36vmxxUJUG8rnhRIpCm/ Pfli2kcENGnorlcxGYAtDBCWyNfihf+/9UKiADf/ODxJOoDvflgWvhGSHKPzxoH6qrYg Z/qrmccnUZ8IINIesBxdae2naYQwnILDst6PWkV6FOg6AuNkXps/9nzs5lExYC0AXPEy 31iQakwVZmqUyngmrEfm7VRuiE6RckRuEoy69OuRIgXMW5l/9D35emQsPLhyPaMDGxVw Qsig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b14si2771577edy.511.2021.02.05.14.34.02; Fri, 05 Feb 2021 14:34:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232743AbhBEWcU (ORCPT + 99 others); Fri, 5 Feb 2021 17:32:20 -0500 Received: from mga18.intel.com ([134.134.136.126]:49466 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232971AbhBEO5n (ORCPT ); Fri, 5 Feb 2021 09:57:43 -0500 IronPort-SDR: gazYxd2UzSU0aQte6yOwTofiVFSTK7ffYGwqtLdyXX9GVv6yJxmxcveaE+Sss60YnDA85i+NXf aJFPx5oM/A9w== X-IronPort-AV: E=McAfee;i="6000,8403,9885"; a="169120206" X-IronPort-AV: E=Sophos;i="5.81,155,1610438400"; d="scan'208";a="169120206" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2021 07:16:44 -0800 IronPort-SDR: S6C8/MN991fMIKme9SySesQAZ7K5GvPlTylS3wOHj8LgHkiMMj/W8DXQA5DJDhPgtS5X0f/EGd F2pA6br7P9pQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,155,1610438400"; d="scan'208";a="416226114" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 05 Feb 2021 07:16:41 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id BFA36236; Fri, 5 Feb 2021 17:16:40 +0200 (EET) From: "Kirill A. Shutemov" To: Dave Hansen , Andy Lutomirski , Peter Zijlstra Cc: x86@kernel.org, Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Catalin Marinas , Will Deacon , "H . J . Lu" , Andi Kleen , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [RFC 2/9] x86/mm: Fix CR3_ADDR_MASK Date: Fri, 5 Feb 2021 18:16:23 +0300 Message-Id: <20210205151631.43511-4-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205151631.43511-1-kirill.shutemov@linux.intel.com> References: <20210205151631.43511-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The mask must not include bits above physical address mask. These bits are reserved and can be used for other things. Bits 61 and 62 are used for Linear Address Masking. Signed-off-by: Kirill A. Shutemov --- arch/x86/include/asm/processor-flags.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/processor-flags.h b/arch/x86/include/asm/processor-flags.h index 02c2cbda4a74..a7f3d9100adb 100644 --- a/arch/x86/include/asm/processor-flags.h +++ b/arch/x86/include/asm/processor-flags.h @@ -35,7 +35,7 @@ */ #ifdef CONFIG_X86_64 /* Mask off the address space ID and SME encryption bits. */ -#define CR3_ADDR_MASK __sme_clr(0x7FFFFFFFFFFFF000ull) +#define CR3_ADDR_MASK __sme_clr(PHYSICAL_PAGE_MASK) #define CR3_PCID_MASK 0xFFFull #define CR3_NOFLUSH BIT_ULL(63) -- 2.26.2