aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/s390/include/asm/pgtable.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index ac01463038f1..391e592356d0 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -704,17 +704,19 @@ static inline void pgste_set_key(pte_t *ptep, pgste_t pgste, pte_t entry)
704{ 704{
705#ifdef CONFIG_PGSTE 705#ifdef CONFIG_PGSTE
706 unsigned long address; 706 unsigned long address;
707 unsigned long okey, nkey; 707 unsigned long nkey;
708 708
709 if (pte_val(entry) & _PAGE_INVALID) 709 if (pte_val(entry) & _PAGE_INVALID)
710 return; 710 return;
711 VM_BUG_ON(!(pte_val(*ptep) & _PAGE_INVALID));
711 address = pte_val(entry) & PAGE_MASK; 712 address = pte_val(entry) & PAGE_MASK;
712 okey = nkey = page_get_storage_key(address); 713 /*
713 nkey &= ~(_PAGE_ACC_BITS | _PAGE_FP_BIT); 714 * Set page access key and fetch protection bit from pgste.
714 /* Set page access key and fetch protection bit from pgste */ 715 * The guest C/R information is still in the PGSTE, set real
715 nkey |= (pgste_val(pgste) & (RCP_ACC_BITS | RCP_FP_BIT)) >> 56; 716 * key C/R to 0.
716 if (okey != nkey) 717 */
717 page_set_storage_key(address, nkey, 0); 718 nkey = (pgste_val(pgste) & (RCP_ACC_BITS | RCP_FP_BIT)) >> 56;
719 page_set_storage_key(address, nkey, 0);
718#endif 720#endif
719} 721}
720 722