Skip to content

Commit 220d8e1

Browse files
committed
s390/mm: Remove cpu_has_idte()
Remove cpu_has_idte(). The IDTE instruction is part of the Dat-Enhancement facility 1, which is always available. Therefore remove the helper and now superfluous code. Acked-by: Alexander Gordeev <agordeev@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
1 parent 73c4b5d commit 220d8e1

5 files changed

Lines changed: 9 additions & 32 deletions

File tree

arch/s390/include/asm/cpufeature.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ int cpu_have_feature(unsigned int nr);
2727
#define cpu_has_edat1() test_facility(8)
2828
#define cpu_has_edat2() test_facility(78)
2929
#define cpu_has_gs() test_facility(133)
30-
#define cpu_has_idte() test_facility(3)
3130
#define cpu_has_nx() test_facility(130)
3231
#define cpu_has_rdp() test_facility(194)
3332
#define cpu_has_seq_insn() test_facility(85)

arch/s390/include/asm/tlbflush.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static inline void __tlb_flush_mm(struct mm_struct *mm)
5454
cpumask_copy(mm_cpumask(mm), &mm->context.cpu_attach_mask);
5555
barrier();
5656
gmap_asce = READ_ONCE(mm->context.gmap_asce);
57-
if (cpu_has_idte() && gmap_asce != -1UL) {
57+
if (gmap_asce != -1UL) {
5858
if (gmap_asce)
5959
__tlb_flush_idte(gmap_asce);
6060
__tlb_flush_idte(mm->context.asce);
@@ -68,10 +68,7 @@ static inline void __tlb_flush_mm(struct mm_struct *mm)
6868

6969
static inline void __tlb_flush_kernel(void)
7070
{
71-
if (cpu_has_idte())
72-
__tlb_flush_idte(init_mm.context.asce);
73-
else
74-
__tlb_flush_global();
71+
__tlb_flush_idte(init_mm.context.asce);
7572
}
7673

7774
static inline void __tlb_flush_mm_lazy(struct mm_struct * mm)

arch/s390/mm/gmap.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,7 @@ EXPORT_SYMBOL_GPL(gmap_create);
138138

139139
static void gmap_flush_tlb(struct gmap *gmap)
140140
{
141-
if (cpu_has_idte())
142-
__tlb_flush_idte(gmap->asce);
143-
else
144-
__tlb_flush_global();
141+
__tlb_flush_idte(gmap->asce);
145142
}
146143

147144
static void gmap_radix_tree_free(struct radix_tree_root *root)
@@ -1988,10 +1985,8 @@ static void gmap_pmdp_xchg(struct gmap *gmap, pmd_t *pmdp, pmd_t new,
19881985
if (machine_has_tlb_guest())
19891986
__pmdp_idte(gaddr, (pmd_t *)pmdp, IDTE_GUEST_ASCE, gmap->asce,
19901987
IDTE_GLOBAL);
1991-
else if (cpu_has_idte())
1992-
__pmdp_idte(gaddr, (pmd_t *)pmdp, 0, 0, IDTE_GLOBAL);
19931988
else
1994-
__pmdp_csp(pmdp);
1989+
__pmdp_idte(gaddr, (pmd_t *)pmdp, 0, 0, IDTE_GLOBAL);
19951990
set_pmd(pmdp, new);
19961991
}
19971992

@@ -2066,7 +2061,7 @@ void gmap_pmdp_idte_local(struct mm_struct *mm, unsigned long vmaddr)
20662061
if (machine_has_tlb_guest())
20672062
__pmdp_idte(gaddr, pmdp, IDTE_GUEST_ASCE,
20682063
gmap->asce, IDTE_LOCAL);
2069-
else if (cpu_has_idte())
2064+
else
20702065
__pmdp_idte(gaddr, pmdp, 0, 0, IDTE_LOCAL);
20712066
*pmdp = __pmd(_SEGMENT_ENTRY_EMPTY);
20722067
}
@@ -2099,10 +2094,8 @@ void gmap_pmdp_idte_global(struct mm_struct *mm, unsigned long vmaddr)
20992094
if (machine_has_tlb_guest())
21002095
__pmdp_idte(gaddr, pmdp, IDTE_GUEST_ASCE,
21012096
gmap->asce, IDTE_GLOBAL);
2102-
else if (cpu_has_idte())
2103-
__pmdp_idte(gaddr, pmdp, 0, 0, IDTE_GLOBAL);
21042097
else
2105-
__pmdp_csp(pmdp);
2098+
__pmdp_idte(gaddr, pmdp, 0, 0, IDTE_GLOBAL);
21062099
*pmdp = __pmd(_SEGMENT_ENTRY_EMPTY);
21072100
}
21082101
spin_unlock(&gmap->guest_table_lock);

arch/s390/mm/pageattr.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,8 @@ static void pgt_set(unsigned long *old, unsigned long new, unsigned long addr,
7878
}
7979
table = (unsigned long *)((unsigned long)old & mask);
8080
crdte(*old, new, table, dtt, addr, get_lowcore()->kernel_asce.val);
81-
} else if (cpu_has_idte()) {
82-
cspg(old, *old, new);
8381
} else {
84-
csp((unsigned int *)old + 1, *old, new);
82+
cspg(old, *old, new);
8583
}
8684
}
8785

arch/s390/mm/pgtable.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -360,14 +360,10 @@ static inline void pmdp_idte_global(struct mm_struct *mm,
360360
mm->context.asce, IDTE_GLOBAL);
361361
if (mm_has_pgste(mm) && mm->context.allow_gmap_hpage_1m)
362362
gmap_pmdp_idte_global(mm, addr);
363-
} else if (cpu_has_idte()) {
363+
} else {
364364
__pmdp_idte(addr, pmdp, 0, 0, IDTE_GLOBAL);
365365
if (mm_has_pgste(mm) && mm->context.allow_gmap_hpage_1m)
366366
gmap_pmdp_idte_global(mm, addr);
367-
} else {
368-
__pmdp_csp(pmdp);
369-
if (mm_has_pgste(mm) && mm->context.allow_gmap_hpage_1m)
370-
gmap_pmdp_csp(mm, addr);
371367
}
372368
}
373369

@@ -487,14 +483,8 @@ static inline void pudp_idte_global(struct mm_struct *mm,
487483
if (machine_has_tlb_guest())
488484
__pudp_idte(addr, pudp, IDTE_NODAT | IDTE_GUEST_ASCE,
489485
mm->context.asce, IDTE_GLOBAL);
490-
else if (cpu_has_idte())
491-
__pudp_idte(addr, pudp, 0, 0, IDTE_GLOBAL);
492486
else
493-
/*
494-
* Invalid bit position is the same for pmd and pud, so we can
495-
* reuse _pmd_csp() here
496-
*/
497-
__pmdp_csp((pmd_t *) pudp);
487+
__pudp_idte(addr, pudp, 0, 0, IDTE_GLOBAL);
498488
}
499489

500490
static inline pud_t pudp_flush_direct(struct mm_struct *mm,

0 commit comments

Comments
 (0)