Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3693667rwe; Mon, 29 Aug 2022 18:03:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Vhz9kpDDMj8h15GRC7FUEguBSb9XhFGk010yHGVKf3Ll49bbWdcdOo8nzKV42r7n5LgzK X-Received: by 2002:a17:907:e94:b0:741:6f75:48e4 with SMTP id ho20-20020a1709070e9400b007416f7548e4mr6750548ejc.331.1661821427071; Mon, 29 Aug 2022 18:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661821427; cv=none; d=google.com; s=arc-20160816; b=ywcj5yqjoKfIDaI5ZgWxCg5pGFkEzAXkq/2ms6RFqoRjU2cXOrZnS3J7Z8YG3el/vX 0BwAZenGKwYFX1anQRUfDBYV/8DSLdTFeCWbgtuEXYO1x076UFtDEffN93SMIjTCMS3u 2vDnpH/oBW0CCaONtkSK3WZEbkIiykQMB+8cjI9oXfxh2UI3aO3BFXaMRjIGTqvah4x7 mhbi8xVmdb8vs7r4WHE++z3wrl7J4rkUot6rJ9/BNeMNi55wnIefDgCv9wDnwpQQPMev L3Cy+4Xv/Wzqh1SmFk0mW3Qn1BAZxpO8X84VhsV1hCdbpYJPF8KhEIU8uDrMi6asqwei N0Gg== 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=r4MvY+v2iRU3KjGDfdcb324Px+WHRkEncXcRKv49KjELqYMJpHnuNopcqFS4z50soy OtWuNduulHYLwSmiB/gkx1rLUaXBKdbAfePdQ9T94+i8iXTMCQXXGoBgLu6hFOFwv9OG SmlPEFX7uJ9/9jD1aUlTowsFyVnhFwtdkFuP1Dj+ZY3lnH20tpWcwO8LxqQlw+8eHu5H l9vjnAIuisWwklkvFWBBBKaOj3hc2PtcGmk8Uze0K2n5rnILbHp9b4RUPA7xFSMt4Oov FdfltsqwTJBZRHJlPXeM959cI616+Hx8Xi7hCdjMIHgkVSjqGpt/SnyyW/Ms8lwPIOL9 fE8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cm19ydCL; 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 l8-20020a170906794800b0073d637ece79si7973553ejo.367.2022.08.29.18.03.21; Mon, 29 Aug 2022 18:03:47 -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=cm19ydCL; 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 S229697AbiH3BBk (ORCPT + 99 others); Mon, 29 Aug 2022 21:01:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbiH3BBf (ORCPT ); Mon, 29 Aug 2022 21:01:35 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CC69A0245 for ; Mon, 29 Aug 2022 18:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661821291; x=1693357291; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Q72u8o9NplBRndRYgPTxCNaKqaPHER7MLnoX2dvImDc=; b=cm19ydCL3g0Ub6snt8PWzdR3JjQLNiY1XRVvPIDt90k709GEG/Fd4WBa iVt0IZK2X57IU/DgfRGOSPYI9leWwvyzayb31kT8huZdWJ4Z07uQTiAUn DA79L3sA17Iv7JGCFKpoyPY27d2dFKRcxi6QgMouuCx30vjzQNN71/pxw QnayhvP4p4Domyl5HJZierI1qQ9sordklyhxF8coXGh6llta2+8B45i8w Gch+X5Iq9UcyhodB+ArMfJvxQlLdZ0/ZO0DIuYpd3KEDhFEsfRdyB/t+a kZVwD8huJ6CVehkwNxgm26VwKqAXbH7HjgNjhKbMf4vvDDZmSPD0PLywV w==; X-IronPort-AV: E=McAfee;i="6500,9779,10454"; a="282015865" X-IronPort-AV: E=Sophos;i="5.93,273,1654585200"; d="scan'208";a="282015865" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2022 18:01:30 -0700 X-IronPort-AV: E=Sophos;i="5.93,273,1654585200"; d="scan'208";a="787305212" Received: from fpalamon-mobl.amr.corp.intel.com (HELO box.shutemov.name) ([10.252.54.23]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2022 18:01:27 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id 6425A1040C2; Tue, 30 Aug 2022 04:01:24 +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: [PATCHv8 01/11] x86/mm: Fix CR3_ADDR_MASK Date: Tue, 30 Aug 2022 04:00:54 +0300 Message-Id: <20220830010104.1282-2-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220830010104.1282-1-kirill.shutemov@linux.intel.com> References: <20220830010104.1282-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 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, 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 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