From patchwork Wed Jun 22 16:22:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A . Shutemov" X-Patchwork-Id: 12891138 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D730ACCA481 for ; Wed, 22 Jun 2022 16:23:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 095B88E00AB; Wed, 22 Jun 2022 12:23:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F3E438E00C7; Wed, 22 Jun 2022 12:23:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C80DB8E00AB; Wed, 22 Jun 2022 12:23:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id B35218E00C5 for ; Wed, 22 Jun 2022 12:23:07 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 72DE9120174 for ; Wed, 22 Jun 2022 16:23:07 +0000 (UTC) X-FDA: 79606391214.23.7C8092E Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by imf23.hostedemail.com (Postfix) with ESMTP id E06C1140029 for ; Wed, 22 Jun 2022 16:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655914979; x=1687450979; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eoYteC6GODz7y0R2zobgy/O4IaLSlJbZw9u65ssKePw=; b=NAB/UQecPy+7fNQHZL+GKvQwcwd9uaP52QiJh4SP9XpoB2yZLc2hl0eK QXROGPoOIZz9tdIhZeWA+4pCn/IucQKeulvRFqNjbgVMozoVWFKAUU4xK s22y4ipHZGDtZJCCEw1ZTNJyfglPFe0+EFhIIUc63b6lR1jR9+6UYiyl9 FTWJUUl9osWKkdnF+UuT8KEVEXpebUEIkh3e4Isko4uwf99cofsuF+OFi A/B7pcygKIS37jh0PFjmp9/md8q1oD4CYZgQR3ewyl+mZq+zyJbEL8Dbk 0jL6jKlTTvpRImnpQARFAk1uFd83n+fob4o1sCIyL/1gAbLs/ISrAdAAE A==; X-IronPort-AV: E=McAfee;i="6400,9594,10386"; a="269187826" X-IronPort-AV: E=Sophos;i="5.92,212,1650956400"; d="scan'208";a="269187826" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2022 09:22:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,212,1650956400"; d="scan'208";a="677632041" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 22 Jun 2022 09:22:38 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 28B0E67; Wed, 22 Jun 2022 19:22:43 +0300 (EEST) From: "Kirill A. Shutemov" To: Dave Hansen , Andy Lutomirski , Peter Zijlstra Cc: x86@kernel.org, Kostya Serebryany , Andrey Ryabinin , Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , "H . J . Lu" , Andi Kleen , Rick Edgecombe , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCHv4 1/8] x86/mm: Fix CR3_ADDR_MASK Date: Wed, 22 Jun 2022 19:22:23 +0300 Message-Id: <20220622162230.83474-2-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220622162230.83474-1-kirill.shutemov@linux.intel.com> References: <20220622162230.83474-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 X-Stat-Signature: 4acwzrn6zxm7ewuz5nkujd6p8kh5mxbz X-Rspamd-Queue-Id: E06C1140029 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="NAB/UQec"; dmarc=pass (policy=none) header.from=intel.com; spf=temperror (imf23.hostedemail.com: error in processing during lookup of kirill.shutemov@linux.intel.com: DNS error) smtp.mailfrom=kirill.shutemov@linux.intel.com X-Rspamd-Server: rspam02 X-Rspam-User: X-HE-Tag: 1655914978-169677 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Reviewed-by: Rick Edgecombe --- 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)