x86/smp: Remove stack_smp_processor_id()
authorAndy Lutomirski <[email protected]>
Thu, 14 Jul 2016 20:22:58 +0000 (13:22 -0700)
committerIngo Molnar <[email protected]>
Fri, 15 Jul 2016 08:26:30 +0000 (10:26 +0200)
It serves no purpose -- raw_smp_processor_id() works fine.  This
change will be needed to move thread_info off the stack.

Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/a2bf4f07fbc30fb32f9f7f3f8f94ad3580823847.1468527351.git.luto@kernel.org
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/include/asm/cpu.h
arch/x86/include/asm/smp.h
arch/x86/kernel/cpu/common.c

index 678637ad7476358a8263deee72a84e476912d2f0..59d34c521d964f294e4ad66ce6900ad16b19d999 100644 (file)
@@ -17,7 +17,6 @@ static inline void prefill_possible_map(void) {}
 
 #define cpu_physical_id(cpu)                   boot_cpu_physical_apicid
 #define safe_smp_processor_id()                        0
-#define stack_smp_processor_id()               0
 
 #endif /* CONFIG_SMP */
 
index 66b057306f404718c233c18c5603ec30e9e535ba..0576b6157f3ae302818aa67f2feb41c47c601e0a 100644 (file)
@@ -172,12 +172,6 @@ extern int safe_smp_processor_id(void);
 #elif defined(CONFIG_X86_64_SMP)
 #define raw_smp_processor_id() (this_cpu_read(cpu_number))
 
-#define stack_smp_processor_id()                                       \
-({                                                             \
-       struct thread_info *ti;                                         \
-       __asm__("andq %%rsp,%0; ":"=r" (ti) : "0" (CURRENT_MASK));      \
-       ti->cpu;                                                        \
-})
 #define safe_smp_processor_id()                smp_processor_id()
 
 #endif
index 0fe6953f421c9b92b72c331600f435e623c3e264..d22a7b9c4f0e5409b44b58b4acad6795c82429e5 100644 (file)
@@ -1452,7 +1452,7 @@ void cpu_init(void)
        struct task_struct *me;
        struct tss_struct *t;
        unsigned long v;
-       int cpu = stack_smp_processor_id();
+       int cpu = raw_smp_processor_id();
        int i;
 
        wait_for_master_cpu(cpu);