--openmail-part-018f47bd-00000002
Content-Type: text/plain; charset=US-ASCII; name="FPU"
Content-Transfer-Encoding: quoted-printable
Hi,
Last evening I noticed that 'math_state_restore' (in
arch/i386/kernel/traps.c)
was being called during the start-up of all my binaries - even those
that do not
use the FPU. This func marks the current process as a user of the FPU.
Now this doesn't create much overhead, espically with the 'lazy' FPU
state
saving/restoring Linux uses for task switching, but it is anoying all
the same.
The reason all processes are FPU users is due to the startup code
(crt0,
which calls __setfpucw in libc) which sets the FPU control-word, and
hence
uses ESC instructions.
OK, so maybe this is a libc problem, but isn't the solution to pass
the control-
word into the kernel, and let the kernel set it on first FPU use? Has
the
overhead of a sys-call at start-up (I certainly don't like this).
How about having a default control-word in the kernel, which libc
knows
about, and crt0 only sets the word if the user has requested a different=
setting
(changed __fpu_control)?
Any comments?
I have two reasons for wanting to avoid unnecessary ESC instructions;
1) Signal handling. There should be no need to store the FPU
state,
on the stack frame, when the process hasn't used the
FPU.
2) On systems without a hard-FPU, it should be at least possible
to
boot the system without a soft-FPU. (Most programs do not
perform any floating-point ops).
Thanx,
markhe
--openmail-part-018f47bd-00000002
Content-Type: application/rtf; name="FPU"
Content-Transfer-Encoding: base64
e1xydGYxXGFuc2lcZGVmZjBcZGVmdGFiNzIwe1xmb250dGJse1xmMFxmc3dpc3MgTVMgU2Fu
cyBTZXJpZjt9e1xmMVxmcm9tYW5cZmNoYXJzZXQyIFN5bWJvbDt9e1xmMlxmc3dpc3MgQXJp
YWw7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7fQ0KXGRlZmxhbmcyMDU3XHBh
cmRccGxhaW5cZjJcZnMyMCBIaSwNClxwYXIgICAgICAgTGFzdCBldmVuaW5nIEkgbm90aWNl
ZCB0aGF0ICdtYXRoX3N0YXRlX3Jlc3RvcmUnIChpbiBhcmNoL2kzODYva2VybmVsL3RyYXBz
LmMpDQpccGFyIHdhcyBiZWluZyBjYWxsZWQgZHVyaW5nIHRoZSBzdGFydC11cCBvZiBh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bGliYyBrbm93cw0KXHBhciBhYm91dCwg
YW5kIGNydDAgb25seSBzZXRzIHRoZSB3b3JkIGlmIHRoZSB1c2VyIGhhcyByZXF1ZXN0ZWQg
YSBkaWZmZXJlbnQgc2V0dGluZw0KXHBhciAoY2hhbmdlZCBfX2ZwdV9jb250cm9sKT8NClxw
YXIgICBBbnkgY29tbWVudHM/DQpccGFyIA0KXHBhciAgIEkgaGF2ZSB0d28gcmVhc29ucyBm
b3Igd2FudGluZyB0byBhdm9pZCB1bm5lY2Vzc2FyeSBFU0MgaW5zdHJ1Y3Rpb25zOw0KXHBh
ciBcdGFiIDEpIFNpZ25hbCBoYW5kbGluZy4gIFRoZXJlIHNob3VsZCBiZSBubyBuZWVkIHRv
IHN0b3JlIHRoZSBGUFUgc3RhdGUsDQpccGFyICAgICAgICAgICAgICAgICBvbiB0aGUgc3Rh
Y2sgZnJhbWUsIHdoZW4gdGhlIHByb2Nlc3MgaGFzbid0IHVzZWQgdGhlIEZQVS4NClxwYXIg
XHRhYiAyKSBPbiBzeXN0ZW1zIHdpdGhvdXQgYSBoYXJkLUZQVSwgaXQgc2hvdWxkIGJlIGF0
IGxlYXN0IHBvc3NpYmxlIHRvDQpccGFyIFx0YWIgICAgIGJvb3QgdGhlIHN5c3RlbSB3aXRo
b3V0IGEgc29mdC1GUFUuICAoTW9zdCBwcm9ncmFtcyBkbyBub3QNClxwYXIgXHRhYiAgICAg
cGVyZm9ybSBhbnkgZmxvYXRpbmctcG9pbnQgb3BzKS4NClxwYXIgDQpccGFyICAgIFRoYW54
LA0KXHBhciAgICAgICAgICAgbWFya2hlDQpccGFyIH0NCgA=
--openmail-part-018f47bd-00000002--
--openmail-part-018f47bd-00000001
Content-Type: multipart/alternative; boundary=openmail-part-018f47bd-00000003
--openmail-part-018f47bd-00000003
Content-Type: text/plain; charset=US-ASCII; name="WINMAIL.DAT"
Content-Transfer-Encoding: quoted-printable
0000000 x 237 > " 241 e 001 006 220 \b \0 004 \0 \0 \0 \0=
0000020 \0 001 \0 001 \0 001 007 220 006 \0 \b \0 \0 \0 344 004=
0000040 \0 \0 \0 \0 \0 \0 350 \0 001 \b 200 007 \0 030 \0 \0=
0000060 \0 I P M . M i c r o s o f t M=
0000100 a i l . N o t e \0 1 \b 001 \r 200 004 \0=
0000120 002 \0 \0 \0 002 \0 002 \0 001 004 200 001 \0 030 \0 \0=
0000140 \0 F P U - u s e d _ m a t h=
0000160 o n i 3 8 6 \0 9 007 001 005 200 003 \0=
0000200 016 \0 \0 \0 314 007 005 \0 036 \0 013 \0 5 \0 026 \0=
0000220 004 \0 P 001 001 \0 200 \0 \0 4 \0 \0 \0 004 \0 4=
0000240 \0 016 \0 026 \0 M a r k H e m m e n=
0000260 t \0 \0 O P E N M A I L : M a r k=
0000300 H e m m e n t \0 \0 \0 \0 \0 \0 \0 \0=
0000320 \0 335 013 001 200 003 \0 016 \0 \0 \0 314 007 005 \0=
0000340 036 \0 013 \0 1 \0 * \0 004 \0 ` 001 001 \t 200 001=
0000360 \0 ! \0 \0 \0 7 8 9 9 1 6 9 6 0 5 B=
0000400 A C F 1 1 B D A B 0 0 A 0 2 4 2=
0000420 4 1 E E 9 \0 $ 007 001 003 220 006 \0 D 001 \0=
0000440 \0 021 \0 \0 \0 013 \0 # \0 \0 \0 \0 \0 003 \0 &=
0000460 \0 \0 \0 \0 \0 013 \0 ) \0 \0 \0 \0 \0 003 \0 6=
0000500 \0 \0 \0 \0 \0 @ \0 9 \0 200 6 @ 8 026 N 273=
0000520 001 036 \0 B \0 001 \0 \0 \0 \r \0 \0 \0 M a r=
0000540 k H e m m e n t \0 \0 \0 \0 @ \0 H=
0000560 \0 200 304 L 9 026 N 273 001 036 \0 p \0 001 \0 \0=
0000600 \0 030 \0 \0 \0 F P U - u s e d _=
0000620 m a t h o n i 3 8 6 \0 002 001 q=
0000640 \0 001 \0 \0 \0 026 \0 \0 \0 001 273 N 026 8 / 226=
0000660 026 231 177 272 005 021 317 275 253 \0 240 $ $ 036 351 \0=
0000700 \0 036 \0 032 \f 001 \0 \0 \0 \r \0 \0 \0 M a r=
0000720 k H e m m e n t \0 \0 \0 \0 002 001 035=
0000740 \f 001 \0 \0 \0 026 \0 \0 \0 O P E N M A I=
0000760 L : M a r k H e m m e n t \0 \0=
0001000 \0 036 \0 036 \f 001 \0 \0 \0 \t \0 \0 \0 O P E=
0001020 N M A I L \0 \0 \0 \0 036 \0 037 \f 001 \0 \0=
0001040 \0 \r \0 \0 \0 M a r k H e m m e n=
0001060 t \0 \0 \0 \0 @ \0 007 0 ` 336 ; 265 025 N 273=
0001100 001 @ \0 \b 0 ` 336 ; 265 025 N 273 001 036 \0 =3D=
0001120 \0 001 \0 \0 \0 001 \0 \0 \0 \0 \0 \0 \0 003 \0 \r=
0001140 4 375 7 \0 \0 213 9
0001147
--openmail-part-018f47bd-00000003
Content-Type: application/x-openmail-1734; name="WINMAIL.DAT"
Content-Transfer-Encoding: base64
eJ8+IqFlAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAGAAAAElQTS5N
aWNyb3NvZnQgTWFpbC5Ob3RlADEIAQ2ABAACAAAAAgACAAEEgAEAGAAAAEZQVSAtIHVzZWRf
bWF0aCBvbiBpMzg2ADkHAQWAAwAOAAAAzAcFAB4ACwA1ABYABABQAQEAgAAANAAAAAQANAAO
ABYATWFyayBIZW1tZW50AABPUEVOTUFJTDpNYXJrIEhlbW1lbnQAAAAAAAAAAADdCwEggAMA
DgAAAMwHBQAeAAsAMQAqAAQAYAEBCYABACEAAAA3ODk5MTY5NjA1QkFDRjExQkRBQjAwQTAy
NDI0MUVFOQAkBwEDkAYARAEAABEAAAALACMAAAAAAAMAJgAAAAAACwApAAAAAAADADYAAAAA
AEAAOQCANkA4Fk67AR4AQgABAAAADQAAAE1hcmsgSGVtbWVudAAAAABAAEgAgMRMORZOuwEe
AHAAAQAAABgAAABGUFUgLSB1c2VkX21hdGggb24gaTM4NgACAXEAAQAAABYAAAABu04WOC+W
Fpl/ugURz72rAKAkJB7pAAAeABoMAQAAAA0AAABNYXJrIEhlbW1lbnQAAAAAAgEdDAEAAAAW
AAAAT1BFTk1BSUw6TWFyayBIZW1tZW50AAAAHgAeDAEAAAAJAAAAT1BFTk1BSUwAAAAAHgAf
DAEAAAANAAAATWFyayBIZW1tZW50AAAAAEAABzBg3ju1FU67AUAACDBg3ju1FU67AR4APQAB
AAAAAQAAAAAAAAADAA00/TcAAIs5
--openmail-part-018f47bd-00000003--
--openmail-part-018f47bd-00000001--