On AMD Family 17h to 1Ah a kernel RET can be mispredicted to a target
trained by a guest or by userspace (Speculative Return Stack Overflow).
Linux defaults to a safe return thunk, which we do not have. Add the
IBPB modes that need no compiler support:
machdep.mitigations.srso.enable=1 issues IBPB after each #VMEXIT, and 2
also on every kernel entry from userspace. On Family 17h, mode 2 also
covers Retbleed.
Both need microcode where IBPB flushes return predictions, detected
from IBPB_BRTYPE or, on Family 19h and later, by a successful SBPB
write, as Linux does. The default stays off, and
machdep.mitigations.srso.state reports the result.
Sponsored by: Advanced Micro Devices, Inc.
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>