s390: assume stckf is always present
authorVasily Gorbik <gor@linux.ibm.com>
Fri, 25 Feb 2022 09:38:23 +0000 (10:38 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Thu, 10 Mar 2022 14:58:17 +0000 (15:58 +0100)
With z10 as minimum supported machine generation the store-clock-fast
facility (25) is always present and checked in als code.
Drop alternatives and always use stckf.

Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/entry.S
arch/s390/kernel/vtime.c

index 3781de26f207fa6d89fbd8c99dfe241901e1d460..8f15e418968a9697fd59ca4665f63e61605d126f 100644 (file)
@@ -98,11 +98,6 @@ _LPP_OFFSET  = __LC_LPP
 #endif
        .endm
 
-       .macro STCK savearea
-       ALTERNATIVE ".insn      s,0xb2050000,\savearea", \
-                   ".insn      s,0xb27c0000,\savearea", 25
-       .endm
-
        /*
         * The TSTMSK macro generates a test-under-mask instruction by
         * calculating the memory offset for the specified mask value.
@@ -442,7 +437,7 @@ ENDPROC(pgm_check_handler)
  */
 .macro INT_HANDLER name,lc_old_psw,handler
 ENTRY(\name)
-       STCK    __LC_INT_CLOCK
+       stckf   __LC_INT_CLOCK
        stpt    __LC_SYS_ENTER_TIMER
        STBEAR  __LC_LAST_BREAK
        BPOFF
@@ -514,7 +509,7 @@ ENTRY(psw_idle)
 .Lpsw_idle_stcctm:
        oi      __LC_CPU_FLAGS+7,_CIF_ENABLED_WAIT
        BPON
-       STCK    __CLOCK_IDLE_ENTER(%r2)
+       stckf   __CLOCK_IDLE_ENTER(%r2)
        stpt    __TIMER_IDLE_ENTER(%r2)
        lpswe   __SF_EMPTY(%r15)
 .globl psw_idle_exit
@@ -526,7 +521,7 @@ ENDPROC(psw_idle)
  * Machine check handler routines
  */
 ENTRY(mcck_int_handler)
-       STCK    __LC_MCCK_CLOCK
+       stckf   __LC_MCCK_CLOCK
        BPOFF
        la      %r1,4095                # validate r1
        spt     __LC_CPU_TIMER_SAVE_AREA-4095(%r1)      # validate cpu timer
index f216a1b2f82570de92365007e5da8158ebbd0714..9436f3053b88c3271f19dee899905e2ae442a16d 100644 (file)
@@ -128,13 +128,12 @@ static int do_account_vtime(struct task_struct *tsk)
 
        timer = S390_lowcore.last_update_timer;
        clock = S390_lowcore.last_update_clock;
-       /* Use STORE CLOCK by default, STORE CLOCK FAST if available. */
-       alternative_io("stpt %0\n .insn s,0xb2050000,%1\n",
-                      "stpt %0\n .insn s,0xb27c0000,%1\n",
-                      25,
-                      ASM_OUTPUT2("=Q" (S390_lowcore.last_update_timer),
-                                  "=Q" (S390_lowcore.last_update_clock)),
-                      ASM_NO_INPUT_CLOBBER("cc"));
+       asm volatile(
+               "       stpt    %0\n"   /* Store current cpu timer value */
+               "       stckf   %1"     /* Store current tod clock value */
+               : "=Q" (S390_lowcore.last_update_timer),
+                 "=Q" (S390_lowcore.last_update_clock)
+               : : "cc");
        clock = S390_lowcore.last_update_clock - clock;
        timer -= S390_lowcore.last_update_timer;