Subject: Re: Kernel oops with 2.6.26, padlock and ipsec: probably problem with fpu state changes

From: "H. Peter Anvin" <[email-masked]>
Date: Sat, 09 Aug 2008 09:10:05 -0700

Wolfgang Walter wrote:
> How could any kernel code use MMX/SSE/FPU when the interrupt case isn't 
> handled?

I don't think we have ever allowed MMX/SSE/FPU code in interrupt 
handlers.  kernel_fpu_begin()..end() lock out preemption, and so could 
only be interrupted, not preempted.

> Or is your argument that its lazy allocation itself is the problem: this 
> nesting could always happen and was a bug but only with lazy allocation it is 
> dangerous (as it may cause a spurious math fault in the race window).
> 
> If this were right than any kernel code executing SSE may trigger now a oops 
> in __switch_to() under some special circumstances.

If lazy allocation can cause the RAID code, for example (which executes 
SSE instructions in the kernel, but not at interrupt time) to start 
randomly oopsing, then lazy allocations have to be pulled.

	-hpa