On Wed, May 13, 2020 at 4:36 PM Borislav Petkov <bp@xxxxxxx> wrote: > > > Looking at them, they do have an mb() too so how about this then > instead? > > #define prevent_tail_call_optimization() mb() Yeah, I think a full mb() is likely safe, because that's pretty much always going to be a real instruction with real semantics, and no amount of link-time optimizations can move it around a call instruction. I could imagine some completely UP in-order CPU that doesn't need to serialize with anything at all, and even "mb()" might be empty. I think you can compile old ARM kernels for that. But realistically I think we can ignore them at least for now - I'm not sure the link-time optimization will even do things like that tailcall conversion, and I'm not convinced that old pre-ARMv7 systems will be relevant by the time (if) it ever does. Linus