In a guest that shows an AMD Zen CPU but has no PMU, hwpmc(4) registers
neither the AMD core class nor IBS. pmc_rowalloc_test, pmu_mux_test and
pmu_detect_test check only the CPU and pmc_init(), and
pmc_ibs_fetch_op_test checks only CPUID leaf 0x8000001B, which bhyve
passes through. All four fail there instead of skipping.
Add amd_test_skip_unless_core_class(). It skips when the class is
missing in a guest and returns on bare metal, so a missing class still
fails there. Check for the IBS class in pmc_ibs_fetch_op_test as
pmc_ibs_test does.
Same problem as D61689, on AMD.
Fixes: 546a76463123 ("tests/sys/pmc: add pidtrack, callchain, pmc(8), RAPL and AMD tests")
Fixes: 7c743e3ba6c1 ("tests/sys/pmc/amd: add IBS, row allocation, PerfEvtSel and PerfMonV2 tests")
Sponsored by: Advanced Micro Devices, Inc.
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>