Re: [patch V2 08/17] x86/entry: Move syscall irq tracing to C code
From: Andy Lutomirski
Date: Wed Oct 23 2019 - 17:35:35 EST
On Wed, Oct 23, 2019 at 2:30 PM Andy Lutomirski <luto@xxxxxxxxxx> wrote:
>
> On Wed, Oct 23, 2019 at 5:31 AM Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> >
> > Interrupt state tracing can be safely done in C code. The few stack
> > operations in assembly do not need to be covered.
> >
> > Remove the now pointless indirection via .Lsyscall_32_done and jump to
> > swapgs_restore_regs_and_return_to_usermode directly.
>
> This doesn't look right.
>
> > #define SYSCALL_EXIT_WORK_FLAGS \
> > @@ -279,6 +282,9 @@ static void syscall_slow_exit_work(struc
> > {
> > struct thread_info *ti;
> >
> > + /* User to kernel transition disabled interrupts. */
> > + trace_hardirqs_off();
> > +
>
> So you just traced IRQs off, but...
>
> > enter_from_user_mode();
> > local_irq_enable();
>
> Now they're on and traced on again?
>
> I also don't see how your patch handles the fastpath case.
>
> How about the attached patch instead?
Ignore the attached patch. You have this in your
do_exit_to_usermode() later in the series. But I'm still quite
confused by this patch.