linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maria Dimakopoulou <maria.n.dimakopoulou@gmail.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Stephane Eranian <eranian@google.com>, x86-ml <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	"mingo@elte.hu" <mingo@elte.hu>,
	"ak@linux.intel.com" <ak@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>,
	kan.liang@intel.com
Subject: Re: [PATCH v3 13/13] perf/x86: add syfs entry to disable HT bug workaround
Date: Tue, 18 Nov 2014 17:01:28 +0200	[thread overview]
Message-ID: <CAHzUATiZPYNt5nQ82TmCGH9mz0-Y-T6UFdo+0xHpYNcMFBnfZw@mail.gmail.com> (raw)
In-Reply-To: <20141117230232.GC25157@pd.tnic>

On Tue, Nov 18, 2014 at 1:02 AM, Borislav Petkov <bp@alien8.de> wrote:
> On Mon, Nov 17, 2014 at 08:07:05PM +0100, Stephane Eranian wrote:
>> From: Maria Dimakopoulou <maria.n.dimakopoulou@gmail.com>
>>
>> This patch adds a sysfs entry:
>>
>>       /sys/devices/cpu/ht_bug_workaround
>>
>> to activate/deactivate the PMU HT bug workaround.
>>
>> To activate (activated by default):
>>  # echo 1 > /sys/devices/cpu/ht_bug_workaround
>>
>> To deactivate:
>>  # echo 0 > /sys/devices/cpu/ht_bug_workaround
>
> If I put my simple-user hat and stare at this sysfs node, I'm not really
> becoming any smarter from looking at the name. HT bug? A hyper-threading
> bug?? I see the user forums going nuts already.
>
OK. We can call it perf_pmu_ht_bug_workaround to make this more explicit.

The other thing we will do in V4 is to make the file disappear if HT
is off because
the problem does not exist in that case.

> Instead of adding a sysfs node per CPU bug, I'm wondering whether adding
> a
>
>         /sys/devices/system/cpu/bugs
>
> file which gets a mask of bits to enable and disable workarounds would
> be much cleaner.
>
> x86 guys, what do you guys think?
>
> Such a scheme should be much more easily extensible in the future in
> case we want to add another workaround toggle.
>
> The hierarchy is not optimal either as it should be under
> "perf"-something but I don't think we have a perf sysfs node...
>
>> Results effective only once there is no more active
>> events.
>>
>> Reviewed-by: Stephane Eranian <eranian@google.com>
>> Signed-off-by: Maria Dimakopoulou <maria.n.dimakopoulou@gmail.com>
>> ---
>
> ...
>
>>  static DEVICE_ATTR(rdpmc, S_IRUSR | S_IWUSR, get_attr_rdpmc, set_attr_rdpmc);
>> +static DEVICE_ATTR(ht_bug_workaround, S_IRUSR | S_IWUSR, get_attr_xsu,
>> +                set_attr_xsu);
>>
>>  static struct attribute *x86_pmu_attrs[] = {
>>       &dev_attr_rdpmc.attr,
>> +     &dev_attr_ht_bug_workaround.attr,
>
> You should be adding this dynamically, only when running on Intel, i.e.
>
>         if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
>                 /* add bug_workaround attr */
>
> For an example, see amd_l3_attrs() in
> arch/x86/kernel/cpu/intel_cacheinfo.c
>
> Thanks.
>
> --
> Regards/Gruss,
>     Boris.
>
> Sent from a fat crate under my desk. Formatting is fine.
> --

  parent reply	other threads:[~2014-11-18 15:01 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17 19:06 [PATCH v3 00/13] perf/x86: implement HT counter corruption workaround Stephane Eranian
2014-11-17 19:06 ` [PATCH v3 01/13] perf,x86: rename er_flags to flags Stephane Eranian
2015-04-02 18:41   ` [tip:perf/core] perf/x86: Rename x86_pmu::er_flags to 'flags' tip-bot for Stephane Eranian
2014-11-17 19:06 ` [PATCH v3 02/13] perf/x86: vectorize cpuc->kfree_on_online Stephane Eranian
2015-04-02 18:41   ` [tip:perf/core] perf/x86: Vectorize cpuc->kfree_on_online tip-bot for Stephane Eranian
2014-11-17 19:06 ` [PATCH v3 03/13] perf/x86: add 3 new scheduling callbacks Stephane Eranian
2015-04-02 18:42   ` [tip:perf/core] perf/x86: Add " tip-bot for Maria Dimakopoulou
2014-11-17 19:06 ` [PATCH v3 04/13] perf/x86: add index param to get_event_constraint() callback Stephane Eranian
2015-04-02 18:42   ` [tip:perf/core] perf/x86: Add 'index' " tip-bot for Stephane Eranian
2014-11-17 19:06 ` [PATCH v3 05/13] perf/x86: add cross-HT counter exclusion infrastructure Stephane Eranian
2015-04-02 18:42   ` [tip:perf/core] perf/x86/intel: Add " tip-bot for Maria Dimakopoulou
2014-11-17 19:06 ` [PATCH v3 06/13] perf/x86: implement cross-HT corruption bug workaround Stephane Eranian
2015-04-02 18:43   ` [tip:perf/core] perf/x86/intel: Implement " tip-bot for Maria Dimakopoulou
2014-11-17 19:06 ` [PATCH v3 07/13] perf/x86: enforce HT bug workaround for SNB/IVB/HSW Stephane Eranian
2015-04-02 18:43   ` [tip:perf/core] perf/x86/intel: Enforce HT bug workaround for SNB /IVB/HSW tip-bot for Maria Dimakopoulou
2014-11-17 19:07 ` [PATCH v3 08/13] perf/x86: enforce HT bug workaround with PEBS for SNB/IVB/HSW Stephane Eranian
2015-04-02 18:43   ` [tip:perf/core] perf/x86/intel: Enforce " tip-bot for Maria Dimakopoulou
2014-11-17 19:07 ` [PATCH v3 09/13] perf/x86: fix intel_get_event_constraints() for dynamic constraints Stephane Eranian
2015-04-02 18:43   ` [tip:perf/core] perf/x86/intel: Fix " tip-bot for Stephane Eranian
2014-11-17 19:07 ` [PATCH v3 10/13] perf/x86: limit to half counters to avoid exclusive mode starvation Stephane Eranian
2015-04-02 18:44   ` [tip:perf/core] perf/x86/intel: Limit to half counters when the HT workaround is enabled, " tip-bot for Stephane Eranian
2014-11-17 19:07 ` [PATCH v3 11/13] watchdog: add watchdog enable/disable all functions Stephane Eranian
2015-04-02 18:44   ` [tip:perf/core] watchdog: Add watchdog enable/ disable " tip-bot for Stephane Eranian
2014-11-17 19:07 ` [PATCH v3 12/13] perf/x86: make HT bug workaround conditioned on HT enabled Stephane Eranian
2015-04-02 18:44   ` [tip:perf/core] perf/x86/intel: Make the HT bug workaround conditional " tip-bot for Stephane Eranian
2014-11-17 19:07 ` [PATCH v3 13/13] perf/x86: add syfs entry to disable HT bug workaround Stephane Eranian
2014-11-17 23:02   ` Borislav Petkov
2014-11-17 23:38     ` Thomas Gleixner
2014-11-17 23:58       ` Borislav Petkov
2014-11-18  0:31         ` Thomas Gleixner
2014-11-18 15:29           ` Stephane Eranian
2014-11-18 15:43             ` Borislav Petkov
2014-11-18 16:37               ` Stephane Eranian
2014-11-18 16:42                 ` Borislav Petkov
2014-11-18 15:01     ` Maria Dimakopoulou [this message]
2014-11-18 15:12       ` Borislav Petkov

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=CAHzUATiZPYNt5nQ82TmCGH9mz0-Y-T6UFdo+0xHpYNcMFBnfZw@mail.gmail.com \
    --to=maria.n.dimakopoulou@gmail.com \
    --cc=ak@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).