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] [thread-next>] [day] [month] [year] [list]
Message-id: <20140324092112.74f930d3@amdc2363>
Date:	Mon, 24 Mar 2014 09:21:12 +0100
From:	Lukasz Majewski <l.majewski@...sung.com>
To:	Viresh Kumar <viresh.kumar@...aro.org>
Cc:	rjw@...ysocki.net, linaro-kernel@...ts.linaro.org,
	cpufreq@...r.kernel.org, linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org, srivatsa.bhat@...ux.vnet.ibm.com,
	ego@...ux.vnet.ibm.com, svaidy@...ux.vnet.ibm.com
Subject: Re: [PATCH] cpufreq: set value of CPUFREQ_BOOST_FREQ to 0xABABABAB

Hi Viresh,

> Ideally, .driver_data field of struct cpufreq_frequency_table must
> not be used by core at all. But during a recent change if its value
> is same as CPUFREQ_BOOST_FREQ macro, then it is treated specially by
> core.
> 
> The value of this macro was set to ~2 earlier, i.e. 0xFFFFFFFD. In
> case some driver is using this field for its own data and sets this
> field to -3, then with two's complement that value will also become
> 0xFFFFFFFD.
> 
> To fix this issue, lets change value of this flag to a very uncommon
> value which shouldn't be used by any driver unless they want to use
> BOOST feature.
> 
> Along with this update comments to make this more clear.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
> ---
> 
> Gautham/Vaidy: I hope this fixes the problem we discussed for your
> patchset.
> 

I think that a name of the patchset, for which the current setting
causes problem would be welcome here.

Otherwise, I can only ask why it is not possible to add 
#define SPECIAL_SETTING ~3 ?


>  include/linux/cpufreq.h | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> index c48e595..9f25d9d 100644
> --- a/include/linux/cpufreq.h
> +++ b/include/linux/cpufreq.h
> @@ -455,12 +455,18 @@ extern struct cpufreq_governor
> cpufreq_gov_conservative;
>   *                     FREQUENCY TABLE HELPERS
> *
> *********************************************************************/ 
> +/* Special Values of .frequency field */
>  #define CPUFREQ_ENTRY_INVALID ~0
>  #define CPUFREQ_TABLE_END     ~1
> -#define CPUFREQ_BOOST_FREQ    ~2
> +/* Special Values of .driver_data field */
> +#define CPUFREQ_BOOST_FREQ    0xABABABAB
>  
>  struct cpufreq_frequency_table {
> -	unsigned int	driver_data; /* driver specific data,
> not used by core */
> +	/*
> +	 * driver specific data, not used by core unless it is set to
> +	 * CPUFREQ_BOOST_FREQ.
> +	 */
> +	unsigned int	driver_data;
>  	unsigned int	frequency; /* kHz - doesn't need to be
> in ascending
>  				    * order */
>  };



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ