Abusing the EFLAGS ID bit

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
GT

Abusing the EFLAGS ID bit

Post by GT »

The other day, I found myself wishing that there were a few "available" bits in the EFLAGS register, just like the bits they were nice enough to leave free for OS use in page table entries, descriptor table entries, etc.  I eventually coded a different solution, but while brainstorming for ideas for a quick place to store a flag that would be saved/restored automatically during context and task switches, I briefly toyed with the idea of using the ID bit.  You can set it to whatever you want (assuming your processor is new enough to support it), and as far as I know, it doesn't actually affect anything.  Is this bit "stable", or does it end up getting clobbered in certain circumstances?  Has anyone ever tried this before, or is this just too bizarre to seriously consider?
Post Reply