There are three types of performance counters defined by the spec, with
three CPUID bits allocated to indicate support. Add detection of this to
the initialization routine.
Support for the "Core" performance counters is required, and if this is
not detected then the class will not attach. Let the other two types of
counters become optional.
This fixes an issue where use of hwpmc in bhyve could easily trigger
panics, as all MSR reads and writes were intercepted to be a no-op.
vmm(4) clears the relevant bits from CPUID, so now this behaves as
expected.
PR: 268943