From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933562AbdHYPLC (ORCPT ); Fri, 25 Aug 2017 11:11:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:32790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933501AbdHYPLA (ORCPT ); Fri, 25 Aug 2017 11:11:00 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95DEA21A1A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Fri, 25 Aug 2017 11:10:57 -0400 From: Steven Rostedt To: Thomas Gleixner Cc: LKML , Ingo Molnar , Peter Anvin , Peter Zijlstra , Andy Lutomirski , Borislav Petkov Subject: Re: [patch 06/41] x86/traps: Simplify pagefault tracing logic Message-ID: <20170825111057.78cb2b10@gandalf.local.home> In-Reply-To: <20170825104413.434023371@linutronix.de> References: <20170825103103.287814238@linutronix.de> <20170825104413.434023371@linutronix.de> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 25 Aug 2017 12:31:09 +0200 Thomas Gleixner wrote: > dotraplinkage void notrace > -trace_do_page_fault(struct pt_regs *regs, unsigned long error_code) > +do_page_fault(struct pt_regs *regs, unsigned long error_code) > { > + unsigned long address = read_cr2(); /* Get the faulting address */ > + enum ctx_state prev_state; > + > /* > - * The exception_enter and tracepoint processing could > - * trigger another page faults (user space callchain > - * reading) and destroy the original cr2 value, so read > - * the faulting address now. > + * We must have this function tagged with __kprobes, notrace and call > + * read_cr2() before calling anything else. To avoid calling any kind > + * of tracing machinery before we've observed the CR2 value. > + * > + * exception_{enter,exit}() contain all sorts of tracepoints. > */ > - unsigned long address = read_cr2(); > - enum ctx_state prev_state; > + if (trace_irqvectors_enabled()) > + trace_page_fault_entries(address, regs, error_code); > > prev_state = exception_enter(); > - trace_page_fault_entries(address, regs, error_code); I believe you need to keep the tracing after the "exception_enter()", as for NO_HZ_FULL, that enables RCU again, and the tracepoint needs RCU enabled. -- Steve > __do_page_fault(regs, error_code, address); > exception_exit(prev_state); > } > -NOKPROBE_SYMBOL(trace_do_page_fault); > -#endif /* CONFIG_TRACING */ > +NOKPROBE_SYMBOL(do_page_fault); >