mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Ingo Molnar <mingo@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Pekka Paalanen <ppaalanen@gmail.com>, Lyude <lyude@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Karol Herbst <kherbst@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	hpa@zytor.com, linux-tip-commits@vger.kernel.org,
	Karol Herbst <karolherbst@gmail.com>
Subject: Re: [tip:x86/urgent] x86/mm/kmmio: Fix mmiotrace for page unaligned addresses
Date: Tue, 12 Dec 2017 15:43:34 +0100	[thread overview]
Message-ID: <20171212144334.slrpfdtptr5nhuhx@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CAKb7UvjTmD3kswPreN4FZzwt2EfFk04s1QQC63P0jb-BJ5tW9w@mail.gmail.com>

On Tue, Dec 12, 2017 at 09:21:10AM -0500, Ilia Mirkin wrote:
> The "thing" being mmiotrace, or the "thing" being page-unaligned addresses?

mmiotrace

> If the former, its primary use-case is for snooping on the NVIDIA
> proprietary GPU driver in order to figure out how to drive the
> underlying hardware. The driver does ioremap's to get at PCI space,
> which mmiotrace "steals" and provides pages without a present bit set,
> along with a fault handler. When the fault handler is hit, it
> reinstates the faulting page, and single-steps the faulting
> instruction

At which point you have valid page-tables and another CPU can access
that page too.

> reading the before/after regs to determine what happened
> (doesn't work universally, but enough for instructions used for PCI
> MMIO accesses). See mmio-mod.c::pre and post (the latter is called
> from the debug handler).

And after that you only invalidate the TLBs for the CPU that took the
initial fault, leaving possibly stale TLBs on other CPUs.


So this 'thing' has huge gaping SMP holes in.

  reply	other threads:[~2017-12-12 14:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27  7:51 [PATCH] " Karol Herbst
2017-12-12 10:55 ` [tip:x86/urgent] " tip-bot for Karol Herbst
2017-12-12 13:49   ` Peter Zijlstra
2017-12-12 14:04     ` Ingo Molnar
2017-12-12 14:21       ` Ilia Mirkin
2017-12-12 14:43         ` Peter Zijlstra [this message]
2017-12-12 14:47           ` Ilia Mirkin
2017-12-12 14:51             ` Peter Zijlstra
2017-12-13 16:31               ` Steven Rostedt
2017-12-12 14:32       ` Karol Herbst

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=20171212144334.slrpfdtptr5nhuhx@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=hpa@zytor.com \
    --cc=imirkin@alum.mit.edu \
    --cc=karolherbst@gmail.com \
    --cc=kherbst@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=mingo@kernel.org \
    --cc=ppaalanen@gmail.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®