]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
s390/mm: Remove cpu_has_idte()
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 3 Nov 2025 13:39:27 +0000 (14:39 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Thu, 6 Nov 2025 13:12:31 +0000 (14:12 +0100)
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>
arch/s390/include/asm/cpufeature.h
arch/s390/include/asm/tlbflush.h
arch/s390/mm/gmap.c
arch/s390/mm/pageattr.c
arch/s390/mm/pgtable.c

index 6c6a99660e78b838ba63ebb858766b350e34a3d0..d6fb999c8c6dc2c4bdb42878924c45137fdcd632 100644 (file)
@@ -27,7 +27,6 @@ int cpu_have_feature(unsigned int nr);
 #define cpu_has_edat1()                test_facility(8)
 #define cpu_has_edat2()                test_facility(78)
 #define cpu_has_gs()           test_facility(133)
-#define cpu_has_idte()         test_facility(3)
 #define cpu_has_nx()           test_facility(130)
 #define cpu_has_rdp()          test_facility(194)
 #define cpu_has_seq_insn()     test_facility(85)
index 75491baa21974e4cb5021c510cdfb732098575ba..c7f04f9e99b30fbfe9bd0e56dbc377a879ccfc45 100644 (file)
@@ -54,7 +54,7 @@ static inline void __tlb_flush_mm(struct mm_struct *mm)
        cpumask_copy(mm_cpumask(mm), &mm->context.cpu_attach_mask);
        barrier();
        gmap_asce = READ_ONCE(mm->context.gmap_asce);
-       if (cpu_has_idte() && gmap_asce != -1UL) {
+       if (gmap_asce != -1UL) {
                if (gmap_asce)
                        __tlb_flush_idte(gmap_asce);
                __tlb_flush_idte(mm->context.asce);
@@ -68,10 +68,7 @@ static inline void __tlb_flush_mm(struct mm_struct *mm)
 
 static inline void __tlb_flush_kernel(void)
 {
-       if (cpu_has_idte())
-               __tlb_flush_idte(init_mm.context.asce);
-       else
-               __tlb_flush_global();
+       __tlb_flush_idte(init_mm.context.asce);
 }
 
 static inline void __tlb_flush_mm_lazy(struct mm_struct * mm)
index 8ff6bba107e8880f5b453518188a778b6a499609..f9174be33023aa849f27b7310906812871638f9c 100644 (file)
@@ -138,10 +138,7 @@ EXPORT_SYMBOL_GPL(gmap_create);
 
 static void gmap_flush_tlb(struct gmap *gmap)
 {
-       if (cpu_has_idte())
-               __tlb_flush_idte(gmap->asce);
-       else
-               __tlb_flush_global();
+       __tlb_flush_idte(gmap->asce);
 }
 
 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,
        if (machine_has_tlb_guest())
                __pmdp_idte(gaddr, (pmd_t *)pmdp, IDTE_GUEST_ASCE, gmap->asce,
                            IDTE_GLOBAL);
-       else if (cpu_has_idte())
-               __pmdp_idte(gaddr, (pmd_t *)pmdp, 0, 0, IDTE_GLOBAL);
        else
-               __pmdp_csp(pmdp);
+               __pmdp_idte(gaddr, (pmd_t *)pmdp, 0, 0, IDTE_GLOBAL);
        set_pmd(pmdp, new);
 }
 
@@ -2066,7 +2061,7 @@ void gmap_pmdp_idte_local(struct mm_struct *mm, unsigned long vmaddr)
                        if (machine_has_tlb_guest())
                                __pmdp_idte(gaddr, pmdp, IDTE_GUEST_ASCE,
                                            gmap->asce, IDTE_LOCAL);
-                       else if (cpu_has_idte())
+                       else
                                __pmdp_idte(gaddr, pmdp, 0, 0, IDTE_LOCAL);
                        *pmdp = __pmd(_SEGMENT_ENTRY_EMPTY);
                }
@@ -2099,10 +2094,8 @@ void gmap_pmdp_idte_global(struct mm_struct *mm, unsigned long vmaddr)
                        if (machine_has_tlb_guest())
                                __pmdp_idte(gaddr, pmdp, IDTE_GUEST_ASCE,
                                            gmap->asce, IDTE_GLOBAL);
-                       else if (cpu_has_idte())
-                               __pmdp_idte(gaddr, pmdp, 0, 0, IDTE_GLOBAL);
                        else
-                               __pmdp_csp(pmdp);
+                               __pmdp_idte(gaddr, pmdp, 0, 0, IDTE_GLOBAL);
                        *pmdp = __pmd(_SEGMENT_ENTRY_EMPTY);
                }
                spin_unlock(&gmap->guest_table_lock);
index 348e759840e7c34d0a617afa74c8d2872f11278a..3042647c9dbf4e70f439b03b9ea43ad64c622f8e 100644 (file)
@@ -78,10 +78,8 @@ static void pgt_set(unsigned long *old, unsigned long new, unsigned long addr,
                }
                table = (unsigned long *)((unsigned long)old & mask);
                crdte(*old, new, table, dtt, addr, get_lowcore()->kernel_asce.val);
-       } else if (cpu_has_idte()) {
-               cspg(old, *old, new);
        } else {
-               csp((unsigned int *)old + 1, *old, new);
+               cspg(old, *old, new);
        }
 }
 
index 0fde20bbc50bf3801efacb55e26cee8a87e55fb5..36305a357cb86c59914ea11cc713b0a2bcd941ee 100644 (file)
@@ -360,14 +360,10 @@ static inline void pmdp_idte_global(struct mm_struct *mm,
                            mm->context.asce, IDTE_GLOBAL);
                if (mm_has_pgste(mm) && mm->context.allow_gmap_hpage_1m)
                        gmap_pmdp_idte_global(mm, addr);
-       } else if (cpu_has_idte()) {
+       } else {
                __pmdp_idte(addr, pmdp, 0, 0, IDTE_GLOBAL);
                if (mm_has_pgste(mm) && mm->context.allow_gmap_hpage_1m)
                        gmap_pmdp_idte_global(mm, addr);
-       } else {
-               __pmdp_csp(pmdp);
-               if (mm_has_pgste(mm) && mm->context.allow_gmap_hpage_1m)
-                       gmap_pmdp_csp(mm, addr);
        }
 }
 
@@ -487,14 +483,8 @@ static inline void pudp_idte_global(struct mm_struct *mm,
        if (machine_has_tlb_guest())
                __pudp_idte(addr, pudp, IDTE_NODAT | IDTE_GUEST_ASCE,
                            mm->context.asce, IDTE_GLOBAL);
-       else if (cpu_has_idte())
-               __pudp_idte(addr, pudp, 0, 0, IDTE_GLOBAL);
        else
-               /*
-                * Invalid bit position is the same for pmd and pud, so we can
-                * reuse _pmd_csp() here
-                */
-               __pmdp_csp((pmd_t *) pudp);
+               __pudp_idte(addr, pudp, 0, 0, IDTE_GLOBAL);
 }
 
 static inline pud_t pudp_flush_direct(struct mm_struct *mm,