Re:Writing a Self-Mutating x86_64 C Program (2013)
by tyingq on Friday January 11, 2019 @10:12AM
(#18884031)
I think you probably read it in Dr Dobbs: http://www.drdobbs.com/embedded-systems/processor-detection-...
Not exactly what you described, but very similar:
"Differentiating between 8088s and 8086s is trickier. The easiest way I've found to do it is to modify code that's five bytes ahead of IP. Since the prefetch queue of an 8088 is four bytes and the prefetch queue of an 8086 is six bytes, an instruction five bytes ahead of IP won't have any effect on an 8086 the first time around"
Re:Writing a Self-Mutating x86_64 C Program (2013)
by vbezhenar on Friday January 11, 2019 @11:55AM
(#18884798)
Interesting! Does this effect work on modern CPU? I'd imagine that if CPU modifies memory which was consumed by prefetcher, it should reset and reread everything or something like this.
This is all from memory of something I read, probably on Usenet, ages ago. My apologies in advance if I messed up the details.
I wonder if any of the various x86 emulators out there get this difference right.