All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: mingo@kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, eranian@google.com,
	Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH 1/2] Fix perf LBR filtering
Date: Thu, 25 Apr 2013 18:25:35 +0200	[thread overview]
Message-ID: <20130425162535.GA5828@dyad.programming.kicks-ass.net> (raw)
In-Reply-To: <1366844694-2770-1-git-send-email-andi@firstfloor.org>

On Wed, Apr 24, 2013 at 04:04:53PM -0700, Andi Kleen wrote:
> Possible options:
> 
> I) Disable FAR calls for ANY_CALL/RETURNS.
> This just means syscalls are not logged
> as calls. This also lowers the overhead of call logging.
> This changes semantics slightly.
> This is reasonable on Sandy Bridge and later, but would
> cause additional problems on Nehalem and Westmere with
> their additional filters.
> 
> II) Simple disable any filtering for kernel space.
> This means interrupts in kernel space are reported as calls
> and on Nehalem/Westmere some indirect jumps are reported
> as calls too
> 
> III) Enumerate all the kernel entry points and check.
> Any bad call must have a kernel entry point as to.
> This seemed to fragile to maintain.
> 
> IV) Enumerate all kernel code and check for these ranges.
> Quite complicated, especially with the new kernel code JITs.
> Would also allow to probe for kernel code (defeating randomized kernel)

So why not do the same as we do for userspace? Copy MAX_INSN_SIZE bytes
and trap -EFAULT.

With Steven's recent NMI nesting stuff we should be able to take the fault and
do the fixup_exception() thing. Or alternatively we could software walk the
kernel pagetables.


  parent reply	other threads:[~2013-04-25 16:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-24 23:04 [PATCH 1/2] Fix perf LBR filtering Andi Kleen
2013-04-24 23:04 ` [PATCH 2/2] perf, x86: Don't allow unusual PEBS raw flags Andi Kleen
2013-04-29 22:16   ` Stephane Eranian
2013-04-29 22:34     ` Andi Kleen
2013-04-29 23:05       ` Stephane Eranian
2013-05-02  7:37   ` Peter Zijlstra
2013-05-06 17:44     ` Stephane Eranian
2013-05-06 18:52       ` Peter Zijlstra
2013-05-06 22:43         ` Stephane Eranian
2013-05-07  6:48           ` Ingo Molnar
2013-05-07  8:48             ` Peter Zijlstra
2013-05-07 11:04               ` Ingo Molnar
2013-05-07  8:43           ` Peter Zijlstra
2013-04-24 23:20 ` [PATCH 1/2] Fix perf LBR filtering Ben Hutchings
2013-04-24 23:24 ` Greg KH
2013-04-25 16:25 ` Peter Zijlstra [this message]
2013-04-25 16:41   ` Andi Kleen
2013-04-25 16:48     ` Peter Zijlstra
2013-04-25 17:00       ` Andi Kleen
2013-04-25 17:18         ` Peter Zijlstra
2013-04-25 17:42           ` Andi Kleen
2013-04-26  7:56             ` Peter Zijlstra
2013-04-26 19:46               ` Andi Kleen
2013-05-01 11:51                 ` Ingo Molnar
2013-05-01 11:55                   ` Ingo Molnar

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=20130425162535.GA5828@dyad.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=stable@vger.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 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.