From: Rusty Russell <rusty@rustcorp.com.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>, Andi Kleen <andi@firstfloor.org>,
lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/4] i386 GDT cleanups: clean up cpu_init()
Date: Wed, 21 Mar 2007 17:36:54 +1100 [thread overview]
Message-ID: <1174459014.11680.153.camel@localhost.localdomain> (raw)
In-Reply-To: <1174458938.11680.150.camel@localhost.localdomain>
We now have cpu_init() and secondary_cpu_init() doing nothing but
calling _cpu_init() with the same arguments. Rename _cpu_init() to
cpu_init() and use it as a replcement for secondary_cpu_init().
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
arch/i386/kernel/cpu/common.c | 36 ++++++++++--------------------------
arch/i386/kernel/smpboot.c | 10 +++++-----
include/asm-i386/processor.h | 3 ++-
3 files changed, 17 insertions(+), 32 deletions(-)
diff -r 18694148c020 arch/i386/kernel/cpu/common.c
--- a/arch/i386/kernel/cpu/common.c Wed Mar 21 17:15:19 2007 +1100
+++ b/arch/i386/kernel/cpu/common.c Wed Mar 21 17:18:37 2007 +1100
@@ -644,9 +644,16 @@ struct i386_pda boot_pda = {
.pcurrent = &init_task,
};
-/* Common CPU init for both boot and secondary CPUs */
-static void __cpuinit _cpu_init(int cpu, struct task_struct *curr)
-{
+/*
+ * cpu_init() initializes state that is per-CPU. Some data is already
+ * initialized (naturally) in the bootstrap process, such as the GDT
+ * and IDT. We reload them nevertheless, this function acts as a
+ * 'CPU state barrier', nothing should get across.
+ */
+void __cpuinit cpu_init(void)
+{
+ int cpu = smp_processor_id();
+ struct task_struct *curr = current;
struct tss_struct * t = &per_cpu(init_tss, cpu);
struct thread_struct *thread = &curr->thread;
@@ -706,29 +713,6 @@ static void __cpuinit _cpu_init(int cpu,
mxcsr_feature_mask_init();
}
-/* Entrypoint to initialize secondary CPU */
-void __cpuinit secondary_cpu_init(void)
-{
- int cpu = smp_processor_id();
- struct task_struct *curr = current;
-
- _cpu_init(cpu, curr);
-}
-
-/*
- * cpu_init() initializes state that is per-CPU. Some data is already
- * initialized (naturally) in the bootstrap process, such as the GDT
- * and IDT. We reload them nevertheless, this function acts as a
- * 'CPU state barrier', nothing should get across.
- */
-void __cpuinit cpu_init(void)
-{
- int cpu = smp_processor_id();
- struct task_struct *curr = current;
-
- _cpu_init(cpu, curr);
-}
-
#ifdef CONFIG_HOTPLUG_CPU
void __cpuinit cpu_uninit(void)
{
diff -r 18694148c020 arch/i386/kernel/smpboot.c
--- a/arch/i386/kernel/smpboot.c Wed Mar 21 17:15:19 2007 +1100
+++ b/arch/i386/kernel/smpboot.c Wed Mar 21 17:18:37 2007 +1100
@@ -378,14 +378,14 @@ static void __cpuinit start_secondary(vo
static void __cpuinit start_secondary(void *unused)
{
/*
- * Don't put *anything* before secondary_cpu_init(), SMP
- * booting is too fragile that we want to limit the
- * things done here to the most necessary things.
+ * Don't put *anything* before cpu_init(), SMP booting is too
+ * fragile that we want to limit the things done here to the
+ * most necessary things.
*/
#ifdef CONFIG_VMI
vmi_bringup();
#endif
- secondary_cpu_init();
+ cpu_init();
preempt_disable();
smp_callin();
while (!cpu_isset(smp_processor_id(), smp_commenced_mask))
diff -r 18694148c020 include/asm-i386/processor.h
--- a/include/asm-i386/processor.h Wed Mar 21 17:15:19 2007 +1100
+++ b/include/asm-i386/processor.h Wed Mar 21 17:18:37 2007 +1100
@@ -744,6 +744,6 @@ extern int sysenter_setup(void);
extern int sysenter_setup(void);
extern void cpu_set_gdt(int);
-extern void secondary_cpu_init(void);
+extern void cpu_init(void);
#endif /* __ASM_I386_PROCESSOR_H */
next prev parent reply other threads:[~2007-03-21 6:37 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-21 6:10 [PATCH] Allow per-cpu variables to be page-aligned Rusty Russell
2007-03-21 6:30 ` [PATCH 0/4] i386 GDT cleanups Rusty Russell
2007-03-21 6:32 ` [PATCH 1/4] i386 GDT cleanups: Use per-cpu variables for GDT, PDA Rusty Russell
2007-03-21 6:35 ` [PATCH 2/4] i386 GDT cleanups: Use per-cpu GDT immediately upon boot Rusty Russell
2007-03-21 6:36 ` Rusty Russell [this message]
2007-03-21 6:53 ` [PATCH 4/4] i386 GDT cleanups: cleanup GDT Access Rusty Russell
2007-03-21 9:31 ` [PATCH 2/4] i386 GDT cleanups: Use per-cpu GDT immediately upon boot Eric W. Biederman
2007-03-21 11:55 ` Rusty Russell
2007-03-21 16:51 ` Eric W. Biederman
2007-03-21 23:58 ` Rusty Russell
2007-03-22 8:10 ` Sébastien Dugué
2007-03-22 9:24 ` Rusty Russell
2007-03-22 15:59 ` [PATCH] i386 GDT cleanups: Rename boot_gdt_table to boot_gdt Sébastien Dugué
2007-03-23 7:19 ` Rusty Russell
2007-03-23 14:15 ` Andi Kleen
2007-03-21 9:21 ` [PATCH] Allow per-cpu variables to be page-aligned Eric W. Biederman
2007-03-21 11:44 ` Rusty Russell
2007-03-21 16:49 ` Eric W. Biederman
2007-03-22 0:09 ` Rusty Russell
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=1174459014.11680.153.camel@localhost.localdomain \
--to=rusty@rustcorp.com.au \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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