AMD Family 19h and 1Ah processors are affected by TSA (CVE-2024-36350,
CVE-2024-36357, AMD-SB-7029) unless CPUID 0x80000021 ECX reports
TSA_SQ_NO and TSA_L1_NO, and also TSA_FILL_NO on Family 1Ah. With
updated microcode VERW clears the affected buffers. Family 19h
microcode does not set VERW_CLEAR in CPUID 0x80000021 EAX, so on bare
metal compare the microcode revision against the minimum fixed
revisions from the bulletin, as Linux does.
Add machdep.mitigations.tsa.enable (0 off, 1 on, 2 auto) and
machdep.mitigations.tsa.state. When enabled, use the MDS VERW handler
on return to user mode. The mitigation is off by default, as is MDS.
vmm reports VERW_CLEAR to guests when the host qualifies, so that the
automatic mode works in a guest.
Sponsored by: Advanced Micro Devices, Inc.
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>