mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: kan.liang@intel.com, alexander.shishkin@linux.intel.com,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 2/3] x86 perf: Protect LBR msrs accessing against potential #GP
Date: Fri, 1 Aug 2014 20:50:57 +0200	[thread overview]
Message-ID: <20140801185057.GK19379@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20140801132120.GO18735@two.firstfloor.org>

[-- Attachment #1: Type: text/plain, Size: 2600 bytes --]

On Fri, Aug 01, 2014 at 03:21:20PM +0200, Andi Kleen wrote:
> > > NAK!
> > > 
> > > I already said this isn't going to ever happen.
> > > 
> > > Both PT and LBR are arbitrated through the kernel, therefore we can (and
> > > must) deny PT when there's existing LBR usage and vice versa.
> > > 
> > > We will not hijack resources like this full stop end of story.
> > > 
> > > Fuck hardware/BIOS, they should _NOT_ be touching this.
> > > 
> > > The 3 people in the world with access to an x86 hardware debugger had
> > > better be competent and know WTF they're doing and the BIOS can just
> > > piss off right now, they should not be touching this _EVER_.
> 
> 
> So you realize that hardware level debugging becomes impossible
> if everyone starts using perf?

That only becomes a problem if you need to hardware debug something that
uses LBR/BTS (in the current state or things).

Now, by doing the patch you did, you already change behaviour by having
PT enabled, and therefore you already couldn't.

So this is an explicit blind spot for the hardware debugger, that seems
like a bad idea anyhow.

The things is, with or without this patch you cannot debug LBR using
software.

> I dont know how anyone can construct essentially sabotaging powerful
> debugging techniques ever as a good thing. In the end it'll just
> lead to more buggy software (and likely hardware) for everyone.

How about you see it as an attempt to improve things by not having
arbitrary and limiting blind spots like that?

A hardware debugger should be able to debug everything, including LBR
using software.

> > I yelled at BIOS engineers over their PMU usage and $vendor added a BIOS
> > knob to disable that, I'll yell at BIOS engineers again, just give me
> > their number.
> > 
> > Really, say NO already.
> 
> Ok, so no technical reason, merely a "me vs you" power play.

Clearly you forgot the discussion we had back then, you want me to find
you a link or do you think you can Google it yourself? I'm not the only
one who thinks its a terrible idea for the BIOS to involve itself in
these things.

> Thank you for not stating that earlier and wasting everyone's time.

Oh, so you thing its entirely reasonable for a BIOS to use PMU features
then? I suppose you do since you wrote that silly document back then
about 'sharing' things.

We should be limiting the things the BIOS does, because the BIOS will
get it wrong and then we have to spend ages working around it. There's
enough BIOS wreckage to deal with, don't encourage them to make more.



[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-08-01 18:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-31  9:41 [PATCH 1/3] x86 msr: msr goto extension support kan.liang
2014-07-31  9:41 ` [PATCH 2/3] x86 perf: Protect LBR msrs accessing against potential #GP kan.liang
2014-08-01  7:38   ` Peter Zijlstra
2014-08-01  7:44     ` Peter Zijlstra
2014-08-01 13:21       ` Andi Kleen
2014-08-01 18:50         ` Peter Zijlstra [this message]
2014-08-02  5:27           ` Ingo Molnar
2014-07-31  9:41 ` [PATCH 3/3] x86 perf: Protect LBR and BTS enabling kan.liang
2014-07-31 21:05 ` [PATCH 1/3] x86 msr: msr goto extension support Andy Lutomirski
2014-08-01  8:05   ` 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=20140801185057.GK19379@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome