]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
s390/mm: Remove have_store_indication static key
authorHeiko Carstens <hca@linux.ibm.com>
Fri, 31 Jan 2025 15:11:38 +0000 (16:11 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 18 Feb 2025 17:53:48 +0000 (18:53 +0100)
Whenever test_facility() is used with a constant facility
number the generated code is identical to a static branch.

Remove the extra initcall and static_branch_enable() handling for
have_store_indication, and use test_facility() directly.

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/mm/fault.c

index 9b681f74dccc1f525bafe150acf91e666a60d2bd..9c9d7840cb5787b0d688828ac24bf5e0d7930611 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/sched/debug.h>
-#include <linux/jump_label.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <asm/uv.h>
 #include "../kernel/entry.h"
 
-static DEFINE_STATIC_KEY_FALSE(have_store_indication);
-
-static int __init fault_init(void)
-{
-       if (test_facility(75))
-               static_branch_enable(&have_store_indication);
-       return 0;
-}
-early_initcall(fault_init);
-
 /*
  * Find out which address space caused the exception.
  */
@@ -81,7 +70,7 @@ static __always_inline bool fault_is_write(struct pt_regs *regs)
 {
        union teid teid = { .val = regs->int_parm_long };
 
-       if (static_branch_likely(&have_store_indication))
+       if (test_facility(75))
                return teid.fsi == TEID_FSI_STORE;
        return false;
 }