Skip to content

Commit e5b9819

Browse files
author
Martin Schwidefsky
committed
s390/lpp: use assembler alternatives for the LPP instruction
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 <[email protected]>
1 parent b058661 commit e5b9819

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

arch/s390/include/asm/cpu_mf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
/* CPU measurement facility support */
3030
static inline int cpum_cf_avail(void)
3131
{
32-
return MACHINE_HAS_LPP && test_facility(67);
32+
return test_facility(40) && test_facility(67);
3333
}
3434

3535
static inline int cpum_sf_avail(void)
3636
{
37-
return MACHINE_HAS_LPP && test_facility(68);
37+
return test_facility(40) && test_facility(68);
3838
}
3939

4040

arch/s390/include/asm/setup.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#define MACHINE_FLAG_DIAG44 _BITUL(6)
2626
#define MACHINE_FLAG_EDAT1 _BITUL(7)
2727
#define MACHINE_FLAG_EDAT2 _BITUL(8)
28-
#define MACHINE_FLAG_LPP _BITUL(9)
2928
#define MACHINE_FLAG_TOPOLOGY _BITUL(10)
3029
#define MACHINE_FLAG_TE _BITUL(11)
3130
#define MACHINE_FLAG_TLB_LC _BITUL(12)
@@ -66,7 +65,6 @@ extern void detect_memory_memblock(void);
6665
#define MACHINE_HAS_DIAG44 (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44)
6766
#define MACHINE_HAS_EDAT1 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1)
6867
#define MACHINE_HAS_EDAT2 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2)
69-
#define MACHINE_HAS_LPP (S390_lowcore.machine_flags & MACHINE_FLAG_LPP)
7068
#define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
7169
#define MACHINE_HAS_TE (S390_lowcore.machine_flags & MACHINE_FLAG_TE)
7270
#define MACHINE_HAS_TLB_LC (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC)

arch/s390/kernel/early.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,6 @@ static __init void detect_machine_facilities(void)
242242
S390_lowcore.machine_flags |= MACHINE_FLAG_EDAT2;
243243
if (test_facility(3))
244244
S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE;
245-
if (test_facility(40))
246-
S390_lowcore.machine_flags |= MACHINE_FLAG_LPP;
247245
if (test_facility(50) && test_facility(73)) {
248246
S390_lowcore.machine_flags |= MACHINE_FLAG_TE;
249247
__ctl_set_bit(0, 55);

arch/s390/kernel/entry.S

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ _CIF_WORK = (_CIF_MCCK_PENDING | _CIF_ASCE_PRIMARY | \
5858
_CIF_ASCE_SECONDARY | _CIF_FPU)
5959
_PIF_WORK = (_PIF_PER_TRAP | _PIF_SYSCALL_RESTART)
6060

61+
_LPP_OFFSET = __LC_LPP
62+
6163
#define BASED(name) name-cleanup_critical(%r13)
6264

6365
.macro TRACE_IRQS_ON
@@ -281,10 +283,8 @@ ENTRY(__switch_to)
281283
aghi %r3,__TASK_pid
282284
mvc __LC_CURRENT_PID(4,%r0),0(%r3) # store pid of next
283285
lmg %r6,%r15,__SF_GPRS(%r15) # load gprs of next task
284-
TSTMSK __LC_MACHINE_FLAGS,MACHINE_FLAG_LPP
285-
jz 0f
286-
.insn s,0xb2800000,__LC_LPP # set program parameter
287-
0: BR_R1USE_R14
286+
ALTERNATIVE "", ".insn s,0xb2800000,_LPP_OFFSET", 40
287+
BR_R1USE_R14
288288

289289
.L__critical_start:
290290

@@ -1243,10 +1243,8 @@ ENTRY(mcck_int_handler)
12431243
# PSW restart interrupt handler
12441244
#
12451245
ENTRY(restart_int_handler)
1246-
TSTMSK __LC_MACHINE_FLAGS,MACHINE_FLAG_LPP
1247-
jz 0f
1248-
.insn s,0xb2800000,__LC_LPP
1249-
0: stg %r15,__LC_SAVE_AREA_RESTART
1246+
ALTERNATIVE "", ".insn s,0xb2800000,_LPP_OFFSET", 40
1247+
stg %r15,__LC_SAVE_AREA_RESTART
12501248
lg %r15,__LC_RESTART_STACK
12511249
aghi %r15,-__PT_SIZE # create pt_regs on stack
12521250
xc 0(__PT_SIZE,%r15),0(%r15)

0 commit comments

Comments
 (0)