Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7711925rwi; Mon, 24 Oct 2022 19:24:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7QfU0ZGuIsmkakS0x5jvYqtroYQFQmSA3Q8tuVGQGlB30wh1DxPI6NBed+enQ318MDwmd6 X-Received: by 2002:a17:907:5cb:b0:791:96ec:f436 with SMTP id wg11-20020a17090705cb00b0079196ecf436mr31400907ejb.100.1666664689814; Mon, 24 Oct 2022 19:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666664689; cv=none; d=google.com; s=arc-20160816; b=CpRmaPn/iQK4uEpWombHx/HBaVuzFK+HybYOu/ayCA8BwI0Qo3iLmD3+xJuzzx6bkV wcsDU04oOIYZnYQX6OY72AMzxZib1Yh3OQncJuXjT6a5FRJaSpWz2tKTn5tbEfxcXxHr rvLCaXANnTp57K75VqtOIW+IV+1hLRI5IxY6OzacN0c47bhFQvIoMNL6NBPnbLkwpY0Y mKBjZqLRKQaBJXIXQ2cb9SgaJViogE52Apjo8vL5G5VXCZ8KAwZdIrSAOTJaVSXYo0Ib DBToijzlPSJTlqTu29bsSKo62Bg/GXVwJKUzEU6bOuRjzXiss3N/mIOnN0ExlzKRFPTt RXhQ== 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=LAcHGIkFSpE+PVl/hnWJyVZj5R6Iv4Jn93iPZZhcN96KohFjpIz3nBtxnVhlxZ5g03 /kpYa3FyMJU3zvPJYQrvsI22A1JqZf94GWBMmEFIy7QOUhr0mSWqXoiF5nhiNijbW8We c+8XNmslUkl7QGc6gl3ocdPyZ4QVxYcNfCKDy2sHsW4xINel9yXY9M3rQwHQqbjDF1Mx qLpYiAoosS51H5aDFOc79dzpJkxcbsx+IovFYxGeArikyw2436hz7pcbE4UynsT5/shW ebW5t+3xuOLeRE0TrrCsWZX/6nJBKAVNuBiP5A6M1cfChW4saee0Ov3mWTLgt3qjjYtp y2yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UJ6GA99M; 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 fk6-20020a056402398600b0045cd985a835si1487302edb.33.2022.10.24.19.24.25; Mon, 24 Oct 2022 19:24:49 -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=UJ6GA99M; 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 S230439AbiJYBJC (ORCPT + 99 others); Mon, 24 Oct 2022 21:09:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231249AbiJYBIQ (ORCPT ); Mon, 24 Oct 2022 21:08:16 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4D182AD7 for ; Mon, 24 Oct 2022 17:17:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666657056; x=1698193056; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YRI2YivWJDaeR3A5b46DIJCCsip9GmvTxTmH9XsxWxQ=; b=UJ6GA99MGnwOQkRnAJ4nJq2qI14hLSPwDN9bwnMVcXywr6HrFdyIJApC R04kl/UAUnBiWlk1i4s7dj9ZEcyPMslryKPTrJetF4vg406yEaFDf6FCV VETTnuHDOcU5tKa2t4urwyY00sjogFSj89fhjyyX3ZCZnee0F6cLT3yTO pDQIrUcykK+VgKDb/3dHtutZIQ3prrqQaG/fTH+vo1Q5i8ePUucX9JhNS njkKvLFkUzgLHd9RLr985hTUk3Qn77sBrTRhgUTmS8/yuji6kucRKxZFf 8X5wbuOZrT81ZqUO5sQE0AmtXhez2i5N3fIGEkWh4fO6yWR2J4AtB/+Q4 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10510"; a="309238816" X-IronPort-AV: E=Sophos;i="5.95,210,1661842800"; d="scan'208";a="309238816" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2022 17:17:32 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10510"; a="582587458" X-IronPort-AV: E=Sophos;i="5.95,210,1661842800"; d="scan'208";a="582587458" Received: from ghoyler-mobl.ger.corp.intel.com (HELO box.shutemov.name) ([10.249.39.118]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2022 17:17:28 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id AA335106656; Tue, 25 Oct 2022 03:17:25 +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: [PATCHv11 01/16] x86/mm: Fix CR3_ADDR_MASK Date: Tue, 25 Oct 2022 03:17:07 +0300 Message-Id: <20221025001722.17466-2-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221025001722.17466-1-kirill.shutemov@linux.intel.com> References: <20221025001722.17466-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,URIBL_BLOCKED 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