Skip to content

Commit 68807a8

Browse files
committed
s390/mm: Replace the CSP instruction with CSPG
The CSPG instruction is part of the Dat-Enhancement facility 1, which is always available. Given that it can be used everywhere where also the CSP instruction can be used, replace CSP with CSPG everywhere. This allows to remove the csp() inline assembly. Also remove the unused gmap_pmdp_csp() function. 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 220d8e1 commit 68807a8

3 files changed

Lines changed: 6 additions & 30 deletions

File tree

arch/s390/include/asm/pgtable.h

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -648,18 +648,6 @@ static inline int mm_uses_skeys(struct mm_struct *mm)
648648
return 0;
649649
}
650650

651-
static inline void csp(unsigned int *ptr, unsigned int old, unsigned int new)
652-
{
653-
union register_pair r1 = { .even = old, .odd = new, };
654-
unsigned long address = (unsigned long)ptr | 1;
655-
656-
asm volatile(
657-
" csp %[r1],%[address]"
658-
: [r1] "+&d" (r1.pair), "+m" (*ptr)
659-
: [address] "d" (address)
660-
: "cc");
661-
}
662-
663651
/**
664652
* cspg() - Compare and Swap and Purge (CSPG)
665653
* @ptr: Pointer to the value to be exchanged
@@ -1402,7 +1390,6 @@ int set_pgste_bits(struct mm_struct *mm, unsigned long addr,
14021390
int get_pgste(struct mm_struct *mm, unsigned long hva, unsigned long *pgstep);
14031391
int pgste_perform_essa(struct mm_struct *mm, unsigned long hva, int orc,
14041392
unsigned long *oldpte, unsigned long *oldpgste);
1405-
void gmap_pmdp_csp(struct mm_struct *mm, unsigned long vmaddr);
14061393
void gmap_pmdp_invalidate(struct mm_struct *mm, unsigned long vmaddr);
14071394
void gmap_pmdp_idte_local(struct mm_struct *mm, unsigned long vmaddr);
14081395
void gmap_pmdp_idte_global(struct mm_struct *mm, unsigned long vmaddr);
@@ -1692,10 +1679,10 @@ static inline pmd_t mk_pmd_phys(unsigned long physpage, pgprot_t pgprot)
16921679

16931680
#endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLB_PAGE */
16941681

1695-
static inline void __pmdp_csp(pmd_t *pmdp)
1682+
static inline void __pmdp_cspg(pmd_t *pmdp)
16961683
{
1697-
csp((unsigned int *)pmdp + 1, pmd_val(*pmdp),
1698-
pmd_val(*pmdp) | _SEGMENT_ENTRY_INVALID);
1684+
cspg((unsigned long *)pmdp, pmd_val(*pmdp),
1685+
pmd_val(*pmdp) | _SEGMENT_ENTRY_INVALID);
16991686
}
17001687

17011688
#define IDTE_GLOBAL 0

arch/s390/include/asm/tlbflush.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ static inline void __tlb_flush_idte(unsigned long asce)
3535
*/
3636
static inline void __tlb_flush_global(void)
3737
{
38-
unsigned int dummy = 0;
38+
unsigned long dummy = 0;
3939

40-
csp(&dummy, 0, 0);
40+
cspg(&dummy, 0, 0);
4141
}
4242

4343
/*

arch/s390/mm/gmap.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,7 +2007,7 @@ static void gmap_pmdp_clear(struct mm_struct *mm, unsigned long vmaddr,
20072007
_SEGMENT_ENTRY_GMAP_UC |
20082008
_SEGMENT_ENTRY));
20092009
if (purge)
2010-
__pmdp_csp(pmdp);
2010+
__pmdp_cspg(pmdp);
20112011
set_pmd(pmdp, __pmd(_SEGMENT_ENTRY_EMPTY));
20122012
}
20132013
spin_unlock(&gmap->guest_table_lock);
@@ -2027,17 +2027,6 @@ void gmap_pmdp_invalidate(struct mm_struct *mm, unsigned long vmaddr)
20272027
}
20282028
EXPORT_SYMBOL_GPL(gmap_pmdp_invalidate);
20292029

2030-
/**
2031-
* gmap_pmdp_csp - csp all affected guest pmd entries
2032-
* @mm: pointer to the process mm_struct
2033-
* @vmaddr: virtual address in the process address space
2034-
*/
2035-
void gmap_pmdp_csp(struct mm_struct *mm, unsigned long vmaddr)
2036-
{
2037-
gmap_pmdp_clear(mm, vmaddr, 1);
2038-
}
2039-
EXPORT_SYMBOL_GPL(gmap_pmdp_csp);
2040-
20412030
/**
20422031
* gmap_pmdp_idte_local - invalidate and clear a guest pmd entry
20432032
* @mm: pointer to the process mm_struct

0 commit comments

Comments
 (0)