This article was supposed to be published about two years ago but got forgotten and ignored until now. It’s not the only such article. Perhaps it will start a new “better published late than never” series.
After looking more closely into the nonsense surrounding the implementation and usage of the NX feature, I ended up with more questions than answers. And it’s definitely not the fault of AMD, the people who first defined and implemented NX.
A big contributor is Microsoft, too. The code to detect and enable NX in Windows 10 (analyzing the original 10240 build here) is, to put it mildly, weird. That is very much at odds with Server 2003 (WRK) which has completely straightforward code to detect and, if present and requested, enable NX.
First let’s consider 64-bit Windows 10 10240 because it’s simpler. Given that NX was introduced in and defined as a non-optional part of the AMD64 architecture, a 64-bit OS should be able to query bit 20 (NX) in CPUID leaf 80000001h, register EDX. But that’s not what Windows 10 does. Continue reading