All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alok Kataria <akataria@vmware.com>
To: "Hillier, Gernot" <gernot.hillier@siemens.com>
Cc: "x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86: avoid modifying global flag tsc_unstable in unsychronized_tsc()
Date: Mon, 12 Oct 2009 18:21:39 -0700	[thread overview]
Message-ID: <1255396899.31156.71.camel@ank32.eng.vmware.com> (raw)
In-Reply-To: <4AD33BB0.8080903@siemens.com>


On Mon, 2009-10-12 at 07:22 -0700, Hillier, Gernot wrote:
> From: Gernot Hillier <gernot.hillier@siemens.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@siemens.com>
> Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
> Reviewed-by: Wolfgang Mauerer <wolfgang.mauerer@siemens.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)
> 


      reply	other threads:[~2009-10-13  1:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-12 14:22 [PATCH] x86: avoid modifying global flag tsc_unstable in unsychronized_tsc() Hillier, Gernot
2009-10-13  1:21 ` Alok Kataria [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1255396899.31156.71.camel@ank32.eng.vmware.com \
    --to=akataria@vmware.com \
    --cc=gernot.hillier@siemens.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.