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: <1255396899.31156.71.camel@ank32.eng.vmware.com>
Date:	Mon, 12 Oct 2009 18:21:39 -0700
From:	Alok Kataria <akataria@...are.com>
To:	"Hillier, Gernot" <gernot.hillier@...mens.com>
Cc:	"x86@...nel.org" <x86@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86: avoid modifying global flag tsc_unstable in
	unsychronized_tsc()


On Mon, 2009-10-12 at 07:22 -0700, Hillier, Gernot wrote:
> From: Gernot Hillier <gernot.hillier@...mens.com>
> 
> The current behavior of unsynchronized_tsc() prevents the warning for
> unsychronized TSCs to be printed: tsc_init() calls unsynchronized_tsc()
> first to check for such problems; if found, mark_tsc_unstable() is
> called. However, the latter bails out immediately as unsynchronized_
> tsc() did already set the global flag tsc_unstable. Thus, the intended
> warning message "Marking TSC unstable due to TSCs unsynchronized" won't
> show up.
> 
> This patch changes the behavior for unsynchronized_tsc() to only *check*
> for the quirk condition, but not to modify any global flags. If I'm not
> mistaken, the only place to *set* the flag shall be mark_tsc_unstable().

Yes, you are right. The patch looks good to me.

Thanks,
Alok

> 
> Signed-off-by: Gernot Hillier <gernot.hillier@...mens.com>
> Reviewed-by: Jan Kiszka <jan.kiszka@...mens.com>
> Reviewed-by: Wolfgang Mauerer <wolfgang.mauerer@...mens.com>
> 
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index cd982f4..ffbb786 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -836,10 +836,10 @@ __cpuinit int unsynchronized_tsc(void)
>  	if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) {
>  		/* assume multi socket systems are not synchronized: */
>  		if (num_possible_cpus() > 1)
> -			tsc_unstable = 1;
> +			return 1;
>  	}
> 
> -	return tsc_unstable;
> +	return 0;
>  }
> 
>  static void __init init_tsc_clocksource(void)
> 

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