[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1708251711340.1883@nanos>
Date: Fri, 25 Aug 2017 17:11:57 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Steven Rostedt <rostedt@...dmis.org>
cc: LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>, Peter Anvin <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
Borislav Petkov <bp@...en8.de>
Subject: Re: [patch 06/41] x86/traps: Simplify pagefault tracing logic
On Fri, 25 Aug 2017, Steven Rostedt wrote:
> On Fri, 25 Aug 2017 12:31:09 +0200
> Thomas Gleixner <tglx@...utronix.de> 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.
Indeed. Thanks for spotting it.
Powered by blists - more mailing lists