Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp704436ybv; Thu, 13 Feb 2020 08:04:09 -0800 (PST) X-Google-Smtp-Source: APXvYqwyrfHtQsB9urKgofeOjeaRJkqob5t6GHv3WAaYH0O0vzi0pR8ebVcU9LkS5/lggdapj54D X-Received: by 2002:a9d:7607:: with SMTP id k7mr13704992otl.205.1581609849695; Thu, 13 Feb 2020 08:04:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581609849; cv=none; d=google.com; s=arc-20160816; b=yrZ6gLoHP39I1gAFFRaxzFgMrczsnGciT5s9uW9g4jZ6iikQpes80JRMyXdOctjq6g /aX9x8/+p2/FL2OMkZT5W49h3jpFx5sgJnD9TEAUlFoz5WIHnGnn/X/vEFHKjbOESTN3 lxiuNxy7kSesP0XFRXmfYKi5SoNcIeZejFFmEL3h6GRb7VJ0Tp2roBEPNal/l6G+qK1M AWN8aZvFZP4pcVega17PRfDacElA+kKKpZPr1aMVHH0ta/qf8u1n9j3wkKqtdYopIHzF yJJORXdLbKhd9e4oEpuAyuw8URc4Pk1eR2MnLkaO1v7mPYhk08eo6jxj4lTUd1GfV6Hw qS1w== 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=82TBfk9zx10bUBwLs7BjsIVDQXQ9Bh3LkyPgWGZ2oaA=; b=Qf9jBcr7ejP0jbK47QeMvQ6Qcg3dD7M5RyVK9gpG06tf+F6/dreV0eqRG2hQF31IQM 2y4sJgl+5x59tDemM5E8GxSySfT4Nwhp13hkfWuS+y1bOQrC0n8K3eUGFRVG8iLGWMie wuj4I4H6OgeSujZbMy1+UI4Avfx1qBMaAmywgB6GnDbn+IgEpbpZQWkEm8d5eB785yMJ oC1jGLewb9UwUcbU3ISJYi1V7zyWnm2Eq1Q8ZQFTOyLyFSBj03Az8oSVy1rgbgBoV2Z2 mF0QeT+vXMvhiLHoHdNb6pO3h8b9LJL8bvs5qNL7u1HPrRB7Cw84oWUr/Xq1Or1OIXED HHsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RRBokUDa; 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 g10si1318804otn.12.2020.02.13.08.03.50; Thu, 13 Feb 2020 08:04:09 -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=RRBokUDa; 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 S2388017AbgBMQB7 (ORCPT + 99 others); Thu, 13 Feb 2020 11:01:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:38530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728744AbgBMPYh (ORCPT ); Thu, 13 Feb 2020 10:24:37 -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 06BD324691; Thu, 13 Feb 2020 15:24:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607473; bh=ACjKYz9A2d8Fi5hQbocr4bi/V9Cmxvl3mDGZ6dQiI0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RRBokUDaFc8xLEg2O3NjOgYMvgH7fNIDcvXBMYM8n1nI7ULorYyJRCymIOJ+UFgBk nAPS1XNHd0CtXkZnYBECrI7Dl2/xJWwPDKvmPerFQxrI1YA+2qrMeTzApmNnS9JQU9 kUH7H2daHf3u3BZboB9x8DIvd01HYf7/zcEpi+sY= 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.14 003/173] x86/cpu: Update cached HLE state on write to TSX_CTRL_CPUID_CLEAR Date: Thu, 13 Feb 2020 07:18:26 -0800 Message-Id: <20200213151932.921960415@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151931.677980430@linuxfoundation.org> References: <20200213151931.677980430@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 3e20d322bc98b..032509adf9de9 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