[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
[rtl] CR0-TS the virus - "clts" the vaccine
Ciao.
The context:
Linux uses the cpu support for switching processes, that causes the task switched flag (TS) in control register zero (CR0) to be set. When TS is set any fpu instruction triggers a device not available trap, that can be used to dynamically understand that the fpu context need to saved before using it in the current process.
Unfortunately that sends RTLinux to hell when it uses the fpu too as, depending on what Linux has done while active, the fpu is sending and endless stream of DNA traps. That is the cause of the high jitters, up to milliseconds, that Daniele has been pointing out many many times. As far as I know none of the variants of Linux that are available took care of that.
Now that I understood it, it's is simple, and Linux is full of "clts" before "fsave/frstr", but it has been a real pain for a long time.
Is it possible that all the wizards out there did not know anything?
Now can anybody help me avoiding studying Linux in depth and tell me if:
- does Linux uses the TS flag or simply clears it, so that I'll know if CR0 must be saved/restored when going back and forth from Linux. Thanks.
To Randy: if you have not done it yet I'll send you a fixed rt_prio_sched next week.
To Victor: you were friendly kidding me when you talked about the donation of a PCI bus analyzer to verify for interactions betweeen the fpu and the disks , weren't you.
Ciao, Paolo.
--- [rtl] ---
For more information on Real-Time Linux see:
http://rtlinux.cs.nmt.edu/