x86: move vgetcpu mode probing to cpu detection

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, October 13, 2008 - 11:08 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e04d64...
Commit:     e04d645f326bc8e591bc4ae21c4ab535987a17c1
Parent:     33c053d0aec344c8b2ad6966d904ebeff64e590b
Author:     Glauber Costa <glommer@redhat.com>
AuthorDate: Mon Sep 22 14:35:08 2008 -0300
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Mon Oct 13 10:21:49 2008 +0200

    x86: move vgetcpu mode probing to cpu detection
    
    Take it out of time initialization and move it to
    cpu detection time.
    
    Signed-off-by: Glauber Costa <glommer@redhat.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/kernel/cpu/common.c |   12 ++++++++++++
 arch/x86/kernel/time_64.c    |    4 ----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 088fbdb..f1af718 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -719,12 +719,24 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
 #endif
 }
 
+#ifdef CONFIG_X86_64
+static void vgetcpu_set_mode(void)
+{
+	if (cpu_has(&boot_cpu_data, X86_FEATURE_RDTSCP))
+		vgetcpu_mode = VGETCPU_RDTSCP;
+	else
+		vgetcpu_mode = VGETCPU_LSL;
+}
+#endif
+
 void __init identify_boot_cpu(void)
 {
 	identify_cpu(&boot_cpu_data);
 #ifdef CONFIG_X86_32
 	sysenter_setup();
 	enable_sep_cpu();
+#else
+	vgetcpu_set_mode();
 #endif
 }
 
diff --git a/arch/x86/kernel/time_64.c b/arch/x86/kernel/time_64.c
index 207a7a1..cb19d65 100644
--- a/arch/x86/kernel/time_64.c
+++ b/arch/x86/kernel/time_64.c
@@ -130,10 +130,6 @@ void __init hpet_time_init(void)
 void __init time_init(void)
 {
 	tsc_init();
-	if (cpu_has(&boot_cpu_data, X86_FEATURE_RDTSCP))
-		vgetcpu_mode = VGETCPU_RDTSCP;
-	else
-		vgetcpu_mode = VGETCPU_LSL;
 
 	late_time_init = choose_time_init();
 }
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
x86: move vgetcpu mode probing to cpu detection, Linux Kernel Mailing ..., (Mon Oct 13, 11:08 am)