From: Thomas Gleixner <tglx@linutronix.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: kan.liang@intel.com, mingo@redhat.com, acme@kernel.org,
linux-kernel@vger.kernel.org, eranian@google.com,
jolsa@kernel.org, ak@linux.intel.com
Subject: Re: [PATCH 1/3] perf/x86: add sysfs entry to freeze counter on SMI
Date: Fri, 24 Mar 2017 09:31:25 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.20.1703240929030.3688@nanos> (raw)
In-Reply-To: <20170323203255.kps67homffxhl3cv@hirez.programming.kicks-ass.net>
On Thu, 23 Mar 2017, Peter Zijlstra wrote:
> On Thu, Mar 23, 2017 at 11:25:49AM -0700, kan.liang@intel.com wrote:
> > + for_each_possible_cpu(cpu) {
> > + rdmsrl_on_cpu(cpu, MSR_IA32_DEBUGCTLMSR, &debugctlmsr);
> > + if (val)
> > + wrmsrl_on_cpu(cpu, MSR_IA32_DEBUGCTLMSR, debugctlmsr | DEBUGCTLMSR_FREEZE_WHILE_SMM);
> > + else
> > + wrmsrl_on_cpu(cpu, MSR_IA32_DEBUGCTLMSR, debugctlmsr & ~DEBUGCTLMSR_FREEZE_WHILE_SMM);
> > + }
>
> No; that's just disgusting. Also {rd,wr}msr_on_cpu() should die, exactly
> because people end up writing crap like this.
Aside of that this is completely broken against other users of DEBUGCTLMSR
because it's not atomic vs. the other modifications.
Thanks,
tglx
next prev parent reply other threads:[~2017-03-24 8:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-23 18:25 [PATCH 0/3]measure SMI cost kan.liang
2017-03-23 18:25 ` [PATCH 1/3] perf/x86: add sysfs entry to freeze counter on SMI kan.liang
2017-03-23 20:31 ` Peter Zijlstra
2017-03-23 20:48 ` Liang, Kan
2017-03-23 22:23 ` Andi Kleen
2017-03-24 8:16 ` Peter Zijlstra
2017-03-23 20:32 ` Peter Zijlstra
2017-03-24 8:31 ` Thomas Gleixner [this message]
2017-03-24 14:15 ` Liang, Kan
2017-03-24 14:23 ` Peter Zijlstra
2017-03-23 18:25 ` [PATCH 2/3] tools lib api fs: Add sysfs__write_int function kan.liang
2017-03-28 3:38 ` Elliott, Robert (Persistent Memory)
2017-03-23 18:25 ` [PATCH 3/3] perf stat: Add support to measure SMI cost kan.liang
2017-03-24 8:44 ` [PATCH 0/3]measure " Thomas Gleixner
2017-03-24 11:40 ` Andi Kleen
2017-03-24 12:07 ` Thomas Gleixner
2017-03-24 14:14 ` Liang, Kan
2017-03-31 21:51 ` Stephane Eranian
2017-04-01 1:41 ` Liang, Kan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1703240929030.3688@nanos \
--to=tglx@linutronix.de \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=eranian@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®