s390/lpp: use assembler alternatives for the LPP instruction
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 26 Mar 2018 13:23:33 +0000 (15:23 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 28 Mar 2018 06:38:28 +0000 (08:38 +0200)
With the new macros for CPU alternatives the MACHINE_FLAG_LPP check
around the LPP instruction can be optimized. After this is done the
flag can be removed.

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

index dd08db491b89e149fc7894a5f77578db8fe950d6..f58d17e9dd65872e12d0764c511cbc5955ab7271 100644 (file)
 /* CPU measurement facility support */
 static inline int cpum_cf_avail(void)
 {
-       return MACHINE_HAS_LPP && test_facility(67);
+       return test_facility(40) && test_facility(67);
 }
 
 static inline int cpum_sf_avail(void)
 {
-       return MACHINE_HAS_LPP && test_facility(68);
+       return test_facility(40) && test_facility(68);
 }
 
 
index 2eb0c8a7b664817759d325c34ec8e53a9bdd6981..124154fdfc9722d34f84ed293a9b6fc31fff370f 100644 (file)
@@ -25,7 +25,6 @@
 #define MACHINE_FLAG_DIAG44    _BITUL(6)
 #define MACHINE_FLAG_EDAT1     _BITUL(7)
 #define MACHINE_FLAG_EDAT2     _BITUL(8)
-#define MACHINE_FLAG_LPP       _BITUL(9)
 #define MACHINE_FLAG_TOPOLOGY  _BITUL(10)
 #define MACHINE_FLAG_TE                _BITUL(11)
 #define MACHINE_FLAG_TLB_LC    _BITUL(12)
@@ -66,7 +65,6 @@ extern void detect_memory_memblock(void);
 #define MACHINE_HAS_DIAG44     (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44)
 #define MACHINE_HAS_EDAT1      (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1)
 #define MACHINE_HAS_EDAT2      (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2)
-#define MACHINE_HAS_LPP                (S390_lowcore.machine_flags & MACHINE_FLAG_LPP)
 #define MACHINE_HAS_TOPOLOGY   (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
 #define MACHINE_HAS_TE         (S390_lowcore.machine_flags & MACHINE_FLAG_TE)
 #define MACHINE_HAS_TLB_LC     (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC)
index 53d089fc45016b872eb5e96332cadb63d9d1e3dc..b00b515baa53103cb85d21ae15ba0fd119f59664 100644 (file)
@@ -242,8 +242,6 @@ static __init void detect_machine_facilities(void)
                S390_lowcore.machine_flags |= MACHINE_FLAG_EDAT2;
        if (test_facility(3))
                S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE;
-       if (test_facility(40))
-               S390_lowcore.machine_flags |= MACHINE_FLAG_LPP;
        if (test_facility(50) && test_facility(73)) {
                S390_lowcore.machine_flags |= MACHINE_FLAG_TE;
                __ctl_set_bit(0, 55);
index ee1b2f7b3d05833e0d08ea36c07b439766806d26..0aa205e32f7d5654a3450e009dbf0c7d1df68088 100644 (file)
@@ -58,6 +58,8 @@ _CIF_WORK     = (_CIF_MCCK_PENDING | _CIF_ASCE_PRIMARY | \
                   _CIF_ASCE_SECONDARY | _CIF_FPU)
 _PIF_WORK      = (_PIF_PER_TRAP | _PIF_SYSCALL_RESTART)
 
+_LPP_OFFSET    = __LC_LPP
+
 #define BASED(name) name-cleanup_critical(%r13)
 
        .macro  TRACE_IRQS_ON
@@ -281,10 +283,8 @@ ENTRY(__switch_to)
        aghi    %r3,__TASK_pid
        mvc     __LC_CURRENT_PID(4,%r0),0(%r3)  # store pid of next
        lmg     %r6,%r15,__SF_GPRS(%r15)        # load gprs of next task
-       TSTMSK  __LC_MACHINE_FLAGS,MACHINE_FLAG_LPP
-       jz      0f
-       .insn   s,0xb2800000,__LC_LPP           # set program parameter
-0:     BR_R1USE_R14
+       ALTERNATIVE "", ".insn s,0xb2800000,_LPP_OFFSET", 40
+       BR_R1USE_R14
 
 .L__critical_start:
 
@@ -1243,10 +1243,8 @@ ENTRY(mcck_int_handler)
 # PSW restart interrupt handler
 #
 ENTRY(restart_int_handler)
-       TSTMSK  __LC_MACHINE_FLAGS,MACHINE_FLAG_LPP
-       jz      0f
-       .insn   s,0xb2800000,__LC_LPP
-0:     stg     %r15,__LC_SAVE_AREA_RESTART
+       ALTERNATIVE "", ".insn s,0xb2800000,_LPP_OFFSET", 40
+       stg     %r15,__LC_SAVE_AREA_RESTART
        lg      %r15,__LC_RESTART_STACK
        aghi    %r15,-__PT_SIZE                 # create pt_regs on stack
        xc      0(__PT_SIZE,%r15),0(%r15)