On Mon, 2019-05-13 at 22:44 -0300, Shawn Landden wrote: > + > +/* > + * Were we in user mode when we were > + * interrupted? > + * > + * Doing kernel_altivec/vsx_begin/end() is ok if we are running > + * in an interrupt context from user mode - we'll just > + * save the FPU state as required. > + */ > +static bool interrupted_user_mode(void) > +{ > + struct pt_regs *regs = get_irq_regs(); > + > + return regs && user_mode(regs); > +} > +
That's interesting .... it *could* work but we'll have to careful audit the code to make sure thats ok. We probably also want to handle the case where the CPU is in the idle loop. Do we always save the user state when switching out these days ? If yes, then there's no "live" state to worry about... Cheers, Ben.