Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp237471lql; Mon, 11 Mar 2024 00:27:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUXGImXW3A9qWAwX4qBxbwCH0C+2lEfp5rXSGjEgnhygxU2B66cjQCltoYbABH0EauKnd5KWiEJyrLnek0B75wY4vl42EQcIc1q6XpPVw== X-Google-Smtp-Source: AGHT+IG2Kk4gN0wMPIX3aTxlW8EGDi0YOv0PRB9dYNKlj24mVjQQ3eSTZWYwN4XV4zQSWBBEbzB8 X-Received: by 2002:ac8:5d93:0:b0:42e:e3d6:799d with SMTP id d19-20020ac85d93000000b0042ee3d6799dmr8504165qtx.18.1710142068179; Mon, 11 Mar 2024 00:27:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710142068; cv=pass; d=google.com; s=arc-20160816; b=JWwR3NCxIUv6GsyIMUoXVONGbVLzph2IvtiaYkozgQTnFqa3urRm9Vx5IGuOgSqImm o/AVQ9BzNIxDv4waoPs72LyfvsHQZ4HyWIJ/T9O5wEM/ArQFuc2nfGb1GAmf2axXVNhG S9+sdIV7h12umStjwns4na0GU3WAMsuwIkf/14AgM32dCxrXgyZHdPjMJLXwkpilrxnS MtByiu6JJGD6fy/ArKf6RMHr7a+cHzrLF7LdcfvVODk83YlldSyHSa4V/vj2lEXDi7XU 2re8WOJs1up3RbXrsdb2Tb98kfrwB+F+peqoq4lrfsbvpJ47lWOgzuV/DIaVVhmkMdYr mkWQ== 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=yEbHM5d85o82+5TO9raYGG0zNKJtdtVYVqH4YJBRDiQ=; fh=gHT0PtV5fTB8iSLeg8B45uW5BYl8FaAxGeJZM1F6mlo=; b=jheK9mWU7FteUuOFE2JZhJcyZABkT2dwE2p7C14vQf0LZeAg9pMJVhgtNktLiOIAr+ KFiFK+Ln0uOjcmcsaQCxYjv2PVXqzijHIG4h+aqNs4EOi5fC3+uyf78hEG/DUeqRrvDA vhKRAImYopNnB9BSvkCBpRxO4SrPaxx/V6i2a14n0ldFFZyyc3BpP92AXzWGZATSNTVR BjPFCXwTFeai5JLalrocYdU/Jx7H0w5HnrK5JJFmyAvPuBGN2nRCiZJorTUcKx5AVX/z i/vOheL+/JnKA8bvZkk2v4K6d1V7ZeQXZYZoP99POVysnAUE8qZeVYK786OeVYLUFkBX Arlw==; 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-98515-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98515-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q20-20020a05622a031400b0042ee624e2fdsi4966457qtw.337.2024.03.11.00.27.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 00:27:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98515-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=chinatelecom.cn); spf=pass (google.com: domain of linux-kernel+bounces-98515-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98515-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E27151C20E75 for ; Mon, 11 Mar 2024 07:27:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4A9571079A; Mon, 11 Mar 2024 07:27:43 +0000 (UTC) Received: from chinatelecom.cn (smtpnm6-01.21cn.com [182.42.159.233]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8DDF810FA for ; Mon, 11 Mar 2024 07:27:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=182.42.159.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710142062; cv=none; b=lg4BD/iFiuUCLBvXOwv4MmW1hXyw1HKZlPFLKI8QD2NwG5JhHY9WMolr9Dn3jVF9per7xpLjgb5MZ2UdkX6/4sF1XyQirXimLx/Asavr6MgzODDdEsNo81TeLGbZyOpQeZjXYSzo89ojIkduoGe8i3MRlY5wTUfouRcfsIReTBs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710142062; c=relaxed/simple; bh=J6HmO0J6s+zLrlibuEwc/AwNYn0n0tulm6hqS9PockI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KEjpzJVdczEkKNN0VaQPL0r9Z2/ZdfQdzRfUmtK3E04b91zsInw9ZF/fzBPWjCA3XZGGG7hhYjU+FhcZoRdxlsHoz20vFSst8hK9HiUhe6maSKnfcabxZ+n5kov4Et+v+Vg6nK2Y+cmMgwIHcmd6Cn7v88+pjKjejN1R2Y7+CSY= 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.233 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:29798.1556610506 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 E743B100112C5; Mon, 11 Mar 2024 15:20:15 +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 b8ee26f0b9ed4be19d3822e012ad2032 for tglx@linutronix.de; Mon, 11 Mar 2024 15:20:21 CST X-Transaction-ID: b8ee26f0b9ed4be19d3822e012ad2032 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: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Cc: Bingsong Si , linux-kernel@vger.kernel.org Subject: [PATCH v2] x86/cpu: Clear TME feature flag if TME is not enabled by BIOS Date: Mon, 11 Mar 2024 15:19:37 +0800 Message-Id: <20240311071938.13247-1-sibs@chinatelecom.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240308122752.3342-1-sibs@chinatelecom.cn> References: <20240308122752.3342-1-sibs@chinatelecom.cn> 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/mktme: 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 a927a8fc9624..22f0c829784d 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -526,6 +526,7 @@ static void detect_tme(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