s390/vdso: move boot_vdso_data to vdso.c
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 13 Oct 2017 10:59:22 +0000 (12:59 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 18 Oct 2017 12:11:36 +0000 (14:11 +0200)
The boot_vdso_data variable is related to the vdso code, the magic of the
initial vdso area for the early boot and the replacement of it in vdso_init
should all be put into vdso.c.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/vdso.h
arch/s390/kernel/setup.c
arch/s390/kernel/vdso.c

index 88bdc47..ac7bf98 100644 (file)
@@ -46,6 +46,7 @@ struct vdso_per_cpu_data {
 
 extern struct vdso_data *vdso_data;
 
+void vdso_alloc_boot_cpu(struct lowcore *lowcore);
 int vdso_alloc_per_cpu(struct lowcore *lowcore);
 void vdso_free_per_cpu(struct lowcore *lowcore);
 
index c07e6d6..bf139f9 100644 (file)
@@ -349,7 +349,7 @@ static void __init setup_lowcore(void)
                if (MACHINE_HAS_GS)
                        lc->mcesad |= bits;
        }
-       lc->vdso_per_cpu_data = (unsigned long) &lc->paste[0];
+       vdso_alloc_boot_cpu(lc);
        lc->sync_enter_timer = S390_lowcore.sync_enter_timer;
        lc->async_enter_timer = S390_lowcore.async_enter_timer;
        lc->exit_timer = S390_lowcore.exit_timer;
index aaf8f77..0520854 100644 (file)
@@ -140,6 +140,20 @@ static void __init vdso_init_data(struct vdso_data *vd)
  */
 #define SEGMENT_ORDER  2
 
+/*
+ * The initial vdso_data structure for the boot CPU. Eventually
+ * it is replaced with a properly allocated structure in vdso_init.
+ * This is necessary because a valid S390_lowcore.vdso_per_cpu_data
+ * pointer is required to be able to return from an interrupt or
+ * program check. See the exit paths in entry.S.
+ */
+struct vdso_data boot_vdso_data __initdata;
+
+void __init vdso_alloc_boot_cpu(struct lowcore *lowcore)
+{
+       lowcore->vdso_per_cpu_data = (unsigned long) &boot_vdso_data;
+}
+
 int vdso_alloc_per_cpu(struct lowcore *lowcore)
 {
        unsigned long segment_table, page_table, page_frame;