git: ca9c5718017f - main - libpmc: fix the family check for the AMD DF event encoding

From: Mitchell Horne <mhorne_at_FreeBSD.org>
Date: Thu, 08 Oct 2026 14:58:01 UTC
The branch main has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=ca9c5718017fc34d34f2dfe90020644aad3588d3

commit ca9c5718017fc34d34f2dfe90020644aad3588d3
Author:     Osvaldo Janeri Filho <ojanerif@amd.com>
AuthorDate: 2026-10-08 09:43:59 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2026-10-08 14:57:35 +0000

    libpmc: fix the family check for the AMD DF event encoding
    
    The check compares cpu_family with decimal 19 instead of 0x19, so
    Families 17h and 19h get the Family 1Ah DF encoding.
    
    Signed-off-by:  Osvaldo Janeri Filho <ojanerif@amd.com>
    Reviewed by:    mhorne
    Fixes:          00c0a1f0bf6c ("hwpmc: Fix PMC flags for AMD Zen cores")
    MFC after:      3 days
    Sponsored by:   AMD
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/2461
---
 lib/libpmc/libpmc_pmu_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libpmc/libpmc_pmu_util.c b/lib/libpmc/libpmc_pmu_util.c
index 647fceabb05d..e0fac9884b77 100644
--- a/lib/libpmc/libpmc_pmu_util.c
+++ b/lib/libpmc/libpmc_pmu_util.c
@@ -581,7 +581,7 @@ pmc_pmu_amd_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm,
 		}
 	} else if (strcmp("amd_df", pe->pmu) == 0) {
 		amd->pm_amd_sub_class = PMC_AMD_SUB_CLASS_DATA_FABRIC;
-		if (cpu_family <= 19) {
+		if (cpu_family <= 0x19) {
 			amd->pm_amd_config |=
 			    AMD_PMC_DF1_TO_EVENTMASK(ped->ped_event);
 			amd->pm_amd_config |=