Commit 3e39aa15 authored by Stuart Bennett's avatar Stuart Bennett Committed by Ingo Molnar

x86 mmiotrace: improve handling of secondary faults

Upgrade some kmmio.c debug messages to warnings.
Allow secondary faults on probed pages to fall through, and only log
secondary faults that are not due to non-present pages.

Patch edited by Pekka Paalanen.
Signed-off-by: default avatarStuart Bennett <stuart@freedesktop.org>
Signed-off-by: default avatarPekka Paalanen <pq@iki.fi>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 0b700a6a
...@@ -232,28 +232,32 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr) ...@@ -232,28 +232,32 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr)
ctx = &get_cpu_var(kmmio_ctx); ctx = &get_cpu_var(kmmio_ctx);
if (ctx->active) { if (ctx->active) {
disarm_kmmio_fault_page(faultpage);
if (addr == ctx->addr) { if (addr == ctx->addr) {
/* /*
* On SMP we sometimes get recursive probe hits on the * A second fault on the same page means some other
* same address. Context is already saved, fall out. * condition needs handling by do_page_fault(), the
* page really not being present is the most common.
*/ */
pr_debug("kmmio: duplicate probe hit on CPU %d, for " pr_debug("kmmio: secondary hit for 0x%08lx CPU %d.\n",
"address 0x%08lx.\n", addr, smp_processor_id());
smp_processor_id(), addr);
ret = 1; if (!faultpage->old_presence)
goto no_kmmio_ctx; pr_info("kmmio: unexpected secondary hit for "
} "address 0x%08lx on CPU %d.\n", addr,
smp_processor_id());
} else {
/* /*
* Prevent overwriting already in-flight context. * Prevent overwriting already in-flight context.
* This should not happen, let's hope disarming at least * This should not happen, let's hope disarming at
* prevents a panic. * least prevents a panic.
*/ */
pr_emerg("kmmio: recursive probe hit on CPU %d, " pr_emerg("kmmio: recursive probe hit on CPU %d, "
"for address 0x%08lx. Ignoring.\n", "for address 0x%08lx. Ignoring.\n",
smp_processor_id(), addr); smp_processor_id(), addr);
pr_emerg("kmmio: previous hit was at 0x%08lx.\n", pr_emerg("kmmio: previous hit was at 0x%08lx.\n",
ctx->addr); ctx->addr);
disarm_kmmio_fault_page(faultpage);
}
goto no_kmmio_ctx; goto no_kmmio_ctx;
} }
ctx->active++; ctx->active++;
...@@ -305,7 +309,7 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs) ...@@ -305,7 +309,7 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs)
struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx); struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx);
if (!ctx->active) { if (!ctx->active) {
pr_debug("kmmio: spurious debug trap on CPU %d.\n", pr_warning("kmmio: spurious debug trap on CPU %d.\n",
smp_processor_id()); smp_processor_id());
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment