Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp969197lql; Tue, 12 Mar 2024 03:44:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXRnA66trdJqgNVCDhwMi5tltGH2jfG0I7putOm8qb48xOFaqaXRiu+rQlMVfN5OutREBJ8ltGLNlJcQNNjyucbxJgWScnP5Z5bRhYYQA== X-Google-Smtp-Source: AGHT+IEwtNMnTRx4vVIdRVV8ggqKz6xz/z5nnus9FJqL6y/tDpceXTHSZpoaMSujGBv36g9DVX4q X-Received: by 2002:a17:907:c207:b0:a45:6f9e:a93b with SMTP id ti7-20020a170907c20700b00a456f9ea93bmr7009413ejc.11.1710240280535; Tue, 12 Mar 2024 03:44:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710240280; cv=pass; d=google.com; s=arc-20160816; b=e6AWwHIzzRfD3OACFcLFF4OIw2XowPKe2wJgjqdlzt0I6uQVEJaak7ShUFeJMhg95r 86lhmTHZVvStaUsByFBLC7pH5sEiAMpHFlXrkG9022z1wHdgM7CEcw9Z8a/A2bTVdxFT TPSY8FHU7+4VmrhBBLj6skm6kjOmF+XZmVrzFWuXHm90YvVqP8U1nkYdi0dzrYiQRQJ8 mMT+KSINC3Xh4EXdQ4IdoS4g7jFi/oe9yJm4vwhBpyoacDDklC5Sy43XsCdgqEdLlsdD quGjD+XW+VKi0+4sUzdy7dgqGzkDt+Wupmf0y4KOOERYR1097OoGNE1SR/vWZqNl50Ly zfTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:sender:hmm_source_type:hmm_attache_num :hmm_source_ip; bh=S8bZ6BUIH2HomdPhvv6h1N1lpoSYLRh6EQauxyiDJig=; fh=U2D13WVq/gQykHsfEq7ecZzQXpa6aHISR7zTlYUpi00=; b=WuLIZ2+O3zI2ha32Dsz1E1gjmCcaI6CQHj9t4JYUr4SQf/MSlBwx1TI4i7ON7KiI3Y n0wUk+vrWr0vaRwNunqTZk2S8Wgr4GaKKCwJuS4hJBPh04qCGC8n71QJqi5Sm3QOJFaP 5QmQtg5EbUagLA175KgtINNVdprwvgJ4uCmu3DH3Hc3GfpgiaK52mAyyhUJxS7g2oCcY ktkro05G6iwLQnGMrf1n2AMDhS0/z0Y3QAPpeH+qaSnPMcM8clRuD3aU03xVF2HXAaqW FfoHCRpSxuLzfrXyMOgNnkTRfUcsbuPcaMj9bvdn/C3+ZOOAu1tByVkVvIPySy6haC4N eCrQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=chinatelecom.cn); spf=pass (google.com: domain of linux-kernel+bounces-100135-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100135-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h14-20020a17090619ce00b00a45f24dbcccsi3154844ejd.727.2024.03.12.03.44.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 03:44:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100135-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=chinatelecom.cn); spf=pass (google.com: domain of linux-kernel+bounces-100135-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100135-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4614A1F229D5 for ; Tue, 12 Mar 2024 10:44:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A68075915A; Tue, 12 Mar 2024 10:44:31 +0000 (UTC) Received: from chinatelecom.cn (smtpnm6-08.21cn.com [182.42.159.130]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0444555E73 for ; Tue, 12 Mar 2024 10:44:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=182.42.159.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710240271; cv=none; b=GDnPXzXTKztYiNkiIQz3PtqlUy4Z+b031Hg9QZOtbw28blcMml8omGmVWFQMmCLNCiy2YTlUNt1Mil3UxwwGBAXtAEK0AzNTx9uTJYz7SEG+iqsjO1T0cDu1jX+ps+a7Tk8KjMPDH5F+yqwRV6rGydEzoksMIjg/tJZpd1KxETk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710240271; c=relaxed/simple; bh=MfKDSsCO+k//eJBVuSOO62heQl3fYjZ9fUGxXXuhUXE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tDKyk3yLv2VrFH0PbJyt5l/LulapauKqQzVTKynsBnFMCiC8eZAtois5Q9mMzzuqUmI51iDw0i2YR9kqpzHzsZNtR9mvedtaXSUMQIne8Y20jI4Vmw+fcz1MZlQtpbf9WmcuJq0lNYy9imdba4U4b4yS7fVgC1zIf3i037umyiE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=chinatelecom.cn; spf=pass smtp.mailfrom=chinatelecom.cn; arc=none smtp.client-ip=182.42.159.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=chinatelecom.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chinatelecom.cn HMM_SOURCE_IP:192.168.139.44:63786.1870684316 HMM_ATTACHE_NUM:0000 HMM_SOURCE_TYPE:SMTP Received: from clientip-124.127.58.150 (unknown [192.168.139.44]) by chinatelecom.cn (HERMES) with SMTP id 7579290322CA; Tue, 12 Mar 2024 18:35:46 +0800 (CST) X-189-SAVE-TO-SEND: +sibs@chinatelecom.cn Received: from ([124.127.58.150]) by gateway-ssl-dep-77bc75f6c8-x5lfc with ESMTP id c6fa781bcd40441ca0a54af00e4aa89d for kai.huang@intel.com; Tue, 12 Mar 2024 18:35:56 CST X-Transaction-ID: c6fa781bcd40441ca0a54af00e4aa89d X-Real-From: sibs@chinatelecom.cn X-Receive-IP: 124.127.58.150 X-MEDUSA-Status: 0 Sender: sibs@chinatelecom.cn From: Bingsong Si To: kai.huang@intel.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, sibs@chinatelecom.cn Subject: [PATCH v3] x86/cpu: Clear TME feature flag if TME is not enabled by BIOS Date: Tue, 12 Mar 2024 18:35:34 +0800 Message-Id: <20240312103534.9037-1-sibs@chinatelecom.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When TME is disabled by BIOS, dmesg output is "x86/tme: not enabled by BIOS" but the TME feature is still shown in the output of/proc/cpuinfo. Signed-off-by: Bingsong Si --- arch/x86/kernel/cpu/intel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 40dec9b56f87..119ae291573b 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -228,6 +228,7 @@ static void detect_tme_early(struct cpuinfo_x86 *c) if (!TME_ACTIVATE_LOCKED(tme_activate) || !TME_ACTIVATE_ENABLED(tme_activate)) { pr_info_once("x86/tme: not enabled by BIOS\n"); mktme_status = MKTME_DISABLED; + clear_cpu_cap(c, X86_FEATURE_TME); return; } -- 2.34.1