HomeFreeBSD

hwpmc: consistently validate PMC class in allocation method

Description

hwpmc: consistently validate PMC class in allocation method

It is always a good idea. In one case, attempting to allocate N+1 PMCs
from a class with N hardware counters would incorrectly attempt to
allocate from the next class in the list. Without this validation, this
can lead to all kinds of strange behaviour.

Since powerpc_allocate_pmc() is used by both the mpc7xxx and ppc970
classes, add a new global to track which is active (it will never be
both).

Reviewed by: luporl, ray
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31387

(cherry picked from commit 315cd55dba61416495a847f0eed6e522421e2347)

Details

Provenance
mhorneAuthored on Aug 30 2021, 5:02 PM
mavCommitted on Jul 5 2022, 4:38 PM
Reviewer
luporl
Differential Revision
D31387: hwpmc: consistently validate PMC class in allocation method
Parents
rG376acb064839: OpenSSL: Regen assembly file for OpenSSSL 1.1.1q
Branches
Unknown
Tags
Unknown