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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 18 Jun 2009 12:17:12 -0700
From:	john stultz <johnstul@...ibm.com>
To:	Magnus Damm <magnus.damm@...il.com>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, lethal@...ux-sh.org,
	tglx@...utronix.de, akpm@...ux-foundation.org
Subject: Re: [PATCH] clocksource: save mult_orig in clocksource_disable()

On Fri, 2009-06-19 at 00:24 +0900, Magnus Damm wrote:
> From: Magnus Damm <damm@...l.co.jp>
> 
> Save clocksource mult_orig in clocksource_disable().
> 
> To fix the common case where ->enable() does not setup
> mult, make sure mult_orig is saved in mult on disable.
> 
> Also add comments to explain why we do this.
> 
> Signed-off-by: Magnus Damm <damm@...l.co.jp>

Acked-by: John Stultz <johnstul@...ibm.com>

Thomas, Andrew, please push this for 2.6.31.

thanks
-john


> ---
> 
>  include/linux/clocksource.h |   12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> --- 0001/include/linux/clocksource.h
> +++ work/include/linux/clocksource.h	2009-06-19 00:12:16.000000000 +0900
> @@ -293,7 +293,11 @@ static inline int clocksource_enable(str
>  	if (cs->enable)
>  		ret = cs->enable(cs);
> 
> -	/* save mult_orig on enable */
> +	/* The frequency may have changed while the clocksource
> +	 * was disabled. If so the code in ->enable() must update
> +	 * the mult value to reflect the new frequency. Make sure
> +	 * mult_orig follows this change.
> +	 */
>  	cs->mult_orig = cs->mult;
> 
>  	return ret;
> @@ -309,6 +313,12 @@ static inline int clocksource_enable(str
>   */
>  static inline void clocksource_disable(struct clocksource *cs)
>  {
> +	/* Save mult_orig in mult so clocksource_enable() can
> +	 * restore the value regardless if ->enable() updates
> +	 * the value of mult or not.
> +	 */
> +	cs->mult = cs->mult_orig;
> +
>  	if (cs->disable)
>  		cs->disable(cs);
>  }

--
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