Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3746286rwb; Fri, 30 Sep 2022 07:50:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5lz7GTpwQV2bNZGQIK8BOCTSX5WH5o882aRPfwKmyRG4tyzC8SIfJjpjzBjGDTpU//K5P1 X-Received: by 2002:a17:907:a407:b0:783:5465:902 with SMTP id sg7-20020a170907a40700b0078354650902mr6755727ejc.35.1664549409521; Fri, 30 Sep 2022 07:50:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664549409; cv=none; d=google.com; s=arc-20160816; b=VVVAtqQOKMNa6lgNYmM2AKeXXCkDaB8yVEgsJFRb4jibym2tH9J2256CMQkJKmm2Op YvK7qTPBJYAfVJKlNkVX0d1C57G+HwR+Uz3nLDMOezvLjL37s3+hlmnwMU+Nq2Q99c0L 5IFoY7rNfQOHE7+DgJlniPqOTBIhikkx+X22oYk94fQ8eQkeiIt02U/JGjESLmvp8T0a hBvpbV0Br2RdftCawVBbJhTYGENqOUeITqgR8R+ni+mVfHOm/V/H2k6H5hwvJI6H3Xa5 VJdDTIr6klxfrd5aFxhvu+72IV8FHF6kw/tQp8IiDbJ7+Ziq7NpAlFQIOx3tfs3RYHzy PStQ== 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=6mUU88d77bz9mORxAl7NMj1cyDeY2JAozvJp4Bvmrgc=; b=ZSXWt3poTzE5KWTw9oYbM0VNpCb3QCHMOcm8ntBbKqWbHuswvDQPdkyjhG+XXSKiD6 Gks9zv3ySvv+aWzpwPpTYCil91GBjQC+/us9XVedhhSeij+iu4aMGE3P72+poj5EkCqz qJLlM8PiUC85O8k2jC85wbX28oyG45JsPpfJrfskoCPcBH84wclAzKtH6waY9FmqpEeJ yIC8GslSOY6CvYuwYLWYan1lRGPzQGVyl2lhqdzBsGk8XdZSSHEB5hbIjfYpQF5gDkhj BuYqOKq7biUJy8PRRHgCd3dn/+hbguEbgHTblF7mGxLr6UngESOXi+7+5G2zzgwH6KkR u8Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=oG0O0rgi; 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 ky23-20020a170907779700b00781bfe698d6si1606880ejc.602.2022.09.30.07.49.43; Fri, 30 Sep 2022 07:50:09 -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=oG0O0rgi; 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 S231580AbiI3OsW (ORCPT + 99 others); Fri, 30 Sep 2022 10:48:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231475AbiI3OsP (ORCPT ); Fri, 30 Sep 2022 10:48:15 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ECB512B5F0 for ; Fri, 30 Sep 2022 07:48:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664549291; x=1696085291; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Q72u8o9NplBRndRYgPTxCNaKqaPHER7MLnoX2dvImDc=; b=oG0O0rgiFJhRRDi+zl0ZYYInh+GH96gFtiBZNr2QZOPbdx2hZSfw8MMk nRsA/tf/8M1W8f79kvlbQkHPhzYmoZZHUir0+WQnAShqweVfwLpkJHa0V +a4tfdHD/SgiKTbr4cp2Z0h2m8fUWrNkCxRRBPCRgq4fAuu9vQS6DiiO7 U2+Sh+XCeZUnUYiU2nFUmjnHvrW6xzAZBE5NPF16ExKkF2Tkue6igI+7U JUNFiboUBXZAVEwKiyedTQHQN6FToe2LPf4oPrdI1a0iC4YE+OAK1zWE8 F+kAzC/uwiqydHNPQ4aVZahBu3MeDk9Jksq//4caMcaF8KX5oZKhQgyCD A==; X-IronPort-AV: E=McAfee;i="6500,9779,10486"; a="303116978" X-IronPort-AV: E=Sophos;i="5.93,358,1654585200"; d="scan'208";a="303116978" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2022 07:48:09 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10486"; a="691271767" X-IronPort-AV: E=Sophos;i="5.93,358,1654585200"; d="scan'208";a="691271767" Received: from herrerop-mobl1.ger.corp.intel.com (HELO box.shutemov.name) ([10.252.38.128]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2022 07:48:04 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id 33168104BD7; Fri, 30 Sep 2022 17:48:02 +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: [PATCHv9 01/14] x86/mm: Fix CR3_ADDR_MASK Date: Fri, 30 Sep 2022 17:47:45 +0300 Message-Id: <20220930144758.30232-2-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220930144758.30232-1-kirill.shutemov@linux.intel.com> References: <20220930144758.30232-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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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.35.1