Missing mianipulation of return address
Missing mianipulation of return address
Posted Jun 26, 2018 3:15 UTC (Tue) by jreiser (subscriber, #11027)Parent article: Kernel support for control-flow enforcement
If Intel (and AMD?) are going to trouble of implementing CET, perhaps they could be persuaded to implement two related missing instructions? PUSHRA (push return address) and POPRA (pop return address) are the same as ordinary PUSH and POP, except for the explicit hint that the data item is a return address, and thus the side stack (cache) of return addresses should be manipulated accordingly. Such instructions would enable a measurable speed improvement (> 1%) for some mixed compiled+interpreted language runtime systems, by reducing the overhead from a mis-predicted branch when a compiled RET encounters a mismatch between the side stack and the real stack because the interpreter was in control at the time of the PUSHRA. PUSHRA is 0xFF/7 (hex 0xFF followed by modR/M of octal 0m7r) and POPRA is 0x8F/1 (hex 0x8F followed by modR/M of octal 0m1r).