lkml.org 
[lkml]   [2008]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ABI change for device drivers using future AVX instruction set
Arjan van de Ven wrote:
>Let me repeat this loud and clear:
>It is not allowed to use floating point, SSE of AVX in device drivers.

Thank you for a clear answer. Re-reading the ABI:
>A.2.4 Miscellaneous Remarks
>Linux Kernel code is not allowed to change the x87 and SSE units. If
those are
>changed by kernel code, they have to be restored properly before
sleeping or leaving
>the kernel. On preemptive kernels also more precautions may be needed.

This states your point, but certainly not "loud and clear" :-)

This ABI statement has to be amended, however, because it is allowed to
use any register as long it is "restored properly". A programmer can
save a single XMM register, use it, and restore it. A programmer might
think that it is possible to do the same with a YMM register, but this
will not work on future systems that extend the 256-bit YMM registers to
512-bit ZMM or whatever. This has to be said "loud and clear" because
nobody would discover the error until a distant future when we have ZMM.

Let me explain the background for this as I understand it:
Intel have decided to make two versions of every existing XMM
instruction in the new AVX: A legacy version that leaves the upper half
of the YMM register unchanged, and a new AVX version that clears the
upper part of the YMM register in order to avoid false dependencies.
This very expensive decision was necessary for only one reason: To
prevent existing device drivers from destroying the upper part of the
YMM registers. Learning from past mistakes, they are saying already now
that they will not use the same fix next time the registers are made
bigger. When ZMM and still bigger registers are introduced, the YMM
instructions will clear bit number 256 and up of the ZMM or whatever
registers.

Note: Please Cc: me of any replies. I am not on the mailing list.



\
 
 \ /
  Last update: 2008-06-25 21:57    [W:1.249 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site