From nobody Wed Feb 11 20:44:03 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 4fB9QD2Lhyz6SBqf for ; Wed, 11 Feb 2026 20:44:04 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fB9QC6qJYz3PXX for ; Wed, 11 Feb 2026 20:44:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770842644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L9VcGKmVGCSWzSfYybzZI2jFhOCrhwtwPdhJpupla28=; b=byVbLNFFHWw1FG/4QU19i0I0WIFFVetuJAdhDFApDVIzZfnUZsEEvNp4X3zcoe+czkCuiW kDwGLePDRPBQ+MXpzIDwrSjohtWaVW5cnMvlm55M455pnaTynvSQ8LbbpqIp1aHPSCtLDs snK8W9yIHutRWr9QZK0HGJo+1hb1GcSsNmMgehaItyqjZmyzbQNmyyhRVUwM3tV2jnG49z wtYI7GCShc4Ah5Njf3Ve18Ao4t6hvjX/+p9opLawZeCgfdVOBwhjmY77x4Zw+B/UVhe0y6 4vC1SMm5TQETxWgAvf3t4cROaNHy6PwmfgIzwd7BPMCgk88s8aJt7UBpGOxd+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770842644; a=rsa-sha256; cv=none; b=c0YETb9WsRDeT0fS+q9lqvzfLZnSxsv23QEf3GeiC9y4QY2wRfxFUV67Mgjv9bMS+pUslz VeOmNRnq1TShTR2HR85LYUWAk+3Henvl97laGrXt638yqXw9L+roRmWBY1UU5VsoU+WkfJ 8FNkH0Q/GJIavzs4773jAMGMHbxBRFtlHKs3484WlJKg6MeLk+OCfvAYVfHUFaM9yRMioG 8hGnB0Y405hyDlX91r6Ip8avf5IJtXmbMPJX+824s0DxCoXjj/h/x5KRjvmFEyRT2AmqWL 3AexRyOEsVlSKOMIIz8mSIqPLwbh/Q0KCXX/PZKzm+mKzaeX7CPggY81DNSCoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770842644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L9VcGKmVGCSWzSfYybzZI2jFhOCrhwtwPdhJpupla28=; b=cQUQzKxFIB/Y3Ukz2huzthouKGlkUSboQwao1ATylyM5UlIMSEnYIWi8rQefq7/dav3isU kGS6RatAHLXoYPdjTk0vKX5Qy8zKddn+rDAbi9rvcyMuvGQjFV10eGPzroyrAto4BfZ46n z/lqgTNtjyk+B1DH1Qef23jftvQmoshF1Ek6o/4wF04b2VXdJ5u3Qv1fB+A2OGwYiUcx0R ViQWQ0j6P6In9D/1eGZDrooiF+eaab6eN+VHH8qYdxpv555W5yioJrdAeqqPzcsaRZalFv cbp3KzLARl4VhEkmlJzgwbJ6iJnvc4ymNgZmwqp0dVYt2WVHJunl+8MLaTuAWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fB9QC6P0cz15L1 for ; Wed, 11 Feb 2026 20:44:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46046 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 11 Feb 2026 20:44:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 951788e3733e - main - hwpstate_amd(4): 'epp' sysctl leaf to operate on real EPP hardware values List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 951788e3733e415ca4721c0a63454937dcb29b2c Auto-Submitted: auto-generated Date: Wed, 11 Feb 2026 20:44:03 +0000 Message-Id: <698cea13.46046.5ecd1411@gitrepo.freebsd.org> The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=951788e3733e415ca4721c0a63454937dcb29b2c commit 951788e3733e415ca4721c0a63454937dcb29b2c Author: Olivier Certner AuthorDate: 2026-01-27 11:44:29 +0000 Commit: Olivier Certner CommitDate: 2026-02-11 20:43:21 +0000 hwpstate_amd(4): 'epp' sysctl leaf to operate on real EPP hardware values We were using percents, for compatibility with hwpstate_intel(4), but this looses granularity that might be important in some scenarios or with specific CPU models. For consistency, hwpstate_intel(4) should be changed accordingly, at the expense of breaking compatibility. For release notes: Introduction of hwpstate_amd(4) deserves a release note, even if the original commit was not tagged. Functionality introduced by recent commits tagged with "Relnotes" should be mentioned along that one. PR: 292615 Reviewed by: aokblast Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55009 --- sys/x86/cpufreq/hwpstate_amd.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/sys/x86/cpufreq/hwpstate_amd.c b/sys/x86/cpufreq/hwpstate_amd.c index 18d420dc7747..c35fe0719d74 100644 --- a/sys/x86/cpufreq/hwpstate_amd.c +++ b/sys/x86/cpufreq/hwpstate_amd.c @@ -428,30 +428,25 @@ sysctl_epp_handler(SYSCTL_HANDLER_ARGS) { const u_int max_epp = BITS_VALUE(AMD_CPPC_REQUEST_EPP_BITS, (uint64_t)-1); - const device_t dev = oidp->oid_arg1; + const device_t dev = arg1; struct hwpstate_softc *const sc = device_get_softc(dev); u_int val; - int error = 0; + int error; /* Sysctl knob does not exist if PSTATE_CPPC is not set. */ check_cppc_enabled(sc, __func__); - val = BITS_VALUE(AMD_CPPC_REQUEST_EPP_BITS, sc->cppc.request) * 100 / - max_epp; + val = BITS_VALUE(AMD_CPPC_REQUEST_EPP_BITS, sc->cppc.request); + error = sysctl_handle_int(oidp, &val, 0, req); if (error != 0 || req->newptr == NULL) - goto end; - if (val > 100) { - error = EINVAL; - goto end; - } - val = (val * max_epp) / 100; + return (error); + if (val > max_epp) + return (EINVAL); error = set_cppc_request(dev, BITS_WITH_VALUE(AMD_CPPC_REQUEST_EPP_BITS, val), BITS_WITH_VALUE(AMD_CPPC_REQUEST_EPP_BITS, -1)); - -end: return (error); } @@ -924,7 +919,7 @@ hwpstate_attach(device_t dev) "epp", CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, dev, 0, sysctl_epp_handler, "IU", "Efficiency/Performance Preference " - "(range from 0, most performant, through 100, most efficient)"); + "(range from 0, most performant, through 255, most efficient)"); } return (cpufreq_register(dev)); }