From nobody Fri Feb 6 19:03:12 2026 X-Original-To: dev-commits-src-main@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 4f73Qt55rVz6FSmP; Fri, 06 Feb 2026 19:03:50 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Received: from smtp6.goneo.de (smtp6.goneo.de [IPv6:2001:1640:5::8:31]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4f73Qt2YMJz3PsZ; Fri, 06 Feb 2026 19:03:50 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Authentication-Results: mx1.freebsd.org; none Received: from hub1.goneo.de (hub1.goneo.de [IPv6:2001:1640:5::8:52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp6.goneo.de (Postfix) with ESMTPS id 92DF324103D; Fri, 6 Feb 2026 20:03:42 +0100 (CET) Received: from hub1.goneo.de (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by hub1.goneo.de (Postfix) with ESMTPS id B8DE6240278; Fri, 6 Feb 2026 20:03:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walstatt-de.de; s=DKIM001; t=1770404620; 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: in-reply-to:in-reply-to:references:references; bh=r5IQIT8AokrDRjRoc0wovOdmCIavQKRZggqVRDHiCyE=; b=Q3S0VFhoKy9N78f0s0x0HM+V1wxM0b1ITtjveGgOWQcjwNI7BWZRiOESgRFO9ZnnRVC4A9 zzUj19Mjm1qbEsF64VmymJEKKtwPzw/t1gyIQsUFk1NIdkyfzH1DfNeCPf1hwQAJqE+U33 YkWKd3303/VB1AfwvOeABfeSPZ109mB2NeFB3QPLAEVVggrL8lhz/+Ql7BASCIIVtfuiM/ cpT1l8iIAl6gteiUICGCrWf/Z044c3QyVepH1jmx+LNfZ63Q7qc3YjFlLwfiuMPhGHDkJ9 Egbxj71o/WpCQ0rOQCkNXXu2T1ZPTXMkBTS3XOkfk4cKkwH2XiLWryK4/AnSCg== Received: from thor.sb211.local (dynamic-2a02-3100-1a6f-b002-ce3a-ff67-64fc-d552.310.pool.telefonica.de [IPv6:2a02:3100:1a6f:b002:ce3a:ff67:64fc:d552]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hub1.goneo.de (Postfix) with ESMTPSA id 60D55240276; Fri, 6 Feb 2026 20:03:40 +0100 (CET) Date: Fri, 6 Feb 2026 20:03:12 +0100 From: A FreeBSD User To: Olivier Certner Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 804329587508 - main - hwpstate{_amd,intel}(4): Move common knobs to a separate file Message-ID: <20260206195430.50c28a04@thor.sb211.local> In-Reply-To: <69861577.1d172.fd5fa27@gitrepo.freebsd.org> References: <69861577.1d172.fd5fa27@gitrepo.freebsd.org> X-Mailer: Claws Mail 3.21.0 (GTK+ 2.24.33; amd64-portbld-freebsd16.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/eGQLsQUcQYcU6=Ziywq___1"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Rspamd-UID: 31de44 X-Rspamd-UID: 5bab65 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:25394, ipnet:2001:1640::/32, country:DE] X-Rspamd-Queue-Id: 4f73Qt2YMJz3PsZ X-Spamd-Bar: ---- --Sig_/eGQLsQUcQYcU6=Ziywq___1 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Am Tage des Herren Fri, 06 Feb 2026 16:23:19 +0000 Olivier Certner schrieb: > The branch main has been updated by olce: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D8043295875083b57a6b7b2dc68= 26fde4cf4e1ba1 >=20 > commit 8043295875083b57a6b7b2dc6826fde4cf4e1ba1 > Author: Olivier Certner > AuthorDate: 2026-02-06 10:58:07 +0000 > Commit: Olivier Certner > CommitDate: 2026-02-06 16:23:07 +0000 >=20 > hwpstate{_amd,intel}(4): Move common knobs to a separate file > =20 > Reason for doing this right now is to resolve the conflict on > 'machdep.hwpstate_pkg_ctrl' between the Intel and AMD drivers, even > though I expect to remove it for hwpstate_amd(4) at some point. > =20 > More generally, this is going to be useful for some future code > factorization. Also, the 'debug.hwpstate_verbose' knob was moved the= re, > as we'll likely want to use it for the Intel driver as well (which is > currently not the case). > =20 > Note for MFC: Will be partial, since `hwpstate_amd(4)` does not suppo= rt > CPPC in stable/15 nor stable/14. > =20 > Reviewed by: emaste > Fixes: 3e6e4e4a0d42 ("hwpstate: add CPPC support for pstate = driver on AMD") > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D54528 > --- > sys/conf/files.x86 | 1 + > sys/modules/cpufreq/Makefile | 3 ++- > sys/x86/cpufreq/hwpstate_amd.c | 11 ++--------- > sys/x86/cpufreq/hwpstate_common.c | 22 ++++++++++++++++++++++ > sys/x86/cpufreq/hwpstate_common.h | 13 +++++++++++++ > sys/x86/cpufreq/hwpstate_intel.c | 6 +----- > 6 files changed, 41 insertions(+), 15 deletions(-) >=20 > diff --git a/sys/conf/files.x86 b/sys/conf/files.x86 > index b1bd6f7291ca..fabcd5d9ebe5 100644 > --- a/sys/conf/files.x86 > +++ b/sys/conf/files.x86 > @@ -342,6 +342,7 @@ x86/acpica/srat.c optional acpi > x86/bios/vpd.c optional vpd > x86/cpufreq/est.c optional cpufreq > x86/cpufreq/hwpstate_amd.c optional cpufreq > +x86/cpufreq/hwpstate_common.c optional cpufreq > x86/cpufreq/hwpstate_intel.c optional cpufreq > x86/cpufreq/p4tcc.c optional cpufreq > x86/cpufreq/powernow.c optional cpufreq > diff --git a/sys/modules/cpufreq/Makefile b/sys/modules/cpufreq/Makefile > index 9a417f72fc27..23b4c97f5393 100644 > --- a/sys/modules/cpufreq/Makefile > +++ b/sys/modules/cpufreq/Makefile > @@ -9,7 +9,8 @@ SRCS+=3D bus_if.h cpufreq_if.h device_if.h pci_if.h > .PATH: ${SRCTOP}/sys/x86/cpufreq > =20 > SRCS+=3D acpi_if.h opt_acpi.h > -SRCS+=3D est.c hwpstate_amd.c p4tcc.c powernow.c hwpstate_intel.c > +SRCS+=3D est.c p4tcc.c powernow.c > +SRCS+=3D hwpstate_amd.c hwpstate_common.c hwpstate_intel.c > .endif > =20 > .if ${MACHINE} =3D=3D "i386" > diff --git a/sys/x86/cpufreq/hwpstate_amd.c b/sys/x86/cpufreq/hwpstate_am= d.c > index d8ad090a6a58..0afc0919aa16 100644 > --- a/sys/x86/cpufreq/hwpstate_amd.c > +++ b/sys/x86/cpufreq/hwpstate_amd.c > @@ -68,6 +68,8 @@ > =20 > #include > =20 > +#include > + > #include "acpi_if.h" > #include "cpufreq_if.h" > =20 > @@ -162,10 +164,6 @@ static int hwpstate_get_info_from_acpi_perf(device_t= dev, > device_t perf_dev); static int hwpstate_get_info_from_msr(device_t dev); > static int hwpstate_goto_pstate(device_t dev, int pstate_id); > =20 > -static int hwpstate_verbose; > -SYSCTL_INT(_debug, OID_AUTO, hwpstate_verbose, CTLFLAG_RWTUN, > - &hwpstate_verbose, 0, "Debug hwpstate"); > - > static int hwpstate_verify; > SYSCTL_INT(_debug, OID_AUTO, hwpstate_verify, CTLFLAG_RWTUN, > &hwpstate_verify, 0, "Verify P-state after setting"); > @@ -176,11 +174,6 @@ SYSCTL_BOOL(_debug, OID_AUTO, hwpstate_pstate_limit,= CTLFLAG_RWTUN, > "If enabled (1), limit administrative control of P-states to the val= ue in " > "CurPstateLimit"); > =20 > -static bool hwpstate_pkg_ctrl_enable =3D true; > -SYSCTL_BOOL(_machdep, OID_AUTO, hwpstate_pkg_ctrl, CTLFLAG_RDTUN, > - &hwpstate_pkg_ctrl_enable, 0, > - "Set 1 (default) to enable package-level control, 0 to disable"); > - > static bool hwpstate_amd_cppc_enable =3D true; > SYSCTL_BOOL(_machdep, OID_AUTO, hwpstate_amd_cppc_enable, CTLFLAG_RDTUN, > &hwpstate_amd_cppc_enable, 0, > diff --git a/sys/x86/cpufreq/hwpstate_common.c b/sys/x86/cpufreq/hwpstate= _common.c > new file mode 100644 > index 000000000000..60d84f9983a6 > --- /dev/null > +++ b/sys/x86/cpufreq/hwpstate_common.c > @@ -0,0 +1,22 @@ > +/* > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2026 The FreeBSD Foundation > + * > + * This software was developed by Olivier Certner at = Kumacom > + * SARL under sponsorship from the FreeBSD Foundation. > + */ > + > +#include > + > +#include > + > + > +int hwpstate_verbose; > +SYSCTL_INT(_debug, OID_AUTO, hwpstate_verbose, CTLFLAG_RWTUN, > + &hwpstate_verbose, 0, "Debug hwpstate"); > + > +bool hwpstate_pkg_ctrl_enable =3D true; > +SYSCTL_BOOL(_machdep, OID_AUTO, hwpstate_pkg_ctrl, CTLFLAG_RDTUN, > + &hwpstate_pkg_ctrl_enable, 0, > + "Set 1 (default) to enable package-level control, 0 to disable"); > diff --git a/sys/x86/cpufreq/hwpstate_common.h b/sys/x86/cpufreq/hwpstate= _common.h > new file mode 100644 > index 000000000000..953037672c0f > --- /dev/null > +++ b/sys/x86/cpufreq/hwpstate_common.h > @@ -0,0 +1,13 @@ > +/* > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2026 The FreeBSD Foundation > + * > + * This software was developed by Olivier Certner at = Kumacom > + * SARL under sponsorship from the FreeBSD Foundation. > + */ > + > +/* Stuff common to hwpstate_amd(4) and hwpstate_intel(4). */ > + > +extern int hwpstate_verbose; > +extern bool hwpstate_pkg_ctrl_enable; > diff --git a/sys/x86/cpufreq/hwpstate_intel.c b/sys/x86/cpufreq/hwpstate_= intel.c > index 259aeac399c8..3d2cc0a5966b 100644 > --- a/sys/x86/cpufreq/hwpstate_intel.c > +++ b/sys/x86/cpufreq/hwpstate_intel.c > @@ -48,6 +48,7 @@ > =20 > #include > =20 > +#include > #include > =20 > #include "acpi_if.h" > @@ -108,11 +109,6 @@ static driver_t hwpstate_intel_driver =3D { > DRIVER_MODULE(hwpstate_intel, cpu, hwpstate_intel_driver, NULL, NULL); > MODULE_VERSION(hwpstate_intel, 1); > =20 > -static bool hwpstate_pkg_ctrl_enable =3D true; > -SYSCTL_BOOL(_machdep, OID_AUTO, hwpstate_pkg_ctrl, CTLFLAG_RDTUN, > - &hwpstate_pkg_ctrl_enable, 0, > - "Set 1 (default) to enable package-level control, 0 to disable"); > - > static int > intel_hwp_dump_sysctl_handler(SYSCTL_HANDLER_ARGS) > { >=20 The commit break buildworld/buildkernel: [...] /usr/src/sys/x86/cpufreq/hwpstate_common.c:16:48: error: expected ')' ... /usr/src/sys/x86/cpufreq/hwpstate_common.c:20:52: error: type specifier mis= sing, defaults to 'int'; ISO C99 and later do not support implicit int [-Werror,-Wimplicit-in= t] Kind regards, oh --=20 A FreeBSD user --Sig_/eGQLsQUcQYcU6=Ziywq___1 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRQheDybVktG5eW/1Kxzvs8OqokrwUCaYY7CwAKCRCxzvs8Oqok rw7rAQDqlbe8hlI/cXHYSJi58UQ/ptGa6isfkSkSUFt1Rnjb0AD/TDe4hWaV/CHO pIWyPCaIMtL5AzAfE5jRxc3LKbcPswY= =NS2F -----END PGP SIGNATURE----- --Sig_/eGQLsQUcQYcU6=Ziywq___1--