Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat are coding conventions for using floating-point in Linux device drivers?
    primarykey
    data
    text
    <p>This is related to <a href="https://stackoverflow.com/questions/431045/linux-device-driver-unsave-fxsave-fxrstor-bug-any-precedents">this question</a>.</p> <p>I'm not an expert on Linux device drivers or kernel modules, but I've been reading "Linux Device Drivers" [O'Reilly] by Rubini &amp; Corbet and a number of online sources, but I haven't been able to find anything on this specific issue yet.</p> <p>When is a kernel or driver module allowed to use floating-point registers? <BR> If so, who is responsible for saving and restoring their contents? <BR> (Assume x86-64 architecture) </p> <p>If I understand correctly, whenever a KM is running, it is using a hardware context (or hardware thread or register set -- whatever you want to call it) that has been preempted from some application thread. If you write your KM in c, the compiler will correctly insure that the general-purpose registers are properly saved and restored (much as in an application), but that doesn't automatically happen with floating-point registers. For that matter, a lot of KMs can't even assume that the processor has any floating-point capability.</p> <p>Am I correct in guessing that a KM that wants to use floating-point has to carefully save and restore the floating-point state? Are there standard kernel functions for doing this?</p> <p>Are the coding conventions for this spelled out anywhere?<BR> Are they different for SMP-non SMP drivers? <BR> Are they different for older non-preemptive kernels and newer preemptive kernels?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload