Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1246750ybl; Fri, 10 Jan 2020 14:54:55 -0800 (PST) X-Google-Smtp-Source: APXvYqxy6qon5/bvVygJWx2oLob+qyNCChPKUDP0vb0RIBEIXElzgerqJbPzLVdLV1vvlS6kh04k X-Received: by 2002:a05:6808:c:: with SMTP id u12mr4214739oic.107.1578696895000; Fri, 10 Jan 2020 14:54:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578696894; cv=none; d=google.com; s=arc-20160816; b=vnJc/RMXGewpqJ5rnK0Ug4NaVxp9W/1dZRN+NkBF1hmDM2GKoZfcHFnOYjGy9oZzJr GXr+l9pm//zgklv8Tb7YuIDhTYZZnMs+41w+QSRTbqBHw+wyc4vHbzFjBfkCf+hm8Pak 6Sg3U2GvmYDGxf/jlb3K6kO+GQErVHqfbK4JzY7n4+fYbelSHMF890LS7GYDDL/hMRMs YjuLrLLeBEf1PEPH05w6atMb77AFweBYeLLqHm4m0qfSEt+ZJTv6metsSATMUAaWXnMt ZmTNzLFmlevzN6ggnT1mVyMFdBTd9RvCLlEmLy2OI4Thhn2SoDrAF944tVRBb+EysIs0 pBkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date; bh=pTFYHQmeUnGu3DOMv6Io3Qs3DMnGdlX9LntL7aI/RTI=; b=hgL/3eDwQJRXJmlN5Xu4rdRqsezfgGAxtzSbLxjnxQ5+g4FHhH/95lSLLkjtNzdh4/ NbjnqRaF2FW7A9yaaRLky85+7nAnvsWkN2YMgRaUa8Kj+iQ+KPLMa5sim+v3NNVRqTFT V9Urbz0qrSPCnoPqLWwLu8i+9BVlGVo2iGZgzP0sOBDkUY2wPr/HGbEj9qYE7dtszCKU NXlIPqSj4TapKtkn8IpH/sk2LfBIupq+jGMIu36cgc/rGuqkMn0sl1MnrN+LT/O2A6D4 8o39oPLEM5E2IOiLom8azFjOAplbNQgtddlHnbAeB5kKf8IISU3Lb6lb4rKjBIRhjPUG JIWA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u62si1902917oig.29.2020.01.10.14.54.43; Fri, 10 Jan 2020 14:54: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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727444AbgAJWxs (ORCPT + 99 others); Fri, 10 Jan 2020 17:53:48 -0500 Received: from mga17.intel.com ([192.55.52.151]:7143 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726595AbgAJWxs (ORCPT ); Fri, 10 Jan 2020 17:53:48 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jan 2020 14:53:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,418,1571727600"; d="scan'208";a="239045135" Received: from guptapadev.jf.intel.com (HELO guptapadev.amr) ([10.7.198.56]) by orsmga002.jf.intel.com with ESMTP; 10 Jan 2020 14:53:48 -0800 Date: Fri, 10 Jan 2020 14:50:54 -0800 From: Pawan Gupta To: Thomas Gleixner , Borislav Petkov Cc: Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Josh Poimboeuf , Tony Luck , Michal Hocko , linux-kernel@vger.kernel.org, Neelima Krishnan , Dave Hansen , Andi Kleen Subject: [PATCH] x86/cpu: Update cached HLE state on write to TSX_CTRL_CPUID_CLEAR Message-ID: <2529b99546294c893dfa1c89e2b3e46da3369a59.1578685425.git.pawan.kumar.gupta@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org /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 a 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. Signed-off-by: Pawan Gupta Tested-by: Neelima Krishnan Reviewed-by: Dave Hansen --- 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 3e20d322bc98..032509adf9de 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.21.1