Re: [PATCH 1/7] x86/entry: Fix #UD vs WARN more

From: Andy Lutomirski
Date: Wed Jun 24 2020 - 18:37:51 EST


On Mon, Jun 22, 2020 at 4:47 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> On Thu, Jun 18, 2020 at 11:18:23PM +0200, Peter Zijlstra wrote:
>
> > > So maybe also do an untraced cond_local_irq_enable()? After all, if
> > > weâre trying to report a bug from IRQs on, it should be okay to have
> > > IRQs on while reporting it. It might even work better than having IRQs
> > > off.
> >
> > Yes, very good point. Now I want to go look at the old code... I'll frob
> > something tomorrow, brain is pretty fried by now.
>
> How's this then?
>
> ---
> Subject: x86/entry: Fix #UD vs WARN more
> From: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Date: Tue Jun 16 13:28:36 CEST 2020
>
> vmlinux.o: warning: objtool: exc_invalid_op()+0x47: call to probe_kernel_read() leaves .noinstr.text section
>
> Since we use UD2 as a short-cut for 'CALL __WARN', treat it as such.
> Have the bare exception handler do the report_bug() thing.
>
> Fixes: 15a416e8aaa7 ("x86/entry: Treat BUG/WARN as NMI-like entries")

Acked-by: Andy Lutomirski <luto@xxxxxxxxxx>