aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/pgtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/include/asm/pgtable.h')
-rw-r--r--arch/s390/include/asm/pgtable.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index c4773a2ef3d3..e4efacfe1b63 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -577,16 +577,16 @@ static inline void pgste_set_unlock(pte_t *ptep, pgste_t pgste)
577static inline pgste_t pgste_update_all(pte_t *ptep, pgste_t pgste) 577static inline pgste_t pgste_update_all(pte_t *ptep, pgste_t pgste)
578{ 578{
579#ifdef CONFIG_PGSTE 579#ifdef CONFIG_PGSTE
580 unsigned long pfn, bits; 580 unsigned long address, bits;
581 unsigned char skey; 581 unsigned char skey;
582 582
583 pfn = pte_val(*ptep) >> PAGE_SHIFT; 583 address = pte_val(*ptep) & PAGE_MASK;
584 skey = page_get_storage_key(pfn); 584 skey = page_get_storage_key(address);
585 bits = skey & (_PAGE_CHANGED | _PAGE_REFERENCED); 585 bits = skey & (_PAGE_CHANGED | _PAGE_REFERENCED);
586 /* Clear page changed & referenced bit in the storage key */ 586 /* Clear page changed & referenced bit in the storage key */
587 if (bits) { 587 if (bits) {
588 skey ^= bits; 588 skey ^= bits;
589 page_set_storage_key(pfn, skey, 1); 589 page_set_storage_key(address, skey, 1);
590 } 590 }
591 /* Transfer page changed & referenced bit to guest bits in pgste */ 591 /* Transfer page changed & referenced bit to guest bits in pgste */
592 pgste_val(pgste) |= bits << 48; /* RCP_GR_BIT & RCP_GC_BIT */ 592 pgste_val(pgste) |= bits << 48; /* RCP_GR_BIT & RCP_GC_BIT */
@@ -628,16 +628,16 @@ static inline pgste_t pgste_update_young(pte_t *ptep, pgste_t pgste)
628static inline void pgste_set_pte(pte_t *ptep, pgste_t pgste) 628static inline void pgste_set_pte(pte_t *ptep, pgste_t pgste)
629{ 629{
630#ifdef CONFIG_PGSTE 630#ifdef CONFIG_PGSTE
631 unsigned long pfn; 631 unsigned long address;
632 unsigned long okey, nkey; 632 unsigned long okey, nkey;
633 633
634 pfn = pte_val(*ptep) >> PAGE_SHIFT; 634 address = pte_val(*ptep) & PAGE_MASK;
635 okey = nkey = page_get_storage_key(pfn); 635 okey = nkey = page_get_storage_key(address);
636 nkey &= ~(_PAGE_ACC_BITS | _PAGE_FP_BIT); 636 nkey &= ~(_PAGE_ACC_BITS | _PAGE_FP_BIT);
637 /* Set page access key and fetch protection bit from pgste */ 637 /* Set page access key and fetch protection bit from pgste */
638 nkey |= (pgste_val(pgste) & (RCP_ACC_BITS | RCP_FP_BIT)) >> 56; 638 nkey |= (pgste_val(pgste) & (RCP_ACC_BITS | RCP_FP_BIT)) >> 56;
639 if (okey != nkey) 639 if (okey != nkey)
640 page_set_storage_key(pfn, nkey, 1); 640 page_set_storage_key(address, nkey, 1);
641#endif 641#endif
642} 642}
643 643