From nobody Thu Nov 05 13:46:01 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jL3Vk5zCNz6yyb3 for ; Thu, 05 Nov 2026 13:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jL3Vk5T4wz4r3f for ; Thu, 05 Nov 2026 13:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793886366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EiIY0UfHHjqy1XS9IumkybsZ3RxCtp7v0R3XNGN9Y3w=; b=Ok0BFeuxRtAqDcTpw0ZD7JNgcd/E4LtB8MeLpxgKtlQ0AV8VA0ixh2ZMk5GeZKX4zN1587 JFZLmbF2gQcGTHQcEclmCl4ELtOq61KMyFQdvnyruuJLejBV7jdYoIQtSYKrUBwSj/edv9 R3aryuDaZ2Ch9nK+4zXGG/ToNIbPTypayp5KbhcY/KcMzzWX7VpmJ8BfurvYhmfFD/F9ay MtYenb71dFykm/ZFllYGipXa28ZpUmSrSWP0XzTkmUK3p6uIW/NQ99TziatFt25UTN0ErG J2P+SFHZB2ditIVksvrGEZHTr69tDt4S+P/vdIMzo0N6z/FX+Xzlk8nvOfraVQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793886366; b=MpDbA5LzhW+aZOv8ZEsWeYGKioY2jI1077aShptruVDF+cc9PLYdLw9EQcaiuTsRNICw1W t3pgig2d9H1/UbY5ok37kqVceQOGqIq4lnGKtwxjUHdHx8/52BN0ng8+rCuN6+rZ4/sdfM kM0hj/gCPRXh2rlb6R68kyj0wwfozvufWeAB1HAHCoDVNJeS3enWmZ6n9ocxoW5TTyIydb Ptia57ZWoRgLgcG7DzP9OfMO7bY2edBcGQqKUW3VjnTVL287TdhxXwejDEXKhqtjpcpYgd fF8YFKx4qwXe7/ezu61IRGZLVC0N1J/hFylbhN9qdjQiZAvBG8r/+/uqEGnl4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793886366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EiIY0UfHHjqy1XS9IumkybsZ3RxCtp7v0R3XNGN9Y3w=; b=emoG3H+1kCXrVY1uWAXMQ3G6TRS3RpbcFMs44xhIXDs+8/i4I4U9/dihCbQPhz8FoiAYU4 UPVegGOnsS4o6XD3yz4Y+SEnS3xcegPxI6b7N/Jd13qAX10gDXfhqWs+Q41iWKMvwq7qt0 xHpnZSrfEe1M7Hia408pIpCoEcH17ZDt02ygq/DuK3RI5XPAqoWBYZzwhB3cFU5GTtm3c7 /ABab+UUeZnje+gXm9z/RdTR0OPlV7n1ab0T8hHamCLtNLIlsQaGJmtL0TqtKcQ3o3OEDs 9EfC6JlhLQraxuES6nfktEJcoDCjp52Ujrb1Qf4RvPkDwGsSjnzOgiuj4wRmSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jL3Vk4qx9zt50 for ; Thu, 05 Nov 2026 13:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 19bdf by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 05 Nov 2026 13:46:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Osvaldo Janeri Filho From: Mitchell Horne Subject: git: abd7dfa09a0e - main - hwpmc: use the UMC enable bit with PerfMonV2 List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: abd7dfa09a0ed1c06924226da0285d0731273f66 Auto-Submitted: auto-generated Date: Thu, 05 Nov 2026 13:46:01 +0000 Message-Id: <6aec8899.19bdf.24053260@gitrepo.freebsd.org> The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=abd7dfa09a0ed1c06924226da0285d0731273f66 commit abd7dfa09a0ed1c06924226da0285d0731273f66 Author: Osvaldo Janeri Filho AuthorDate: 2026-11-05 13:32:29 +0000 Commit: Mitchell Horne CommitDate: 2026-11-05 13:45:58 +0000 hwpmc: use the UMC enable bit with PerfMonV2 The PerfMonV2 start and stop methods set the core enable bit on UMC counters too, so UMC events never count. Use the UMC enable bit, as the legacy methods do. Reviewed by: mhorne, Ali Mashtizadeh Fixes: 9d3064010590 ("hwpmc_amd: add PerfMonV2 global-control path") Sponsored by: AMD Signed-off-by: Osvaldo Janeri Filho Differential Revision: https://reviews.freebsd.org/D60770 --- sys/dev/hwpmc/hwpmc_amd.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_amd.c b/sys/dev/hwpmc/hwpmc_amd.c index dac50207656d..f466fff4cfb3 100644 --- a/sys/dev/hwpmc/hwpmc_amd.c +++ b/sys/dev/hwpmc/hwpmc_amd.c @@ -797,7 +797,10 @@ amd_start_pmc_v2(int cpu __diagused, int ri, struct pmc *pm) } /* Enable EVSEL while the virtual slot's global bit is off. */ - config = pm->pm_md.pm_amd.pm_amd_evsel | AMD_PMC_ENABLE; + if (pd->pm_subclass == PMC_AMD_SUB_CLASS_UMC) + config = pm->pm_md.pm_amd.pm_amd_evsel | AMD_PMC_UMC_ENABLE; + else + config = pm->pm_md.pm_amd.pm_amd_evsel | AMD_PMC_ENABLE; wrmsr(pd->pm_evsel, config); if (pd->pm_subclass == PMC_AMD_SUB_CLASS_CORE && @@ -868,6 +871,7 @@ amd_stop_pmc_v2(int cpu __diagused, int ri, struct pmc *pm) { const struct amd_descr *pd; enum pmc_mode mode; + uint64_t config; int i; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -888,8 +892,11 @@ amd_stop_pmc_v2(int cpu __diagused, int ri, struct pmc *pm) } /* Disable EVSEL after the counter's global bit is off. */ - wrmsr(pd->pm_evsel, - pm->pm_md.pm_amd.pm_amd_evsel & ~AMD_PMC_ENABLE); + if (pd->pm_subclass == PMC_AMD_SUB_CLASS_UMC) + config = pm->pm_md.pm_amd.pm_amd_evsel & ~AMD_PMC_UMC_ENABLE; + else + config = pm->pm_md.pm_amd.pm_amd_evsel & ~AMD_PMC_ENABLE; + wrmsr(pd->pm_evsel, config); /* Wait out an in-flight overflow NMI. The handler clears the status bit. */ if (pd->pm_subclass == PMC_AMD_SUB_CLASS_CORE &&