kzinti wrote:
I re-read this and think he meant "instructions that you cannot use in kernel mode" and not the registers. The commas placement confused me.
This is exactly what I meant. Bloody commas. I often end up using German comma rules in English, and apparently this can cause confusion. I'll strive to better myself on this.
Ethin wrote:
If you enable SSE and AVX then you can (technically) use those features in kernel mode. The question though is, why would you ever need them? AVX and SSE don't really have many, if any, use cases in kernel mode.
The compiler will sometimes emit SSE instructions even in integer-only code, usually to optimize some memory copy or to vectorize some loop. Thing is, in order to use extended instruction sets in kernel mode, you must save the extended registers on entry and restore them on exit. Normally, you only have to do this on task switch. But adding XSAVE/XRESTORE to all entry and exit paths likely imposes a bigger cost than the use of SSE/AVX can ever make up. Therefore most kernel authors make the executive decision to not save extended registers on entry and forego the use of them in the kernel.