2 ms·
Well, it should work in some well-controlled cases and in those cases if you're writing this code you are probably an OS vendor. Examples of legit use case: an
by wyldfire 5y ago
Well, it should work in some well-controlled cases and in those cases if you're writing this code you are probably an OS vendor. Examples of legit use case: an executable loader or some bootstrapping code/bootloader.
When writing code like this, as Chen says, you are bound to the architectural rules regarding how to appropriately locate code and safely invalidate code caches etc.
So if you follow the rules it doesn't work then typically I figure you'd take it up with the CPU vendor.
While you could potentially do it and have a good reason to in userspace code, it should be heavily scrutinized because it's so unconventional.