Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jul 2026 14:40:54 +0100
From:      Jessica Clarke <jrtc27@freebsd.org>
To:        ShengYi Hung <aokblast@FreeBSD.org>
Cc:        "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org>, Harry Schmalzb <freebsd@omnilan.de>
Subject:   Re: git: bdc0f7678257 - main - hwpstate_intel: Fix i386 build
Message-ID:  <B6129E16-9F82-4252-A8F1-C447DF0CC177@freebsd.org>
In-Reply-To: <6a5cd2fb.3bcc6.f82cb9f@gitrepo.freebsd.org>

index | next in thread | previous in thread | raw e-mail

On 19 Jul 2026, at 14:36, ShengYi Hung <aokblast@FreeBSD.org> wrote:
> 
> The branch main has been updated by aokblast:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=bdc0f7678257eaa739b9c816285504470e71e3de
> 
> commit bdc0f7678257eaa739b9c816285504470e71e3de
> Author:     Harry Schmalzb <freebsd@omnilan.de>
> AuthorDate: 2026-07-13 05:29:34 +0000
> Commit:     ShengYi Hung <aokblast@FreeBSD.org>
> CommitDate: 2026-07-19 13:36:00 +0000
> 
>    hwpstate_intel: Fix i386 build
> 
>    Reviewed by:    olce
>    Fixes:  7b26353a59d6
>    MFC after:      3 days
>    Sponsored by:   The FreeBSD Foundation
>    Differential Revision: https://reviews.freebsd.org/D58208
> ---
> sys/x86/cpufreq/hwpstate_intel.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
> 
> diff --git a/sys/x86/cpufreq/hwpstate_intel.c b/sys/x86/cpufreq/hwpstate_intel.c
> index 59d7a155fda8..56a33fa88e66 100644
> --- a/sys/x86/cpufreq/hwpstate_intel.c
> +++ b/sys/x86/cpufreq/hwpstate_intel.c
> @@ -352,13 +352,19 @@ intel_hwpstate_hybrid_cb(void *ctx)
> {
> uint32_t *small_cores = ctx;
> 
> +#ifdef __i386__
> + (void)small_cores;
> +#else
> atomic_add_32(small_cores, PCPU_GET(small_core));
> +#endif
> }

Hi,
The whole point of my suggestion was that this would be the only part
of the diff needed. By stubbing out the function, small_cores is never
incremented, and so the code ifndef’ed out below is dead without the
need for as many ifndefs.

Jessica

> void
> intel_hwpstate_identify(driver_t *driver, device_t parent)
> {
> +#ifndef __i386__
> uint32_t small_cores = 0;
> +#endif
> 
> if (device_find_child(parent, "hwpstate_intel", DEVICE_UNIT_ANY) != NULL)
> return;
> @@ -379,6 +385,7 @@ intel_hwpstate_identify(driver_t *driver, device_t parent)
> if ((cpu_power_eax & CPUTPM1_HWP) == 0)
> return;
> 
> +#ifndef __i386__
> /*
> * On hybrid-core systems, package-level control cannot be used.
> * It may cause all cores to run at the E-core frequency because
> @@ -389,6 +396,7 @@ intel_hwpstate_identify(driver_t *driver, device_t parent)
>    intel_hwpstate_hybrid_cb, smp_no_rendezvous_barrier, &small_cores);
> if (small_cores > 0 && small_cores < mp_ncores)
> hwpstate_pkg_ctrl_enable = false;
> +#endif
> 
> if (BUS_ADD_CHILD(parent, 10, "hwpstate_intel", device_get_unit(parent))
>    == NULL)
> 



home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B6129E16-9F82-4252-A8F1-C447DF0CC177>