aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/s390/include/asm/pgtable.h16
-rw-r--r--include/linux/page-flags.h2
2 files changed, 9 insertions, 9 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
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 79a6700b7162..6081493db68f 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -308,7 +308,7 @@ static inline void SetPageUptodate(struct page *page)
308{ 308{
309#ifdef CONFIG_S390 309#ifdef CONFIG_S390
310 if (!test_and_set_bit(PG_uptodate, &page->flags)) 310 if (!test_and_set_bit(PG_uptodate, &page->flags))
311 page_set_storage_key(page_to_pfn(page), PAGE_DEFAULT_KEY, 0); 311 page_set_storage_key(page_to_phys(page), PAGE_DEFAULT_KEY, 0);
312#else 312#else
313 /* 313 /*
314 * Memory barrier must be issued before setting the PG_uptodate bit, 314 * Memory barrier must be issued before setting the PG_uptodate bit,