Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp714526ybv; Thu, 13 Feb 2020 08:12:54 -0800 (PST) X-Google-Smtp-Source: APXvYqzKK6BT6gmm7DNgoaeSSFw6w7jtBocmzM9Kvl+Io/Fg+xcOOc2SVgruCFzInDZeM6fliufx X-Received: by 2002:a9d:bb8:: with SMTP id 53mr12778781oth.150.1581610374131; Thu, 13 Feb 2020 08:12:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581610374; cv=none; d=google.com; s=arc-20160816; b=YgaxzK7HaKi5a1GIWtSxVDLYGJKeqrZx3RTDVqh8vi6neaSo+yDMXc5nhj4wXCZPez qpZhMNbYP7qgzirMjiz29y5RHW17An8KJwwjNfgqKRGN3cZ+yN/7k7lTaSIxSjNiTFs7 b41bigfy8noJn8SbKrzpgeJ4VHazeucZXFG8YJt55YQCA1BJ+C5sD31rbv9G9GR55lp/ kqlRKWFZkoG3c2/nVWbKGN2tgMOLN7rwm5b9JBzCfXuPlpvlcbpxQWcvIO7I8BWadQ1v W3IqZMW9oD9U8jiIDU3ANtMUTepU7NZLRfyOuaQFZ/GvGD5ltZlxScsSNrEgp6sfbYpR Q1XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GBrejHgmu3bhp/kRNE6T3qMsQPXfMntiL8YmeRx8tFU=; b=wmYb2H+pkTDmlfnCWkOk2sH7mMfUx7hHNb6iOhqS1w9gBd2VpWhXm/DQ1wyX5dF2cm 1ZX8aNXalY10Pv1JHCv4PCfqP4tFYTVpYYwOuO99F+J6hiDCa1c9UnkUcQsRYWOSk4/l hcz8ICBhXUV3ZB/jXQneIM9pdnBoRWBEpTl39bPF/byZYp6q2l2dNJ8rVnHtlbegnXjX RNqQidNHRRhRnkNnVh4jXAM5SZ/bMYl408jq2rKEYn8IaejT7na36ty2jlDQ9SIhnpMB t4wfAG9WB8m8DyuIRr+ZjmL7lCtDk1cJQkkiA7JDJG0bxGOsUcqObhoT7X9jmUSkLtlO szaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="MQ/n3Jkf"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j20si1371169oii.80.2020.02.13.08.12.41; Thu, 13 Feb 2020 08:12:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="MQ/n3Jkf"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730270AbgBMQL0 (ORCPT + 99 others); Thu, 13 Feb 2020 11:11:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:59484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727848AbgBMPWX (ORCPT ); Thu, 13 Feb 2020 10:22:23 -0500 Received: from localhost (unknown [104.132.1.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EA9BA24690; Thu, 13 Feb 2020 15:22:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607343; bh=Wapkas+waZEDrUTxeCmaU37Zgapt29th2rLS2nZtvWs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MQ/n3Jkf4LriLbANqT0ySfQBFKurTPEWm/rsffxxVBPVUBEPrlXsEtRLykVpVK4KZ DxYwvP2JASr+PzIO2FPhs1EiU47KLheUFQjHrgX7bdNMmsRRMwr2rjSt3a5O9rB2AR TnZhYFNupu+AtegwN965yvJ90aGncC0x2Fbtygvw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pawan Gupta , Thomas Gleixner , Neelima Krishnan , Dave Hansen , Josh Poimboeuf , Sasha Levin Subject: [PATCH 4.4 02/91] x86/cpu: Update cached HLE state on write to TSX_CTRL_CPUID_CLEAR Date: Thu, 13 Feb 2020 07:19:19 -0800 Message-Id: <20200213151822.199748174@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151821.384445454@linuxfoundation.org> References: <20200213151821.384445454@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pawan Gupta [ Upstream commit 5efc6fa9044c3356d6046c6e1da6d02572dbed6b ] /proc/cpuinfo currently reports Hardware Lock Elision (HLE) feature to be present on boot cpu even if it was disabled during the bootup. This is because cpuinfo_x86->x86_capability HLE bit is not updated after TSX state is changed via the new MSR IA32_TSX_CTRL. Update the cached HLE bit also since it is expected to change after an update to CPUID_CLEAR bit in MSR IA32_TSX_CTRL. Fixes: 95c5824f75f3 ("x86/cpu: Add a "tsx=" cmdline option with TSX disabled by default") Signed-off-by: Pawan Gupta Signed-off-by: Thomas Gleixner Tested-by: Neelima Krishnan Reviewed-by: Dave Hansen Reviewed-by: Josh Poimboeuf Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/2529b99546294c893dfa1c89e2b3e46da3369a59.1578685425.git.pawan.kumar.gupta@linux.intel.com Signed-off-by: Sasha Levin --- arch/x86/kernel/cpu/tsx.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/cpu/tsx.c b/arch/x86/kernel/cpu/tsx.c index c2a9dd816c5c6..9a7983968ba86 100644 --- a/arch/x86/kernel/cpu/tsx.c +++ b/arch/x86/kernel/cpu/tsx.c @@ -115,11 +115,12 @@ void __init tsx_init(void) tsx_disable(); /* - * tsx_disable() will change the state of the - * RTM CPUID bit. Clear it here since it is now - * expected to be not set. + * tsx_disable() will change the state of the RTM and HLE CPUID + * bits. Clear them here since they are now expected to be not + * set. */ setup_clear_cpu_cap(X86_FEATURE_RTM); + setup_clear_cpu_cap(X86_FEATURE_HLE); } else if (tsx_ctrl_state == TSX_CTRL_ENABLE) { /* @@ -131,10 +132,10 @@ void __init tsx_init(void) tsx_enable(); /* - * tsx_enable() will change the state of the - * RTM CPUID bit. Force it here since it is now - * expected to be set. + * tsx_enable() will change the state of the RTM and HLE CPUID + * bits. Force them here since they are now expected to be set. */ setup_force_cpu_cap(X86_FEATURE_RTM); + setup_force_cpu_cap(X86_FEATURE_HLE); } } -- 2.20.1