Re: [PATCH] Make math_state_restore() save and restore the interrupt flag

From: Linus Torvalds
Date: Sat Feb 01 2014 - 19:17:35 EST


On Sat, Feb 1, 2014 at 3:40 PM, H. Peter Anvin <hpa@xxxxxxxxx> wrote:
>
> OK, let's circle back for a bit. We have an active bug, and we clearly
> have a lot of restructuring that could/should be done. We need to fix
> the bug first; if we're going to a bunch of restructuring then that
> ought to be separate. The first bit is how we fix the immediate bug.

So either of my suggested changes to __kernel_fpu_end() _should_ fix
the bug, with the caveat that if we do take the "check tsk-used-math"
version, we had better verify that yes, we allocate the save storage
before we set that flag. One of the reasons I tended to prefer simpler
the "just do stts()" version is that it seemed safer. I am a bit
worried about the whole interaction with synchronous task state and
interrupts.

Suresh's notion of just always allocating the FP state save area at
process creation would fix it too.

So many ways to fix it, so little knowledge about the actual usage
patterns and performance issues..

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/