Notes for x86-64
sysret can be assumed to always work for x86-64 code on an x86-64 kernel.
IA32 code running in compatibility mode on a x86-64 kernel is a complete mess and should be avoided:
<XgF> duckinator: No. syscall/sysret always work 64->64 <XgF> Otherwise, its a complete mess <XgF> On AMD: sysenter/exit are prohibited. #UD raised <XgF> On Intel: syscall/sysret to/from compatibility mode are prohibitied. #UD raised. You must use sysenter/sysexit from this <XgF> VIA/Centaur: Who the fuck knows? The CPUID bits are worthless!