mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Robert Richter <robert.richter@amd.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	robert.richter@amd.com, suresh.b.siddha@intel.com,
	tglx@linutronix.de, hpa@linux.intel.com
Subject: [tip:x86/xsave] x86, xsave: Move boot cpu initialization to xsave_init()
Date: Wed, 21 Jul 2010 00:40:22 GMT	[thread overview]
Message-ID: <tip-82d4150cec83b9775f84810b39a1c0b91585d429@git.kernel.org> (raw)
In-Reply-To: <1279651857-24639-5-git-send-email-robert.richter@amd.com>

Commit-ID:  82d4150cec83b9775f84810b39a1c0b91585d429
Gitweb:     http://git.kernel.org/tip/82d4150cec83b9775f84810b39a1c0b91585d429
Author:     Robert Richter <robert.richter@amd.com>
AuthorDate: Tue, 20 Jul 2010 20:50:51 +0200
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Tue, 20 Jul 2010 16:21:44 -0700

x86, xsave: Move boot cpu initialization to xsave_init()

This patch moves boot cpu initialization to xsave_init(). Now all cpus
are initialized in one single function.

Signed-off-by: Robert Richter <robert.richter@amd.com>
LKML-Reference: <1279651857-24639-5-git-send-email-robert.richter@amd.com>
Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/kernel/cpu/common.c |    6 ------
 arch/x86/kernel/i387.c       |    5 -----
 arch/x86/kernel/xsave.c      |   14 ++++++++++++--
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 26804b2..4056108 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1270,12 +1270,6 @@ void __cpuinit cpu_init(void)
 	clear_used_math();
 	mxcsr_feature_mask_init();
 
-	/*
-	 * Boot processor to setup the FP and extended state context info.
-	 */
-	if (!smp_processor_id())
-		init_thread_xstate();
-
 	xsave_init();
 }
 #endif
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index 6106af9..2f32ef0 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -93,11 +93,6 @@ void __cpuinit fpu_init(void)
 
 	write_cr0(oldcr0 & ~(X86_CR0_TS|X86_CR0_EM)); /* clear TS and EM */
 
-	/*
-	 * Boot processor to setup the FP and extended state context info.
-	 */
-	if (!smp_processor_id())
-		init_thread_xstate();
 	xsave_init();
 
 	mxcsr_feature_mask_init();
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 368047c..ab9ad48 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -360,7 +360,7 @@ unsigned int sig_xstate_size = sizeof(struct _fpstate);
 /*
  * Enable the extended processor state save/restore feature
  */
-void __cpuinit xsave_init(void)
+static void __cpuinit __xsave_init(void)
 {
 	if (!cpu_has_xsave)
 		return;
@@ -446,7 +446,7 @@ void __ref xsave_cntxt_init(void)
 	 * Support only the state known to OS.
 	 */
 	pcntxt_mask = pcntxt_mask & XCNTXT_MASK;
-	xsave_init();
+	__xsave_init();
 
 	/*
 	 * Recompute the context size for enabled features
@@ -463,3 +463,13 @@ void __ref xsave_cntxt_init(void)
 	       "cntxt size 0x%x\n",
 	       pcntxt_mask, xstate_size);
 }
+
+void __cpuinit xsave_init(void)
+{
+	/*
+	 * Boot processor to setup the FP and extended state context info.
+	 */
+	if (!smp_processor_id())
+		init_thread_xstate();
+	__xsave_init();
+}

  parent reply	other threads:[~2010-07-21  0:41 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-20 18:50 [PATCH 00/10] x86, xsave: some code cleanups and reworks Robert Richter
2010-07-20 18:50 ` [PATCH 01/10] x86, xsave: do not include asm/i387.h in asm/xsave.h Robert Richter
2010-07-20 21:46   ` Suresh Siddha
2010-07-20 18:50 ` [PATCH 02/10] x86, xsave: 32/64 bit boot cpu check unification in initialization Robert Richter
2010-07-20 21:47   ` Suresh Siddha
2010-07-21  0:40   ` [tip:x86/xsave] " tip-bot for Robert Richter
2010-07-20 18:50 ` [PATCH 03/10] x86: removing boot_cpu_id variable Robert Richter
2010-07-20 18:50 ` [PATCH 04/10] x86, xsave: moving boot cpu initialization to xsave_init() Robert Richter
2010-07-20 21:48   ` Suresh Siddha
2010-07-21  0:40   ` tip-bot for Robert Richter [this message]
2010-07-20 18:50 ` [PATCH 05/10] x86, xsave: make xsave_cntxt_init() static Robert Richter
2010-07-20 22:20   ` Suresh Siddha
2010-07-21 13:48     ` Robert Richter
2010-07-21 16:15       ` H. Peter Anvin
2010-07-20 18:50 ` [PATCH 06/10] x86, xsave: do not initialize xsave in fpu_init() Robert Richter
2010-07-20 22:21   ` Suresh Siddha
2010-07-20 18:50 ` [PATCH 07/10] x86, xsave: reduce cpu_has_xsave checks Robert Richter
2010-07-20 22:22   ` Suresh Siddha
2010-07-20 18:50 ` [PATCH 08/10] x86, xsave: introduce xstate enable functions Robert Richter
2010-07-20 22:23   ` Suresh Siddha
2010-07-20 18:50 ` [PATCH 09/10] x86, xsave: check cpuid level for XSTATE_CPUID (0x0d) Robert Richter
2010-07-20 22:26   ` Suresh Siddha
2010-07-20 22:45     ` H. Peter Anvin
2010-07-20 22:51     ` H. Peter Anvin
2010-07-20 18:50 ` [PATCH 10/10] x86, xsave: make init_xstate_buf static Robert Richter
2010-07-20 22:26   ` Suresh Siddha
2010-07-20 19:27 ` [PATCH 00/10] x86, xsave: some code cleanups and reworks Cyrill Gorcunov
2010-07-20 19:46   ` Robert Richter
2010-07-20 20:05     ` Suresh Siddha
2010-07-20 20:07     ` Cyrill Gorcunov
2010-07-20 20:17       ` Cyrill Gorcunov
2010-07-21 16:16         ` Robert Richter
2010-07-21 16:29           ` Cyrill Gorcunov
2010-07-21 16:32         ` H. Peter Anvin
2010-07-21 16:52           ` Cyrill Gorcunov
2010-07-21 17:01             ` Cyrill Gorcunov
2010-07-21 17:11               ` H. Peter Anvin
2010-07-21 17:17                 ` Cyrill Gorcunov
2010-07-21 17:24                   ` Robert Richter
2010-07-21 17:37                     ` Cyrill Gorcunov
2010-07-21 19:14                     ` Cyrill Gorcunov
2010-07-20 20:22 ` H. Peter Anvin

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=tip-82d4150cec83b9775f84810b39a1c0b91585d429@git.kernel.org \
    --to=robert.richter@amd.com \
    --cc=hpa@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=suresh.b.siddha@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome