Move some storage key handling functions to headers, since they will be needed from outside, and they are small, so inlining is acceptable. Signed-off-by: Claudio Imbrenda --- arch/s390/kvm/gmap/dat.c | 26 -------------------------- arch/s390/kvm/gmap/dat.h | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/arch/s390/kvm/gmap/dat.c b/arch/s390/kvm/gmap/dat.c index ff80d02c9f56..b9507daaf327 100644 --- a/arch/s390/kvm/gmap/dat.c +++ b/arch/s390/kvm/gmap/dat.c @@ -159,32 +159,6 @@ bool __must_check dat_crstep_xchg_atomic(union crste *crstep, union crste old, u return cspg_crste(crstep, old, new); } -static void dat_set_storage_key_from_pgste(union pte pte, union pgste pgste) -{ - union skey nkey = { .acc = pgste.acc, .fp = pgste.fp }; - - page_set_storage_key(pte_origin(pte), nkey.skey, 0); -} - -static void dat_move_storage_key(union pte old, union pte new) -{ - page_set_storage_key(pte_origin(new), page_get_storage_key(pte_origin(old)), 1); -} - -static union pgste dat_save_storage_key_into_pgste(union pte pte, union pgste pgste) -{ - union skey skey; - - skey.skey = page_get_storage_key(pte_origin(pte)); - - pgste.acc = skey.acc; - pgste.fp = skey.fp; - pgste.gr |= skey.r; - pgste.gc |= skey.c; - - return pgste; -} - union pgste __dat_ptep_xchg(union pte *ptep, union pgste pgste, union pte new, gfn_t gfn, union asce asce, bool uses_skeys) { diff --git a/arch/s390/kvm/gmap/dat.h b/arch/s390/kvm/gmap/dat.h index 90389d47ba4e..3167543bf2cc 100644 --- a/arch/s390/kvm/gmap/dat.h +++ b/arch/s390/kvm/gmap/dat.h @@ -988,4 +988,30 @@ static inline bool crste_is_ucas(union crste crste) return is_pmd(crste) && crste.h.i && crste.h.fc0.tl == 1 && crste.h.fc == 0; } +static inline void dat_set_storage_key_from_pgste(union pte pte, union pgste pgste) +{ + union skey nkey = { .acc = pgste.acc, .fp = pgste.fp }; + + page_set_storage_key(pte_origin(pte), nkey.skey, 0); +} + +static inline void dat_move_storage_key(union pte old, union pte new) +{ + page_set_storage_key(pte_origin(new), page_get_storage_key(pte_origin(old)), 1); +} + +static inline union pgste dat_save_storage_key_into_pgste(union pte pte, union pgste pgste) +{ + union skey skey; + + skey.skey = page_get_storage_key(pte_origin(pte)); + + pgste.acc = skey.acc; + pgste.fp = skey.fp; + pgste.gr |= skey.r; + pgste.gc |= skey.c; + + return pgste; +} + #endif /* ARCH_KVM_GMAP_DAT_H */ -- 2.56.0