Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp815454rwb; Wed, 9 Nov 2022 08:58:41 -0800 (PST) X-Google-Smtp-Source: AMsMyM7yXsGwCzGQK+HYDQ0O8O2KVm4b9TMbrRjNUwAXNoIyVwihvcq5g8XUab8bw1PmknOeVeK/ X-Received: by 2002:a17:906:8a63:b0:7ad:95cf:726a with SMTP id hy3-20020a1709068a6300b007ad95cf726amr57985000ejc.82.1668013121104; Wed, 09 Nov 2022 08:58:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668013121; cv=none; d=google.com; s=arc-20160816; b=l1YCbgAQ226mPEgFBB9blrQUsVJyj7ijzuXiQlgBpl+YkUc3lz2awb3WfQYsDj4Nae LKhHLwLXSX3r8Fdgfgs5piQVVEVGYnw1KqkxpYWUvj0TvSPe3rLtFfUp1bf4xoIhPLaU KF+0R64qoyruMa3KSoOOtxBBm0mD+mMl+V0acAOaX7fdJZoHa2J2NzQoN+tkuLdH3Zew dJnAJWR6tWKrRuz/Py1Y29HK/w0BXrweUB4/EHm9kZCXhhmWi7AGqrtgrc4izDhAK5hP krvm6o+yBOooK92eMb/gXsqZOc4HhI20DyJMEXUqKsjppuULtvo/uCUv7NoM4GsKbzaf PgbA== 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 :dkim-signature; bh=/gQxZVfxZ0XVnQZf+76lcdkLcCWBm7/MmNe6nzWlntI=; b=Q/3PB+ys+9z9IGCDDIM5wmw3kPvqg66Opz/3rgnVB1wSczq4ANTD4UOEMruIi6kChy g2T7eb8cUZoK1Niad52NsYUGUNidnB5Ra1l+HIPAX6p9bkHhq41WbjhUsu9AaUNUH9yc 6hESVKaPWH4k6m//hxOLbczuFWSz6SSTzONaTYCHdUHayfTQRkRjQ037V/mzcyqMDl4u +Qxfl0cdtRvog+phN3FKIRY3IQpzTRgImAms2YklcxV/yesWu7z6KyqYuCVCxdMWLlY6 XBzGN75SDgTz0euj0CWP4/wewRskdAWGp5OnaRlWFgas6YvJuOw+oa4xKCmlxHJU8wGK SGsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QpTntwL+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w26-20020a170906b19a00b007a4feae7ae7si12396214ejy.575.2022.11.09.08.58.17; Wed, 09 Nov 2022 08:58:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QpTntwL+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230366AbiKIQwK (ORCPT + 92 others); Wed, 9 Nov 2022 11:52:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229835AbiKIQwJ (ORCPT ); Wed, 9 Nov 2022 11:52:09 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74D7EF5AA for ; Wed, 9 Nov 2022 08:52:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668012728; x=1699548728; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YRI2YivWJDaeR3A5b46DIJCCsip9GmvTxTmH9XsxWxQ=; b=QpTntwL+FVQNTknom4ZIYddUTiI+tOIcetkLbYYUZP8o1WhDjKJ6EkHl 5olebQlHyFG8z+P33xcJGBZPzNkUsaS5xSrxK8G/dKRqQ4auSDWaPlWB4 anPB5wUNJYXC3zy0Qlhj7avVVjhxmNU3RZLMi9CxS2olm+NGwcVZCEjJg K4j5uExCozC1hMZc3g+plmpcJtOvKLx/0o6vCGco8oGDqoBvGgQVYzU9P Vtq1Y3yhN2LvHRrU4vk1QuugtnxOYbsMFBykbjPjnRLVEWL2cD6My2e4Y 2/a4c5J3i4mllwrby5yK10iORBaI5lQ6B6+r9H+7bDVMTs9oOwGhqgVD2 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="294405263" X-IronPort-AV: E=Sophos;i="5.96,151,1665471600"; d="scan'208";a="294405263" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 08:52:07 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="700426422" X-IronPort-AV: E=Sophos;i="5.96,151,1665471600"; d="scan'208";a="700426422" Received: from dschramm-mobl.ger.corp.intel.com (HELO box.shutemov.name) ([10.251.219.85]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 08:52:03 -0800 Received: by box.shutemov.name (Postfix, from userid 1000) id 6269610946C; Wed, 9 Nov 2022 19:52:00 +0300 (+03) From: "Kirill A. Shutemov" To: Dave Hansen , Andy Lutomirski , Peter Zijlstra Cc: x86@kernel.org, Kostya Serebryany , Andrey Ryabinin , Andrey Konovalov , Alexander Potapenko , Taras Madan , Dmitry Vyukov , "H . J . Lu" , Andi Kleen , Rick Edgecombe , Bharata B Rao , Jacob Pan , Ashok Raj , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCHv12 01/16] x86/mm: Fix CR3_ADDR_MASK Date: Wed, 9 Nov 2022 19:51:25 +0300 Message-Id: <20221109165140.9137-2-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221109165140.9137-1-kirill.shutemov@linux.intel.com> References: <20221109165140.9137-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 Reviewed-by: Rick Edgecombe Reviewed-by: Alexander Potapenko Tested-by: Alexander Potapenko Acked-by: Peter Zijlstra (Intel) --- 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.38.0