From: Andi Kleen <ak@linux.intel.com>
To: speck@linutronix.de
Subject: [MODERATED] Re: [PATCH v2 0/8] PERFv2
Date: Thu, 7 Feb 2019 06:37:59 -0800 [thread overview]
Message-ID: <20190207143759.GP31598@tassilo.jf.intel.com> (raw)
In-Reply-To: <20190207132709.GA32477@hirez.programming.kicks-ass.net>
> 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.
> - 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?
In fact I avoided some simple optimizations to not rely on it, but only
ever use counter 3 after the MSR write.
>
> So what (aside from being _completely_ untested and not doing virt crap)
> is wrong with the below? It sure as heck is simpler.
> +static struct event_constraint *
> +skl_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
> + struct perf_event *event)
> +{
> + struct event_constraint *c;
> +
> + c = hsw_get_event_constraints(cpuc, idx, event);
> +
> + if (!force_rtm_abort) {
> + /*
> + * Without TFA we must not use PMC3.
> + */
> + c->idxmsk64 &= ~(1ULL << 3);
Doesn't that overwrite the global shared constraints constraints?
Would need to make them non const at least, it will likely fault.
Okay I see you rely on it being guarded by the global, but for virtualization
support will need the copy.
Would need a copy at least.
Other than that there doesn't seem to be anything obviously wrong.
I will do some testing/checking and readd the opt-in/opt-out interfaces.
-Andi
next prev parent reply other threads:[~2019-02-07 14:38 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 [this message]
2019-02-07 15:33 ` Peter Zijlstra
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=20190207143759.GP31598@tassilo.jf.intel.com \
--to=ak@linux.intel.com \
--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.