Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2104106rwb; Sun, 14 Aug 2022 21:33:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR7JTNwUuBM4q+/6gfOUXCggHxNcf27HrRcKQP2DiMA4z9SXacZGrvvGdMOdirfkNYr3bVD8 X-Received: by 2002:a17:907:761b:b0:738:4c1c:7dd with SMTP id jx27-20020a170907761b00b007384c1c07ddmr2322106ejc.563.1660538026352; Sun, 14 Aug 2022 21:33:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660538026; cv=none; d=google.com; s=arc-20160816; b=td37rp4g2N9MmF8o6fRhaAOFewE7/lUdVI3V/5+U/CohkVipvs72yySKErJpVj2gdG XGd28yofeCnpP+CWZ/0RmmwhGNGa/qKCQir6eBZ0tLPIL4imfkBo7apjDbHUiYNUloq9 cDh4fcg+x6B+kAu+Ur3Loc2satgpNL80HNSkBVkNnkEvJObVeGSadAQ43Fr9EwkKT5/i GzQ9Jc7FY7/3pOOYQVghCWLqGObS0Ye4nigyuvh33E2pwCsTzPB4alU1Q11uv3e5lmnF 8mncMiKS7SRczVDKObIp3inWB2ur443qt72HbmKYnPEMXOAIMMSjO16lPzL3bgxrtg8G t5nA== 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=dJ1MD1tR0kbIlfBMZ/64C/omQnk3Uim6C9PqLfZ3qcI=; b=HU7zTyX+nBrS3f2uNHw0092V/sQnatYlyvHZ7hHj4rc5hVZrIEe6dTN9y2MWVjRe3r yXsecC0sKUSB650nkdXpFOXJL43m9q4oe0QWjlBMp/86K1kN02ZMT90n8oss5bpgAcbL FxVBHj2jD1eyFJCm6LL7Op/kiB36LKzUsHDpt8vhtMIOWFmYyO8tNWrNjkyoEQpCGJNW OPRcEVEMxjNul2I492UxAxudFqgMaNlQfDoRp1Gb7K7E/M3aBPdombR5LSKGOfzFkjOE 9xGr/nDhxFSFS/z2S4+xk9g4GkF5FHumSeXbasjwBWDWzcajGbbhDmNNqFCKls6yHwAm YRVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZhV6y7t1; 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 en27-20020a056402529b00b00443dbda68c1si421664edb.176.2022.08.14.21.33.19; Sun, 14 Aug 2022 21:33:46 -0700 (PDT) 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=ZhV6y7t1; 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 S240334AbiHOEPH (ORCPT + 99 others); Mon, 15 Aug 2022 00:15:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230387AbiHOEPG (ORCPT ); Mon, 15 Aug 2022 00:15:06 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CDBB13E3D for ; Sun, 14 Aug 2022 21:15:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660536905; x=1692072905; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4tAN31RYYpJnhaGsltGsp329SN2LQE0u8p1NIAAYm9M=; b=ZhV6y7t1IlR2Dwwsss1dodkx5I4MK46JKRskNqzHDNQchF4mtpefeQyV DGRDh/2zX7KpcgRWP2Sz4aNwErDD98H6w4uHEw/imgdibEv0IvCfqGws4 bg7hesf7mBGYQOZCtO2d2tczRT4C4++l0/16QITkHtfUw3CAz7e1qrhE3 OquDbEnxp84OcvibZz4ipyUm0px2wpziXSRIl1lh3SI1P9dzAiDt2dyOi eHjg5I3u1PpY9S+cZN7LkpmJLdO0UsU8G5EoN2h5Dc35KjDWwkoRUI+49 JxWFa6zWE/TKM1NXA7FBapt8UtAXcm89YNJvG7tGakWf0Q1Mej3fokuna A==; X-IronPort-AV: E=McAfee;i="6400,9594,10439"; a="271658890" X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="271658890" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 21:15:04 -0700 X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="934354071" Received: from dmalka-mobl.ger.corp.intel.com (HELO box.shutemov.name) ([10.249.42.26]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 21:15:01 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id 385CE104A64; Mon, 15 Aug 2022 07:18:04 +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 , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCHv6 01/11] x86/mm: Fix CR3_ADDR_MASK Date: Mon, 15 Aug 2022 07:17:53 +0300 Message-Id: <20220815041803.17954-2-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220815041803.17954-1-kirill.shutemov@linux.intel.com> References: <20220815041803.17954-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 --- 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.35.1