]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - arch/powerpc/mm/hash_utils_64.c
powerpc/mm: Move WIMG update to helper.
[mirror_ubuntu-zesty-kernel.git] / arch / powerpc / mm / hash_utils_64.c
index 6c67bd0bec55743ba99c67381934fde6960c8da1..4233dcccbaf7728d6afe86c0d250bd1b1e88a952 100644 (file)
@@ -182,7 +182,18 @@ unsigned long htab_convert_pte_flags(unsigned long pteflags)
        /*
         * Always add "C" bit for perf. Memory coherence is always enabled
         */
-       return rflags | HPTE_R_C | HPTE_R_M;
+       rflags |=  HPTE_R_C | HPTE_R_M;
+       /*
+        * Add in WIG bits
+        */
+       if (pteflags & _PAGE_WRITETHRU)
+               rflags |= HPTE_R_W;
+       if (pteflags & _PAGE_NO_CACHE)
+               rflags |= HPTE_R_I;
+       if (pteflags & _PAGE_GUARDED)
+               rflags |= HPTE_R_G;
+
+       return rflags;
 }
 
 int htab_bolt_mapping(unsigned long vstart, unsigned long vend,