All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: speck@linutronix.de
Subject: [MODERATED] Re: [PATCH v2 0/8] PERFv2
Date: Thu, 7 Feb 2019 16:33:30 +0100	[thread overview]
Message-ID: <20190207153330.GD32477@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190207143759.GP31598@tassilo.jf.intel.com>

On Thu, Feb 07, 2019 at 06:37:59AM -0800, speck for Andi Kleen wrote:
> > A few questions:
> > 
> >  - How will this 'feature' interact with MSR_CORE_PERF_GLOBAL_CTRL ?
> 
> It's completely independent of GLOBAL_CTRL on the software level.
> Internally it uses it, but it shouldn't be software visible.

So if you write GLOBAL_CTRL=0 and then use RTM instructions, the ucode
doesn't set GLOBAL_CTRL.3 = 1 ? It would have to, otherwise I don't see
how it would work.

> >  - Is having GLOBAL_CTRL.3 0 and not using RTM instructions enough
> >    guarantee to avoid PMC3 from being clobbered?
> 
> With no use of RTM clobbering should be fairly unlikely,
> but in theory it could happen if RETPOLINE is not used
> (due to an indirect branch mistakenenly executing something
> that looks like XBEGIN). If we assume that RETPOLINE 
> is used I believe it shouldn't happen in the kernel at least.
> Even without RETPOLINE such a case should be fairly unlikely,
> but cannot be 100% ruled out.
> 
> > Esp. that latter question, because both your patches and the below seems
> > to rely on that; and if the answer is yet, the below can be further
> > simplified.
> 
> I don't see how I rely on that?

Your, like my earlier patch, hooks into x86_pmu.enable_event, but if you
look at x86_pmu_start(), we only call that _after_
x86_perf_event_set_period() which would program CNTVAL3.

If we cannot rely on the PMC3 state being stable, we have to add a hook.

  reply	other threads:[~2019-02-07 15:33 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-06  1:23 [MODERATED] [PATCH v2 0/8] PERFv2 Andi Kleen
2019-02-06  1:23 ` [MODERATED] [PATCH v2 1/8] PERFv2 Andi Kleen
2019-02-07 23:11   ` [MODERATED] " Konrad Rzeszutek Wilk
2019-02-06  1:23 ` [MODERATED] [PATCH v2 2/8] PERFv2 Andi Kleen
2019-02-06  1:23 ` [MODERATED] [PATCH v2 3/8] PERFv2 Andi Kleen
2019-02-06 19:07   ` [MODERATED] " Andi Kleen
2019-02-06  1:23 ` [MODERATED] [PATCH v2 4/8] PERFv2 Andi Kleen
2019-02-06  3:55   ` [MODERATED] " Andi Kleen
2019-02-06  1:23 ` [MODERATED] [PATCH v2 5/8] PERFv2 Andi Kleen
2019-02-06  1:24 ` [MODERATED] [PATCH v2 6/8] PERFv2 Andi Kleen
2019-02-06  1:24 ` [MODERATED] [PATCH v2 7/8] PERFv2 Andi Kleen
2019-02-06  1:24 ` [MODERATED] [PATCH v2 8/8] PERFv2 Andi Kleen
2019-02-06 19:10 ` [MODERATED] Re: [PATCH v2 0/8] PERFv2 Andi Kleen
2019-02-07 13:27 ` Peter Zijlstra
2019-02-07 13:33   ` Peter Zijlstra
2019-02-07 13:48     ` Peter Zijlstra
2019-02-07 14:39     ` Andi Kleen
2019-02-07 14:37   ` Andi Kleen
2019-02-07 15:33     ` Peter Zijlstra [this message]
2019-02-07 15:51       ` Andrew Cooper
2019-02-07 16:35       ` Andi Kleen
2019-02-07 15:37     ` Peter Zijlstra
2019-02-07 16:20       ` Andi Kleen
2019-02-07 16:49         ` Peter Zijlstra
2019-02-07 21:55           ` Andi Kleen
2019-02-07 16:35       ` Andrew Cooper
2019-02-07 17:00         ` Peter Zijlstra
2019-02-07 17:55           ` Andrew Cooper
2019-02-07 22:04           ` Andi Kleen
2019-02-07 22:45             ` Andrew Cooper
2019-02-07 16:01     ` Peter Zijlstra

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=20190207153330.GD32477@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=speck@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.