TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

More on NX Insanity

40 pointsby eaguyhnover 5 years ago

6 comments

geofftover 5 years ago
I&#x27;m gonna take the contrary view - you don&#x27;t have the source code for Windows kernel functions, so you can&#x27;t see the comments, and even if you did, you wouldn&#x27;t be able to click links to internal tickets. These smell exactly like specific workarounds for specific real-world issues where, for whatever reason, the documentation doesn&#x27;t match reality. I&#x27;ve written lots of code where I write a two-paragraph comment in front of a one-line hack explaining why I&#x27;m doing something weird for now and why we hope to be able to clean up the code in five years - and that&#x27;s just for legacy internal services, not weird CPU bugs. If you don&#x27;t have the backstory and you just have the disassembled code, of course it will be &quot;not at all obvious what problem Microsoft was trying to solve.&quot;<p>A VMM on an NX-capable CPU that doesn&#x27;t support NX doesn&#x27;t seem like something that&#x27;s worth MS supporting. I&#x27;m going to guess they talked about it internally, and decided that whatever they needed to fix was worth the tradeoff. Maybe there&#x27;s one CPU where NX is in fact supported but for whatever reason it&#x27;s missing in CPUID, and you&#x27;ve never seen that CPU. Also, honestly, a VMM that doesn&#x27;t support NX sounds remarkably like <i>malware</i>, if you run into it in production and not on the system of a hobbyist writing their own VMM, and failing hard when you know the CPU you&#x27;re on supports NX and you know that CPUID is lying to you is an entirely reasonable decision.<p>Similarly, re skipping force-enable on 32-bit SSE2 CPUs - there&#x27;s probably one CPU where the force-enable codepath causes some subtle problems, and this is the fastest&#x2F;easiest way to identify that CPU, and they&#x27;re not terribly concerned about accidentally missing some other cases. And again, you neither have the comments nor the `git blame` (or whatever MS uses) of that code nor the internal trouble ticket where someone spent weeks chasing down an elusive CPU bug. Of course it makes no sense to you.<p>And if there is some real problem behind these two cases, it&#x27;s hardly true that &quot;the original issue is long gone&quot; - Windows has very long support cycles. This isn&#x27;t a &quot;problem in the IT industry,&quot; it&#x27;s the reality of the game. If you want your code to work on real-world machines and you want real-world customers to pay your real-world salary, you have to write code for the world as it actually is, not as you wish it would be.
评论 #21690480 未加载
mqusover 5 years ago
NX=NoeXecute bit on memory page tables (according to the link in the article)<p>(I didn&#x27;t know that, maybe it helps someone else)
评论 #21690476 未加载
minikitesover 5 years ago
Here&#x27;s a related story on why Microsoft might not want to believe the result of a query of hardware capabilities:<p><a href="https:&#x2F;&#x2F;devblogs.microsoft.com&#x2F;oldnewthing&#x2F;20040211-00&#x2F;?p=40663" rel="nofollow">https:&#x2F;&#x2F;devblogs.microsoft.com&#x2F;oldnewthing&#x2F;20040211-00&#x2F;?p=40...</a><p>&gt;In other words, whenever DirectX asked, “Can you do this?” they answered, “Sure, we do that,” without even checking what the question was.
评论 #21689128 未加载
评论 #21689248 未加载
mdipover 5 years ago
&gt; That’s right. If SSE2 is reported, KiTryForceEnableNx does nothing. How does that make sense? I don’t know. It is true that all AMD processors which have SSE2 also have NX (and it can’t be disabled). But all Intel Pentium 4 CPUs made before late 2004 (and some made after) have SSE2 yet no NX.<p>This is an odd choice, and from the sound of it -- they&#x27;re only checking SSE2, assuming its presence means that NX can be enabled, enabling it and ... <i>nasal demons</i> of some kind.<p>I&#x27;m guessing someone didn&#x27;t read the specs carefully enough on the Intel processor side, but at the end of the day it ended up being a &quot;Won&#x27;t Fix&quot; simply because they explicitly list both SSE2 and NX as required[0].<p>It&#x27;s not great to fail with what I assume is some error message that doesn&#x27;t simply say &quot;Your processor is not supported, see our 6-page requirements document online on another computer&quot;. It&#x27;d be ideal if the OS could accurately check its minimums.<p>I think of the application&#x27;s I&#x27;ve built (nothing deployed widely), it&#x27;s rare that I&#x27;ve had to do operating environment validation (the need for it in the applications I write is minimal beyond &quot;can I allocate a little memory&quot;), and from some brief reading, it sounds like there&#x27;s a more than a few edge cases involved.<p>If my experience as a user (who buys AMD products, usually) is any indication ... No Man&#x27;s Sky and a 3D program who&#x27;s name escapes me both required SSSE3[1]. Both blew nasal demons.<p>[0] Section 3.1 <a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;previous-versions&#x2F;windows&#x2F;it-pro&#x2F;windows-8.1-and-8&#x2F;dn482072(v=win.10)?redirectedfrom=MSDN" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;previous-versions&#x2F;windows&#x2F;i...</a><p>[1] I seem to recall it was something like SSSE4.2 or some oddness, but I couldn&#x27;t find a reference to it ... only SSSE3, which had the same problem of having an extra &quot;S&quot;, confounding Google.<p>edit: and grammar and speling.
microcolonelover 5 years ago
&gt; <i>But it’s causing trouble because if NX cannot be enabled on an Intel CPU for whatever reason (such as running in a VM on a host with disabled NX, thanks Intel!), Windows 10 doesn’t believe the CPUID information and tries to enable NX anyway, which blows up.</i><p>This seems like a &quot;Doctor, it hurts when I do this.&quot; kind of thing. Just don&#x27;t do that.<p>Is there any good reason to disable NX systemwide on a VM host? Seems kinda risky.
tinus_hnover 5 years ago
It seems like it shouldn’t be too difficult to just test if it works, if the processor says it does.