Skip to contentSkip to conversation

x86-64 FPU saving/restoring

Xenomai Jan Kiszka 2 participants 2 messages Jan 30, 2013 – Feb 2, 2013

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi,

can someone explain to me why we have to worry that fxsave64 or fxrstor64 can fault on x86-64 (and i386's fxsave/fxrstor not)? And why we ignore such faults then? git doesn't explain why that change was once done. To my understanding, the target/source memory for the save/restore is not located in user space. The kernel seems to carefully save/restore only when pushing to/pulling from user space, e.g. during signal handling or on ptrace.

Thanks,
Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
#1 lore raw
Quoted 9 lines · Jan Kiszka

Hi,

can someone explain to me why we have to worry that fxsave64 or fxrstor64 can fault on x86-64 (and i386's fxsave/fxrstor not)? And why we ignore such faults then? git doesn't explain why that change was once done. To my understanding, the target/source memory for the save/restore is not located in user space. The kernel seems to carefully save/restore only when pushing to/pulling from user space, e.g. during signal handling or on ptrace.

From the archaeological dept: I suspect this was only a matter of quickly deriving a Xenomai version of the existing kernel helpers, in order to work on Xenomai's fpuenv areas from our TCBs.

I don't think relying on the fault fixup code dragged in this way was intended. We could not afford any fault there anyway, since we might then try to relax a thread in the middle of a Xenomai switch, so...

Signature · 1 line
Philippe.