lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <67ffd6b7-55c2-4ee0-9243-44bf8336152d@intel.com>
Date: Fri, 5 Sep 2025 14:32:38 -0700
From: Sohil Mehta <sohil.mehta@...el.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>
CC: Viresh Kumar <viresh.kumar@...aro.org>, <linux-pm@...r.kernel.org>,
	<x86@...nel.org>, Tony Luck <tony.luck@...el.com>, Zhao Liu
	<zhao1.liu@...ux.intel.com>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] cpufreq: ondemand: Update the efficient idle check for
 Intel extended Families

On 9/4/2025 1:02 PM, Rafael J. Wysocki wrote:

> 
> Since you are adding this #ifdef below, why don't you go a bit farther and do
> 
>> +#ifdef CONFIG_X86
>> +#include <asm/cpu_device_id.h>
> 
> static bool should_io_be_busy(void)
> {
>        /* All Intel Family 6 and later processors have efficient idle. */
>        return boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
> boot_cpu_data.x86_vfm >= INTEL_PENTIUM_PRO;
> }
> #else
> static inline bool should_io_be_busy(void)
> {
>         return false;
> }
>> +#endif
>> +
>>  #include "cpufreq_ondemand.h"
>>

I am fine with this approach. Would moving the #define to the header be
slightly better?

Add to cpufreq_ondemand.h:

#ifdef CONFIG_X86
#include <asm/cpu_device_id.h>
bool od_should_io_be_busy(void);
#else
static inline bool od_should_io_be_busy(void) { return false; }
#endif

Then, cpufreq_ondemand.c doesn't need the #ifdefs. It can simply do:

bool od_should_io_be_busy(void)
{
	/* For Intel, Family 6 and later have an efficient idle. */
	return (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
		boot_cpu_data.x86_vfm >= INTEL_PENTIUM_PRO);
}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ