[Top] [All Lists]

Re: fpu_emulator can lose fpu on get_user/put_user

Subject: Re: fpu_emulator can lose fpu on get_user/put_user
From: Atsushi Nemoto <>
Date: Thu, 07 Oct 2004 10:15:58 +0900 (JST)
In-reply-to: <>
Original-recipient: rfc822;
References: <> <>
>>>>> On Wed, 6 Oct 2004 15:09:36 -0700, Jun Sun <> said:
>> I found a potential problem in math emulation.  The math-emu uses
>> put_user/get_user to fetch the instruction or to emulate load/store
>> fp-regs.  The put_user/get_user can sleep then we can lose fpu
>> ownership on it.  It it happened, subsequent restore_fp will cause
>> CpU exception which not allowed in kernel.

jsun> I don't feel good about this patch.  If emulator loses FPU
jsun> ownership it should get it back, not the caller of emulator.

Hmm... Inserting following 2 lines after each get_user, put_user (and
do_dsemulret, mips_dsemul, cond_resched) in cp1emu.c is better?

        if (!is_fpu_owner())

Actually, FPU might be lost in get_user, so get_user should get it
back?  I don't think so.  Similarly, getting it back by the caller of
emulator is not so bad, I think.  Maintenance of FPU ownership is not
emulator's work, isn't it?

Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>