Re: [patch 2/2] x86, fpu: lazy allocation of FPU area - v5

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Suresh Siddha
Date: Tuesday, March 11, 2008 - 1:57 pm

On Tue, Mar 11, 2008 at 10:08:16AM +0100, Ingo Molnar wrote:

init_fpu() is getting called only if !used_math() and in this case, we don't
do any FP operations in init_fpu()


AFAICS, fault handler is doing do_group_exit(SIGKILL); under out-of-memory
conditions while handling page fault.

Just want to make sure that the user doesn't see this signal.

force_sig() with SIGKILL/SIGBUS along with
printk("out of memory! killing process") is fair enough, right?


:) Didn't feel SIGKILL was completely crappy..


Good point. But math_state_restore() should never happen between
the kernel_fpu_begin() and end() sections. Otherwise, it will corrupt the
user's FPU data.

Today, we make sure that we don't get device not available (DNA) exceptions
in kernel_fpu_begin() by explicitly doing clts()


Based on above, do you think this is still needed? Even if it is needed,
the check should be

	BUG_ON(!user_mode(regs))

thanks,
suresh
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 2/2] x86, fpu: lazy allocation of FPU area - v5, Suresh Siddha, (Mon Mar 10, 3:28 pm)
Re: [patch 2/2] x86, fpu: lazy allocation of FPU area - v5, Suresh Siddha, (Tue Mar 11, 1:57 pm)