s390/extable: sort amode31 extable early
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 28 Feb 2022 09:45:43 +0000 (10:45 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 7 Mar 2022 23:33:00 +0000 (00:33 +0100)
The early program check handler is active before the amode31 extable
is sorted. Therefore in case a program check happens early within the
amode31 code the extable entry might not be found.

Fix this by sorting the amode31 extable early.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/early.c
arch/s390/kernel/traps.c

index b8cfac4..3dae0c0 100644 (file)
@@ -293,6 +293,11 @@ static void __init check_image_bootable(void)
        disabled_wait();
 }
 
+static void __init sort_amode31_extable(void)
+{
+       sort_extable(__start_amode31_ex_table, __stop_amode31_ex_table);
+}
+
 void __init startup_init(void)
 {
        sclp_early_adjust_va();
@@ -301,6 +306,7 @@ void __init startup_init(void)
        time_early_init();
        init_kernel_storage_key();
        lockdep_off();
+       sort_amode31_extable();
        setup_lowcore_early();
        setup_facility_list();
        detect_machine_type();
index 2b78078..c2b1ffe 100644 (file)
@@ -291,7 +291,6 @@ static void __init test_monitor_call(void)
 
 void __init trap_init(void)
 {
-       sort_extable(__start_amode31_ex_table, __stop_amode31_ex_table);
        local_mcck_enable();
        test_monitor_call();
 }