s390/smp: sort out physical vs virtual pointers usage
authorAlexander Gordeev <agordeev@linux.ibm.com>
Tue, 15 Feb 2022 13:10:48 +0000 (14:10 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 1 Mar 2022 20:05:10 +0000 (21:05 +0100)
With commit 5789284710aa ("s390/smp: reallocate IPL CPU lowcore")
virtual addresses are wrongly passed to memblock_free_late() and
SPX instructions on IPL CPU reinitialization.

Note: this does not fix a bug currently, since virtual and
physical addresses are identical.

Fixes: 5789284710aa ("s390/smp: reallocate IPL CPU lowcore")
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/smp.c

index 4f0e9f412f27978898029e2c80c3d168821f2233..368b58e4c2e7516284db212bbd499aa71c653394 100644 (file)
@@ -1252,7 +1252,7 @@ static __always_inline void set_new_lowcore(struct lowcore *lc)
        src.odd  = sizeof(S390_lowcore);
        dst.even = (unsigned long) lc;
        dst.odd  = sizeof(*lc);
-       pfx = (unsigned long) lc;
+       pfx = __pa(lc);
 
        asm volatile(
                "       mvcl    %[dst],%[src]\n"
@@ -1292,8 +1292,8 @@ static int __init smp_reinit_ipl_cpu(void)
        local_irq_restore(flags);
 
        free_pages(lc_ipl->async_stack - STACK_INIT_OFFSET, THREAD_SIZE_ORDER);
-       memblock_free_late(lc_ipl->mcck_stack - STACK_INIT_OFFSET, THREAD_SIZE);
-       memblock_free_late((unsigned long) lc_ipl, sizeof(*lc_ipl));
+       memblock_free_late(__pa(lc_ipl->mcck_stack - STACK_INIT_OFFSET), THREAD_SIZE);
+       memblock_free_late(__pa(lc_ipl), sizeof(*lc_ipl));
 
        return 0;
 }