tile: map data region shadow of kernel as R/W
authorChris Metcalf <cmetcalf@ezchip.com>
Fri, 27 Mar 2015 18:35:31 +0000 (14:35 -0400)
committerChris Metcalf <cmetcalf@ezchip.com>
Fri, 17 Apr 2015 18:01:35 +0000 (14:01 -0400)
This is necessary for things like reading /proc/kcore, doing ftrace,
etc.  It happens by default when using huge pages to map the kernel
data, but not when using small pages.

Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
arch/tile/mm/init.c

index ace32d7d3864c480cb0e51b1694f01e1559d947f..5bd252e3fdc506a6aa393419252a94261768d400 100644 (file)
@@ -233,9 +233,12 @@ static pgprot_t __init init_pgprot(ulong address)
        if (kdata_huge)
                return construct_pgprot(PAGE_KERNEL, PAGE_HOME_HASH);
 
-       /* We map the aliased pages of permanent text inaccessible. */
+       /*
+        * We map the aliased pages of permanent text so we can
+        * update them if necessary, for ftrace, etc.
+        */
        if (address < (ulong) _sinittext - CODE_DELTA)
-               return PAGE_NONE;
+               return construct_pgprot(PAGE_KERNEL, PAGE_HOME_HASH);
 
        /* We map read-only data non-coherent for performance. */
        if ((address >= (ulong) __start_rodata &&