]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - arch/s390/include/asm/pgtable.h
s390/mm: properly clear _PAGE_NOEXEC bit when it is not supported
[mirror_ubuntu-bionic-kernel.git] / arch / s390 / include / asm / pgtable.h
index fcf5fc0e584fad931ce005580d2abac2f977b7ad..17056ef53b02aaec35b2da807e77b0f6cd38f6e4 100644 (file)
@@ -1144,8 +1144,6 @@ int pgste_perform_essa(struct mm_struct *mm, unsigned long hva, int orc,
 static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
                              pte_t *ptep, pte_t entry)
 {
-       if (!MACHINE_HAS_NX)
-               pte_val(entry) &= ~_PAGE_NOEXEC;
        if (pte_present(entry))
                pte_val(entry) &= ~_PAGE_UNUSED;
        if (mm_has_pgste(mm))
@@ -1162,6 +1160,8 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
 {
        pte_t __pte;
        pte_val(__pte) = physpage + pgprot_val(pgprot);
+       if (!MACHINE_HAS_NX)
+               pte_val(__pte) &= ~_PAGE_NOEXEC;
        return pte_mkyoung(__pte);
 }