A guest can train the branch predictors that bhyve(8) uses after the
VM exits to userspace on the same CPU. When a guest has run, mark the
CPU in vm_run() and issue IBPB on the next return to userspace from
that CPU, as Linux does.
machdep.mitigations.vmscape.enable controls it. The default enables it
on AMD Family 17h, 19h and 1Ah and Hygon Family 18h, which Linux lists
as affected.
Sponsored by: Advanced Micro Devices, Inc.
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>