Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5834975rwi; Tue, 18 Oct 2022 04:59:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Ma9Q3cQKT+24rGlSOfq6RvTEW+vsRBuPle219mckwcjq7fiYaeE2Ay/PUIVevwkYaG/S9 X-Received: by 2002:a17:902:ccc2:b0:178:29e1:899e with SMTP id z2-20020a170902ccc200b0017829e1899emr2845499ple.114.1666094385604; Tue, 18 Oct 2022 04:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666094385; cv=none; d=google.com; s=arc-20160816; b=hHtZeGgn945md17bKzeuQASBR6ZmPkyxag2ASFD2PK9Qat3ZyL1BMv6qrOkiepYgfy F7WjQa5X4p516/V5OLxd6fa+tHSBIs1yevd2Fmuj12gdQ7Gno1EEXV1xNTahRuscekNx Y+K+UK+thsHpw38KETSkWiRE21Fo7cLIen33jzTDOLDPvpIANr4ounJQP8XoxFSMhBeK j4QSz8fzZ7Odi1VM0Yxdkm+0v0jLoOKWTuKHm4L5oQ9DCmn5SXtB8pTUpjfKEhwXEjbG kWHqnJrqpoVHOiKl/rs8u9KwsZgCkdsbvIgEGJQuANFRcmcICWymoXLTgi+SxgavknGV Y/QQ== 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=0YfHxOcIsDt73dVKMRBrLh+sk8Ahqxtj7/mItsJ3OGR0p7gv6hvLxyUbylm/NXo6pL 99IUxgWG8QTIu9CSaR4iMs7LS8v69am3s90RzoC3Uqgw+P7XB3IE670uL+Xb4KuJrD+P gWmG0JNDZMT+XUgu6Sq9nBG7UiOjGTYBK8Q0v9KsY9o6lK7ErKhkx5UqtKuvf1xuEapK VNaZcZeICDF7RLEdzPIB4v+NjEHovRcLdg0eMuNb/RoL1He1SGyNCtV6rW1dk7+tPByJ PQ16IjyrMOuNT/WRGKVfh9/9q9zhm2LF68pYSCOhzMgtLwWSmyvEzBrIg98HKHjFreVF 0QFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=a1c91sRg; 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 m10-20020a170902768a00b00176b3c7d158si14817955pll.99.2022.10.18.04.59.33; Tue, 18 Oct 2022 04:59:45 -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=a1c91sRg; 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 S230232AbiJRLhb (ORCPT + 99 others); Tue, 18 Oct 2022 07:37:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229605AbiJRLh3 (ORCPT ); Tue, 18 Oct 2022 07:37:29 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3287BA27B for ; Tue, 18 Oct 2022 04:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666093024; x=1697629024; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YRI2YivWJDaeR3A5b46DIJCCsip9GmvTxTmH9XsxWxQ=; b=a1c91sRgQnEQxKto/7Jx6EmVW6MSiLh3Hg91hpNfqyyA/YP+NeYlJo1W zfA/fyOJx9hqVkIH5yACX76YSk4TusA6Lk0hqdyQWgI/OA3rPI+FHRIN8 TwJQhMWFFKQMtdDGmBfrzuyyW2tztTBrGQ6nJzK7SrbwBcweEo9ipUIN0 QgJ1+N0CeMdhEmrqJznPfM/cok8PkpU1LyrH+WxyccAKVXlHGTN3+/dA7 dNmNwOhGRyJoHsO9miX4SaUP853hKxTAPwgccDz4hFDNCjioj3fjzL+Wj JIvPTxwOy0FTyDo9CFX51DbY5+Iz5mBgnWNBiA+H7OiLAxnT6syaAH312 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="332620544" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="332620544" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 04:34:11 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="661861119" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="661861119" Received: from vhavel-mobl.ger.corp.intel.com (HELO box.shutemov.name) ([10.252.51.115]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 04:34:06 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id EDF1F1046BE; Tue, 18 Oct 2022 14:34:03 +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: [PATCHv10 01/15] x86/mm: Fix CR3_ADDR_MASK Date: Tue, 18 Oct 2022 14:33:44 +0300 Message-Id: <20221018113358.7833-2-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221018113358.7833-1-kirill.shutemov@linux.intel.com> References: <20221018113358.7833-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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.38.0