[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrUEsKt=CyM634Lp265hjJg0Jm==gvN_-_UwGp9S6Mt=MA@mail.gmail.com>
Date: Wed, 3 Jul 2019 15:26:47 -0700
From: Andy Lutomirski <luto@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Andy Lutomirski <luto@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...en8.de>, Ingo Molnar <mingo@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"H. Peter Anvin" <hpa@...or.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Juergen Gross <jgross@...e.com>,
LKML <linux-kernel@...r.kernel.org>,
He Zhe <zhe.he@...driver.com>,
Joel Fernandes <joel@...lfernandes.org>, devel@...ukata.com
Subject: Re: [PATCH 3/3] x86/mm, tracing: Fix CR2 corruption
On Wed, Jul 3, 2019 at 3:01 PM Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Wed, Jul 03, 2019 at 01:27:09PM -0700, Andy Lutomirski wrote:
> > On Wed, Jul 3, 2019 at 3:28 AM root <peterz@...radead.org> wrote:
>
> > > @@ -1338,18 +1347,9 @@ ENTRY(error_entry)
> > > movq %rax, %rsp /* switch stack */
> > > ENCODE_FRAME_POINTER
> > > pushq %r12
> > > -
> > > - /*
> > > - * We need to tell lockdep that IRQs are off. We can't do this until
> > > - * we fix gsbase, and we should do it before enter_from_user_mode
> > > - * (which can take locks).
> > > - */
> > > - TRACE_IRQS_OFF
> >
> > This hunk looks wrong. Am I missing some other place that handles the
> > case where we enter from kernel mode and IRQs were on?
>
> > > - CALL_enter_from_user_mode
> > > ret
> > >
> > > .Lerror_entry_done:
> > > - TRACE_IRQS_OFF
> > > ret
> > >
> > > /*
>
> Did you perchance mean to complain about the .Lerror_entry_done one?
Yes, duh.
I would suggest compiling with DEBUG_LOCKDEP and running perf and the
x86 selftests. IIRC that's what catches most of the IRQ flag tracing
errors.
>
> Because I'm not seeing how the one before CALL_enter_from_user_mode can
> ever be from-kernel.
>
> But yes, that .Lerror_entry_done one looks fishy.
Powered by blists - more mailing lists