s390/smp: keep the original lowcore for CPU 0
authorIlya Leoshkevich <iii@linux.ibm.com>
Mon, 31 Jul 2023 15:07:11 +0000 (17:07 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 19 Sep 2023 11:26:55 +0000 (13:26 +0200)
Now that CPU 0 is not hotpluggable, it is not necessary to support
freeing its stacks. Delete all the code that migrates it to new stacks
and a new lowcore.

Suggested-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/smp.h
arch/s390/kernel/setup.c
arch/s390/kernel/smp.c

index 73ed2781073b260f5621bcb9142d5d2919e518dd..6e5b1b4b19a91006b0cad55a97851d41fa62287e 100644 (file)
@@ -59,7 +59,6 @@ static inline void smp_cpus_done(unsigned int max_cpus)
 {
 }
 
-extern int smp_reinit_ipl_cpu(void);
 extern int smp_rescan_cpus(void);
 extern void __noreturn cpu_die(void);
 extern void __cpu_die(unsigned int cpu);
index de6ad0fb2328a1b551105151da26bdb6b59c5fb2..deb97723c890b8ae9cd735f47386ca3db89040c8 100644 (file)
@@ -381,12 +381,6 @@ void stack_free(unsigned long stack)
 #endif
 }
 
-void __init __noreturn arch_call_rest_init(void)
-{
-       smp_reinit_ipl_cpu();
-       rest_init();
-}
-
 static unsigned long __init stack_alloc_early(void)
 {
        unsigned long stack;
index e8284cec36e7ab110fd8491e7f8a36e1fc2f76af..9c5e107da4b48c9204b034ede098aa100e25fa7b 100644 (file)
@@ -1256,60 +1256,3 @@ out:
        return rc;
 }
 subsys_initcall(s390_smp_init);
-
-static __always_inline void set_new_lowcore(struct lowcore *lc)
-{
-       union register_pair dst, src;
-       u32 pfx;
-
-       src.even = (unsigned long) &S390_lowcore;
-       src.odd  = sizeof(S390_lowcore);
-       dst.even = (unsigned long) lc;
-       dst.odd  = sizeof(*lc);
-       pfx = __pa(lc);
-
-       asm volatile(
-               "       mvcl    %[dst],%[src]\n"
-               "       spx     %[pfx]\n"
-               : [dst] "+&d" (dst.pair), [src] "+&d" (src.pair)
-               : [pfx] "Q" (pfx)
-               : "memory", "cc");
-}
-
-int __init smp_reinit_ipl_cpu(void)
-{
-       unsigned long async_stack, nodat_stack, mcck_stack;
-       struct lowcore *lc, *lc_ipl;
-       unsigned long flags, cr0;
-       u64 mcesad;
-
-       lc_ipl = lowcore_ptr[0];
-       lc = (struct lowcore *) __get_free_pages(GFP_KERNEL | GFP_DMA, LC_ORDER);
-       nodat_stack = __get_free_pages(GFP_KERNEL, THREAD_SIZE_ORDER);
-       async_stack = stack_alloc();
-       mcck_stack = stack_alloc();
-       if (!lc || !nodat_stack || !async_stack || !mcck_stack || nmi_alloc_mcesa(&mcesad))
-               panic("Couldn't allocate memory");
-
-       local_irq_save(flags);
-       local_mcck_disable();
-       set_new_lowcore(lc);
-       S390_lowcore.nodat_stack = nodat_stack + STACK_INIT_OFFSET;
-       S390_lowcore.async_stack = async_stack + STACK_INIT_OFFSET;
-       S390_lowcore.mcck_stack = mcck_stack + STACK_INIT_OFFSET;
-       __ctl_store(cr0, 0, 0);
-       __ctl_clear_bit(0, 28); /* disable lowcore protection */
-       S390_lowcore.mcesad = mcesad;
-       __ctl_load(cr0, 0, 0);
-       if (abs_lowcore_map(0, lc, false))
-               panic("Couldn't remap absolute lowcore");
-       lowcore_ptr[0] = lc;
-       local_mcck_enable();
-       local_irq_restore(flags);
-
-       memblock_free_late(__pa(lc_ipl->mcck_stack - STACK_INIT_OFFSET), THREAD_SIZE);
-       memblock_free_late(__pa(lc_ipl->async_stack - STACK_INIT_OFFSET), THREAD_SIZE);
-       memblock_free_late(__pa(lc_ipl->nodat_stack - STACK_INIT_OFFSET), THREAD_SIZE);
-       memblock_free_late(__pa(lc_ipl), sizeof(*lc_ipl));
-       return 0;
-}