|
|
|
|
|
by hu3
591 days ago
|
|
Your explanation is amazing.
Thanks How would this happen in practice? > To "mispredict" an unconditional jump for example all it takes is to modify the code so that the instruction points to a different target. Perhaps a jump to a pointer that changed value? Or maybe JIT code that was optimized during runtime? |
|
More uncommon but technically possible is to mispredict a unconditional direct jump.
For that to happen the code itself has to change.
Indeed JIT is a common cause of mutable code at runtime.
But also unmapping a library and remapping another library in the same memory range can also effectively cause the same address to contain a different instruction that the one predicted but the branch prediction logic (likely not even a branch instruction)