Perica wrote:
According to the Intel manuals, using a register as an operand is not valid. But they don't say anything about using something like invlpg [eax]. Do you think think something like this would work ?;
Yes, that's exactly what I said. Register as operand means using the register itself, memory reference is using the register as pointer. Encoding 0 is using eax as memory reference ([eax]) and encoding C0 is using eax as register (eax). So, use it as memory reference.
The Intel manuals also state:
The INVLPG instruction is implementation dependent, and its function may be implemented differently on future IA-32 processors. If this is the case, I might aswell not use the instruction (as it might break compatibility with future processors ?). Everytime i change a page directory or page table entry, I'll just reaload the cr3 register, like this;
You miss the point of the entire sentence. Its function may be implemented differently, so its function stays the same. Using it will stay the same, but it might send some sort of invalidate to all processors, be just uniprocessor, something like that, send other processors an exclusive request instead, things like that.
invlpg will still work, if only because it's useful.