Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp21438yba; Wed, 3 Apr 2019 03:42:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGZdCiB2ykXMOqABRhje0d/fqcpWnvWfYWYtwvZn1ElEDFk95OpTke4f8YV5tNZBXLhA1p X-Received: by 2002:aa7:82d9:: with SMTP id f25mr11184020pfn.45.1554288159267; Wed, 03 Apr 2019 03:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554288159; cv=none; d=google.com; s=arc-20160816; b=Z822OjyJcPX7VjOq03FyKqXuGsYAAdQbWeuencTy18peFWFIK9zL0n2V55mAuyQ58b D0mhqP+8Geab0J/AT2pPmqEtE2KXIiQSL40Hr2qtgGmxrghubj4oS9cQXP2f9KpYgrfZ YDvKb0/NAhmYvhjyy7fRyXRhwYFYFnK1Rfogu5Vee2PStouJuFM1SMm6lQA8dsMnOvtN 3vHIyhozFvN7Oh9zNy91ZFc9cGpEd8sMgcaa9tQATBaHyjMUGD2OrbI9zxF8mbnIdRoY TJqD13XanjbYLeyhRhG+ncxLL5i6TdTLoDxqRCw/+o88W1f/a4rPWpW8pJF+Fsuv0pWZ GjkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=u0Z9d8Du3Wmk2ojM31FokdcRYsLla02qnesU84GTFTQ=; b=KWLowZrsWbttOkp7gk4jyqiH1yCXIUtV52xOW23Z+Xfz7JBlzMQjeBcQkZC1dgQdHD 7bt9D+q6MfOvCPo7ojl/XQqzPb9qMWuyD1NC1kB9v6n5f9bXor+LhesLtFRLzNrn8iUZ 12JBCEN0t2rgsidWE50qpUQHc8st7Td7UAlbsxI8qvn+jVoUibsaKYg1j/25yF2eHz+D umqA4cXY5T2dMYqNSm6P2po43pI2RMXT3fBfyoDXSU0c6BGcGSwEQLdLfoyT6kk0i/MR uQHUASN1PvIwOjBBz3NMtDKiWFug4Zlf2prkXYuakO4JtsRylayvJVqfefDkxcCGMkjs zBHw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r124si10729419pgr.201.2019.04.03.03.42.24; Wed, 03 Apr 2019 03:42:39 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726775AbfDCKlQ (ORCPT + 99 others); Wed, 3 Apr 2019 06:41:16 -0400 Received: from terminus.zytor.com ([198.137.202.136]:42319 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726263AbfDCKlP (ORCPT ); Wed, 3 Apr 2019 06:41:15 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x33AenBm1812191 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 3 Apr 2019 03:40:49 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x33AemDJ1812187; Wed, 3 Apr 2019 03:40:48 -0700 Date: Wed, 3 Apr 2019 03:40:48 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Peter Zijlstra Message-ID: Cc: linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, peterz@infradead.org, jolsa@redhat.com, nelson.dsouza@intel.com, acme@redhat.com, tglx@linutronix.de, eranian@google.com, vincent.weaver@maine.edu, hpa@zytor.com, torvalds@linux-foundation.org, mingo@kernel.org Reply-To: nelson.dsouza@intel.com, jolsa@redhat.com, linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, peterz@infradead.org, tglx@linutronix.de, vincent.weaver@maine.edu, eranian@google.com, hpa@zytor.com, mingo@kernel.org, torvalds@linux-foundation.org, acme@redhat.com In-Reply-To: <20190321123849.GN6521@hirez.programming.kicks-ass.net> References: <20190321123849.GN6521@hirez.programming.kicks-ass.net> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf/x86/intel: Initialize TFA MSR Git-Commit-ID: d7262457e35dbe239659e62654e56f8ddb814bed X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d7262457e35dbe239659e62654e56f8ddb814bed Gitweb: https://git.kernel.org/tip/d7262457e35dbe239659e62654e56f8ddb814bed Author: Peter Zijlstra AuthorDate: Thu, 21 Mar 2019 13:38:49 +0100 Committer: Ingo Molnar CommitDate: Wed, 3 Apr 2019 11:40:32 +0200 perf/x86/intel: Initialize TFA MSR Stephane reported that the TFA MSR is not initialized by the kernel, but the TFA bit could set by firmware or as a leftover from a kexec, which makes the state inconsistent. Reported-by: Stephane Eranian Tested-by: Nelson DSouza Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Vince Weaver Cc: tonyj@suse.com Link: https://lkml.kernel.org/r/20190321123849.GN6521@hirez.programming.kicks-ass.net Signed-off-by: Ingo Molnar --- arch/x86/events/intel/core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 1539647ea39d..f61dcbef20ff 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -3575,6 +3575,12 @@ static void intel_pmu_cpu_starting(int cpu) cpuc->lbr_sel = NULL; + if (x86_pmu.flags & PMU_FL_TFA) { + WARN_ON_ONCE(cpuc->tfa_shadow); + cpuc->tfa_shadow = ~0ULL; + intel_set_tfa(cpuc, false); + } + if (x86_pmu.version > 1) flip_smm_bit(&x86_pmu.attr_freeze_on_smi);