git: c97cea955f90 - main - hwpmc: count each AMD PMC interrupt once

From: Mitchell Horne <mhorne_at_FreeBSD.org>
Date: Fri, 02 Oct 2026 13:58:52 UTC
The branch main has been updated by mhorne:

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

commit c97cea955f90ceea1024716d335a39215688f324
Author:     Andre Silva <andasilv@amd.com>
AuthorDate: 2026-10-02 13:54:04 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2026-10-02 13:54:41 +0000

    hwpmc: count each AMD PMC interrupt once
    
    amd_intr() and amd_intr_v2() call pmc_ibs_intr() and then update
    kern.hwpmc.stats.intr_processed or intr_ignored.  pmc_ibs_intr() also
    updated them.  So each core PMC NMI was also counted as ignored, and
    each IBS NMI was counted as processed two times.
    
    Update the statistics only in the caller.
    
    Similarly, drop duplicate PMCDBG messages.
    
    Reviewed by:    mhorne, Ali Mashtizadeh <ali@mashtizadeh.com>
    Fixes:          e51ef8ae490f ("hwpmc: Initial support for AMD IBS")
    Sponsored by:   AMD
    Differential Revision:  https://reviews.freebsd.org/D60185
---
 sys/dev/hwpmc/hwpmc_ibs.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/sys/dev/hwpmc/hwpmc_ibs.c b/sys/dev/hwpmc/hwpmc_ibs.c
index 9e4af386f8d8..be981b0c7a07 100644
--- a/sys/dev/hwpmc/hwpmc_ibs.c
+++ b/sys/dev/hwpmc/hwpmc_ibs.c
@@ -697,8 +697,6 @@ pmc_ibs_intr(struct trapframe *tf)
 	KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
 	    ("[ibs,%d] out of range CPU %d", __LINE__, cpu));
 
-	PMCDBG3(MDP, INT, 1, "cpu=%d tf=%p um=%d", cpu, tf, TRAPF_USERMODE(tf));
-
 	retval = 0;
 
 	pac = ibs_pcpu[cpu];
@@ -744,13 +742,7 @@ pmc_ibs_intr(struct trapframe *tf)
 		}
 	}
 
-
-	if (retval)
-		counter_u64_add(pmc_stats.pm_intr_processed, 1);
-	else
-		counter_u64_add(pmc_stats.pm_intr_ignored, 1);
-
-	PMCDBG1(MDP, INT, 2, "retval=%d", retval);
+	/* The caller updates the interrupt statistics. */
 
 	return (retval);
 }