All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Ian Campbell <ijc@hellion.org.uk>
Cc: mingo@elte.hu, hpa@zytor.com, tglx@linutronix.de,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [4/7] Convert TSC disabling to generic cpuid disable bitmap
Date: Sat, 19 Jan 2008 19:57:21 +0100	[thread overview]
Message-ID: <200801191957.21832.ak@suse.de> (raw)
In-Reply-To: <1200766548.32050.32.camel@cthulhu.hellion.org.uk>

On Saturday 19 January 2008 19:15:48 Ian Campbell wrote:
> On Fri, 2008-01-18 at 18:27 +0100, Andi Kleen wrote:
> > Index: linux/arch/x86/xen/time.c
> > ===================================================================
> > --- linux.orig/arch/x86/xen/time.c
> > +++ linux/arch/x86/xen/time.c
> > @@ -592,7 +592,7 @@ __init void xen_time_init(void)
> >         set_normalized_timespec(&wall_to_monotonic,
> >                                 -xtime.tv_sec, -xtime.tv_nsec);
> >  
> > -       tsc_disable = 0;
> > +       setup_clear_cpu_cap(X86_FEATURE_TSC);
> >  
> >         xen_setup_timer(cpu);
> >         xen_setup_cpu_clockevents();
> 
> That inverts the meaning, doesn't it? Previously the code force the TSC
> to be on and now it forcefully disables it. Now when booting a Xen guest
> I get:
>         Kernel panic - not syncing: Kernel compiled for Pentium+, requires TSC feature!

You're right -- i was a bit overzealous in search'n'replace with that one.
It's the only place who force enables TSC.


> diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
> index 6f5c74a..b3721fd 100644
> --- a/arch/x86/xen/time.c
> +++ b/arch/x86/xen/time.c
> @@ -592,7 +592,7 @@ __init void xen_time_init(void)
>  	set_normalized_timespec(&wall_to_monotonic,
>  				-xtime.tv_sec, -xtime.tv_nsec);
>  
> -	setup_clear_cpu_cap(X86_FEATURE_TSC);
> +	setup_force_cpu_cap(X86_FEATURE_TSC);

Actually that would be only needed if someone else disabled TSC explicitely before.

Simply deleting this should be sufficient. Does this patch work for you?

It would break if someone passes notsc to a Xen kernel, but then a lot of options make the kernel
break if you don't know what you're doing so that doesn't seem like a big issue.

-Andi

---

Don't disable TSC in Xen boot

That was a typo in the previous TSC option changes.

TSC shouldn't be disabled at this point, so just don't do anything.

Signed-off-by: Andi Kleen <ak@suse.de>

Index: linux/arch/x86/xen/time.c
===================================================================
--- linux.orig/arch/x86/xen/time.c
+++ linux/arch/x86/xen/time.c
@@ -592,8 +592,6 @@ __init void xen_time_init(void)
 	set_normalized_timespec(&wall_to_monotonic,
 				-xtime.tv_sec, -xtime.tv_nsec);
 
-	setup_clear_cpu_cap(X86_FEATURE_TSC);
-
 	xen_setup_timer(cpu);
 	xen_setup_cpu_clockevents();
 }

  reply	other threads:[~2008-01-19 18:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-18 17:27 [PATCH] [0/7] Add noclflush option and related cleanup Andi Kleen
2008-01-18 17:27 ` [PATCH] [1/7] Add frame work to disable CPUID bits on the command line Andi Kleen
2008-01-18 17:27 ` [PATCH] [2/7] Convert some existing cpuid disable options to new generic bitmap Andi Kleen
2008-01-18 17:27 ` [PATCH] [3/7] Don't disable RDTSC in userland for 32bit notsc Andi Kleen
2008-01-18 17:27 ` [PATCH] [4/7] Convert TSC disabling to generic cpuid disable bitmap Andi Kleen
2008-01-19 18:15   ` Ian Campbell
2008-01-19 18:57     ` Andi Kleen [this message]
2008-01-19 22:29       ` Ian Campbell
2008-01-19 18:18   ` Ian Campbell
2008-01-18 17:27 ` [PATCH] [5/7] Remove CONFIG_X86_TSC for 32bit Andi Kleen
2008-01-18 21:05   ` [PATCH] [5/7] Remove CONFIG_X86_TSC for 32bit II Andi Kleen
2008-01-18 22:06     ` Ingo Molnar
2008-01-18 17:27 ` [PATCH] [6/7] Add noclflush option Andi Kleen
2008-01-18 17:27 ` [PATCH] [7/7] Add generic clearcpuid=... option Andi Kleen

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=200801191957.21832.ak@suse.de \
    --to=ak@suse.de \
    --cc=hpa@zytor.com \
    --cc=ijc@hellion.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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.