Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3332807rdh; Thu, 28 Sep 2023 08:42:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwBJoI+8alUuyvQMS431SGeW/dqf+pL5fvGno8Ho8LSXFwRuC4Tc725TuRxiDu9+1HqMLz X-Received: by 2002:a05:6a20:5483:b0:160:a980:1222 with SMTP id i3-20020a056a20548300b00160a9801222mr1887327pzk.53.1695915745686; Thu, 28 Sep 2023 08:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695915745; cv=none; d=google.com; s=arc-20160816; b=doVSY6SAjJJpYYNdAnd6aREtF1m/l3EpnN8wSWPzcC/7BM52NJ7dotFhzfPFwEp4aQ RHGtMKCwaw4IabwBpSHU+PnIdtq3VSF/0Vvxsbtq9MZpMkDV6beVnF3NwB/A/Wj/N3eV K7EgMrvX1zVOdsueyx6WeX6t5EbpzUULwrkgU8qYT0vH2VuNjyKx7PC+09l8RciKf3u8 aUpKtdM2rnz4KdCwJltX0MYiEYKgP5wSJkPTZNSKcxBbt8kTEP91ZS4Lx02W0+qGULbv JQsXmV50YI09aRysjKdJUJGs8BAFVpu4DOiXlwnUMrfnQMl7uH8+TzYzeHIEnKcxfyVY nXaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=36fJuoDKgrkFUfM/dN0U+p3MldqyXeYY9tSG7Iif6RQ=; fh=D1n8fvF9xcHa+viEn5b732Qk2syo3Khk/axuXqXnoFc=; b=SoltYfwK30vHNbOpiBuCQdoIzey06EkGbwZHtIpX+APf9DQWu0gkW5BXsVxZ4C/bW6 FpzTT4orq29pubTZzj8dWwG7s+QW+UoM7mfzZB0L2eQMvkKmKpkqMYGQ1mETzxNd80bv dLg469JPwQ74vx6mvMhp4WzJeXFs3+OIBkZ/LQBJ6Odwf/DLyfiXYN5xieD+P6oWrSsP bcHpg1mFArrz9ePrqEK0ZTP90djH5Bd/QAYrQFPSPnwQwF/sCDA+pejTHwfbAmnJPQoc Br2f5yoL+jbgq9yBB8Fi+85Z0g6BSWiOmq9uoVn/63pFxQlRI+QelTAmmQ6++tb40u17 FNHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=kf1d46P6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id bv14-20020a056a00414e00b0069342cee02esi3479851pfb.298.2023.09.28.08.42.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 08:42:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=kf1d46P6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 368AB832B784; Thu, 28 Sep 2023 08:04:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231384AbjI1PDz (ORCPT + 99 others); Thu, 28 Sep 2023 11:03:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230430AbjI1PDx (ORCPT ); Thu, 28 Sep 2023 11:03:53 -0400 Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72AF419E for ; Thu, 28 Sep 2023 08:03:52 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id C068040E00B3; Thu, 28 Sep 2023 15:03:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id BXXeFrxH1MTH; Thu, 28 Sep 2023 15:03:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1695913429; bh=36fJuoDKgrkFUfM/dN0U+p3MldqyXeYY9tSG7Iif6RQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kf1d46P6NbiNXiz4G+rZbKB1yeFksa5OgxP/CUXP6lYZvbIbqXq6VLB4xVrcLna1f /ioLB//OjMPoYQ/Zx1f1lE87Bc3tfMvyBsxxncUAgtlcwrsdw9ppv84rsDuXptQV/H GoC6I4wehfYUYboDBdFYG6MTPeS98YBd5HYeUuUXcKja7p8OiRrdHNtchdCK828vR3 1/CvqyLz/WVAFXpiEJBQSEx2hik1OLNZnN7wmk12E5N+Lkm+iwvXvKXrCZ0tP3R5Vr 55tNkhM1e0tnOR8aE9b+ywbOWqJt/Y6kHY20d2qjwmEPOFNW6I1tT40D7pIFeX/Skr 3E17MQugc9CmylNdXJBM4+2QHmEoOaVLRgg8UQ3kriKkxqir2Oi5Zv9vK0P0M/LkSf S7FbOsryyZPgs5YkHBi5Wqipndkd6BxY6Iyc1kheYuXE7hpZ84+fHxoWiMD9IAejki yb7yVpEpUqIgUcprMxue54DVw0uG4rxG5WZxeTrYNS900a77bkQ4QHXGE5ZzCH8CVG bo3npKOWkmYBdx2bHvfRhzbIT1qh7RXCXHzvoCk/uMvy0vMo/guWT6UdMfJBJe5lv8 M5MIL8IoEvDsAM4YBJEC/j3f+3bfgbbf0eheGENNlc0znIr1y9sqT3N9bTUUKtPTqG VmA8e7GzH3TpSp7iffCautrc= Received: from nazgul.tnic (unknown [88.128.88.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id CE3E540E0198; Thu, 28 Sep 2023 15:03:45 +0000 (UTC) Date: Thu, 28 Sep 2023 17:04:05 +0200 From: Borislav Petkov To: "Compostella, Jeremy" Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v2 1/2] x86/cpu/intel: Fix MTRR verification for TME enabled platforms Message-ID: <20230928150405.GCZRWV5bjjUuWof3HQ@fat_crate.local> References: <87il7xu7ki.fsf@jcompost-mobl.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87il7xu7ki.fsf@jcompost-mobl.amr.corp.intel.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 28 Sep 2023 08:04:05 -0700 (PDT) On Mon, Sep 25, 2023 at 05:00:45PM -0700, Compostella, Jeremy wrote: > On TME enabled platform, BIOS publishes MTRR taking into account Total > Memory Encryption (TME) reserved bits. > > generic_get_mtrr() performs a sanity check of the MTRRs relying on the > `phys_hi_rsvd' variable which is set using the cpuinfo_x86 structure > `x86_phys_bits' field. But at the time the generic_get_mtrr() > function is ran the `x86_phys_bits' has not been updated by > detect_tme() when TME is enabled. > > Since the x86_phys_bits does not reflect yet the real maximal physical > address size yet generic_get_mtrr() complains by logging the following > messages. > > mtrr: your BIOS has configured an incorrect mask, fixing it. > mtrr: your BIOS has configured an incorrect mask, fixing it. > [...] > > For `x86_phys_bits' to be updated before generic_get_mtrr() runs, this > patch moves the detect_tme() call from init_intel() to Avoid having "This patch" or "This commit" in the commit message. It is tautologically useless. Also, do $ git grep 'This patch' Documentation/process for more details. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette