aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2013-07-19 05:15:54 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-08-22 06:20:07 -0400
commitd56c893d36678f7ec8552f22ec12793a82ff8ee6 (patch)
treedfad218dc96f8d19c72e419af50fa9fd8e687533 /arch/s390
parenta055f66a3a099e2c886a53421405f98683e94b2b (diff)
s390/pgtable: add pgste_get helper
ptep_modify_prot_start uses the pgste_set helper to store the pgste, while ptep_modify_prot_commit uses its own pointer magic to retrieve the value again. Add the pgste_get help function to keep things symmetrical and improve readability. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/include/asm/pgtable.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index b59b44badae9..26ee897aa1d6 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -619,6 +619,15 @@ static inline void pgste_set_unlock(pte_t *ptep, pgste_t pgste)
619#endif 619#endif
620} 620}
621 621
622static inline pgste_t pgste_get(pte_t *ptep)
623{
624 unsigned long pgste = 0;
625#ifdef CONFIG_PGSTE
626 pgste = *(unsigned long *)(ptep + PTRS_PER_PTE);
627#endif
628 return __pgste(pgste);
629}
630
622static inline void pgste_set(pte_t *ptep, pgste_t pgste) 631static inline void pgste_set(pte_t *ptep, pgste_t pgste)
623{ 632{
624#ifdef CONFIG_PGSTE 633#ifdef CONFIG_PGSTE
@@ -1098,7 +1107,7 @@ static inline void ptep_modify_prot_commit(struct mm_struct *mm,
1098 pgste_t pgste; 1107 pgste_t pgste;
1099 1108
1100 if (mm_has_pgste(mm)) { 1109 if (mm_has_pgste(mm)) {
1101 pgste = *(pgste_t *)(ptep + PTRS_PER_PTE); 1110 pgste = pgste_get(ptep);
1102 pgste_set_key(ptep, pgste, pte); 1111 pgste_set_key(ptep, pgste, pte);
1103 pgste_set_pte(ptep, pte); 1112 pgste_set_pte(ptep, pte);
1104 pgste_set_unlock(ptep, pgste); 1113 pgste_set_unlock(ptep, pgste);