aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/kmmio.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mm/kmmio.c')
-rw-r--r--arch/x86/mm/kmmio.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c
index d29777520af3..4c66bd3a240d 100644
--- a/arch/x86/mm/kmmio.c
+++ b/arch/x86/mm/kmmio.c
@@ -232,28 +232,32 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr)
232 232
233 ctx = &get_cpu_var(kmmio_ctx); 233 ctx = &get_cpu_var(kmmio_ctx);
234 if (ctx->active) { 234 if (ctx->active) {
235 disarm_kmmio_fault_page(faultpage);
236 if (addr == ctx->addr) { 235 if (addr == ctx->addr) {
237 /* 236 /*
238 * On SMP we sometimes get recursive probe hits on the 237 * A second fault on the same page means some other
239 * same address. Context is already saved, fall out. 238 * condition needs handling by do_page_fault(), the
239 * page really not being present is the most common.
240 */ 240 */
241 pr_debug("kmmio: duplicate probe hit on CPU %d, for " 241 pr_debug("kmmio: secondary hit for 0x%08lx CPU %d.\n",
242 "address 0x%08lx.\n", 242 addr, smp_processor_id());
243 smp_processor_id(), addr); 243
244 ret = 1; 244 if (!faultpage->old_presence)
245 goto no_kmmio_ctx; 245 pr_info("kmmio: unexpected secondary hit for "
246 } 246 "address 0x%08lx on CPU %d.\n", addr,
247 /* 247 smp_processor_id());
248 * Prevent overwriting already in-flight context. 248 } else {
249 * This should not happen, let's hope disarming at least 249 /*
250 * prevents a panic. 250 * Prevent overwriting already in-flight context.
251 */ 251 * This should not happen, let's hope disarming at
252 pr_emerg("kmmio: recursive probe hit on CPU %d, " 252 * least prevents a panic.
253 */
254 pr_emerg("kmmio: recursive probe hit on CPU %d, "
253 "for address 0x%08lx. Ignoring.\n", 255 "for address 0x%08lx. Ignoring.\n",
254 smp_processor_id(), addr); 256 smp_processor_id(), addr);
255 pr_emerg("kmmio: previous hit was at 0x%08lx.\n", 257 pr_emerg("kmmio: previous hit was at 0x%08lx.\n",
256 ctx->addr); 258 ctx->addr);
259 disarm_kmmio_fault_page(faultpage);
260 }
257 goto no_kmmio_ctx; 261 goto no_kmmio_ctx;
258 } 262 }
259 ctx->active++; 263 ctx->active++;
@@ -305,7 +309,7 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs)
305 struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx); 309 struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx);
306 310
307 if (!ctx->active) { 311 if (!ctx->active) {
308 pr_debug("kmmio: spurious debug trap on CPU %d.\n", 312 pr_warning("kmmio: spurious debug trap on CPU %d.\n",
309 smp_processor_id()); 313 smp_processor_id());
310 goto out; 314 goto out;
311 } 315 }