Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753301AbdC1RDZ (ORCPT ); Tue, 28 Mar 2017 13:03:25 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:53045 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752059AbdC1RDX (ORCPT ); Tue, 28 Mar 2017 13:03:23 -0400 Date: Tue, 28 Mar 2017 19:03:07 +0200 (CEST) From: Thomas Gleixner To: "Liang, Kan" cc: "peterz@infradead.org" , "mingo@redhat.com" , "linux-kernel@vger.kernel.org" , "bp@alien8.de" , "acme@kernel.org" , "eranian@google.com" , "jolsa@kernel.org" , "ak@linux.intel.com" Subject: RE: [PATCH V3 2/2] perf/x86: add sysfs entry to freeze counter on SMI In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F077536C61D3@SHSMSX103.ccr.corp.intel.com> Message-ID: References: <1490639448-4147-1-git-send-email-kan.liang@intel.com> <1490639448-4147-3-git-send-email-kan.liang@intel.com> <37D7C6CF3E00A74B8858931C1DB2F077536C61D3@SHSMSX103.ccr.corp.intel.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 723 Lines: 24 On Tue, 28 Mar 2017, Liang, Kan wrote: > > On Mon, 27 Mar 2017, kan.liang@intel.com wrote: > > put_online_cpus(); > > > > Aside of that, when this is set to SMI freeze, what causes a CPU which > > comes online after that point to set the bit as well? Nothing AFAICT. > > I've patched the intel_pmu_cpu_starting. > I think it guarantees that the new online CPU is set. Only when the hotplug protection of the write is in place..... > @@ -3174,6 +3174,11 @@ static void intel_pmu_cpu_starting(int cpu) > > cpuc->lbr_sel = NULL; > > + if (x86_pmu.attr_freeze_on_smi) > + msr_set_bit_on_cpu(cpu, MSR_IA32_DEBUGCTLMSR, DEBUGCTLMSR_FREEZE_WHILE_SMM_BIT); Can you please use brackets and line breaks? Thanks, tglx