Re: fpu_emulator can lose fpu on get_user/put_user

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>>>> On Wed, 6 Oct 2004 15:09:36 -0700, Jun Sun <jsun@xxxxxxxxxx> 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())
		own_fpu();

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


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux