Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2019-05-03 11:50:25 +0200
committerMichal Suchanek <msuchanek@suse.de>2019-05-03 12:10:32 +0200
commitb628e693111f0e32f63d7d246a18891c1e7ede37 (patch)
treeedd60fe8eb9c83527e09252d2457c3acc0f10306
parent9b16c7cdaeb5e685caa1946541eb1d9679b87405 (diff)
powerpc/mm/radix: Display if mappings are exec or not
(bsc#1055186, fate#323286, git-fixes).
-rw-r--r--patches.arch/powerpc-mm-radix-Display-if-mappings-are-exec-or-not.patch95
-rw-r--r--series.conf1
2 files changed, 96 insertions, 0 deletions
diff --git a/patches.arch/powerpc-mm-radix-Display-if-mappings-are-exec-or-not.patch b/patches.arch/powerpc-mm-radix-Display-if-mappings-are-exec-or-not.patch
new file mode 100644
index 0000000000..c22d4bc88c
--- /dev/null
+++ b/patches.arch/powerpc-mm-radix-Display-if-mappings-are-exec-or-not.patch
@@ -0,0 +1,95 @@
+From afb6d0647fd250a068efd985987b5ff2c0d1b853 Mon Sep 17 00:00:00 2001
+From: Michael Ellerman <mpe@ellerman.id.au>
+Date: Wed, 17 Oct 2018 23:53:38 +1100
+Subject: [PATCH] powerpc/mm/radix: Display if mappings are exec or not
+
+References: bsc#1055186, fate#323286, git-fixes
+Patch-mainline: v4.20-rc1
+Git-commit: afb6d0647fd250a068efd985987b5ff2c0d1b853
+
+At boot we print the ranges we've mapped for the linear mapping and
+what page size we've used. Also track whether the range is mapped
+executable or not and display that as well.
+
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/mm/pgtable-radix.c | 29 +++++++++++++++++------------
+ 1 file changed, 17 insertions(+), 12 deletions(-)
+
+--- a/arch/powerpc/mm/pgtable-radix.c
++++ b/arch/powerpc/mm/pgtable-radix.c
+@@ -180,9 +180,8 @@ void radix__mark_rodata_ro(void)
+ }
+ #endif /* CONFIG_STRICT_KERNEL_RWX */
+
+-static inline void __meminit print_mapping(unsigned long start,
+- unsigned long end,
+- unsigned long size)
++static inline void __meminit
++print_mapping(unsigned long start, unsigned long end, unsigned long size, bool exec)
+ {
+ char buf[10];
+
+@@ -191,13 +190,15 @@ static inline void __meminit print_mappi
+
+ string_get_size(size, 1, STRING_UNITS_2, buf, sizeof(buf));
+
+- pr_info("Mapped 0x%016lx-0x%016lx with %s pages\n", start, end, buf);
++ pr_info("Mapped 0x%016lx-0x%016lx with %s pages%s\n", start, end, buf,
++ exec ? " (exec)" : "");
+ }
+
+ static int __meminit create_physical_mapping(unsigned long start,
+ unsigned long end)
+ {
+ unsigned long vaddr, addr, mapping_size = 0;
++ bool prev_exec, exec = false;
+ pgprot_t prot;
+ unsigned long max_mapping_size;
+ #ifdef CONFIG_STRICT_KERNEL_RWX
+@@ -213,6 +214,7 @@ static int __meminit create_physical_map
+
+ gap = end - addr;
+ previous_size = mapping_size;
++ prev_exec = exec;
+ max_mapping_size = PUD_SIZE;
+
+ retry:
+@@ -238,25 +240,28 @@ retry:
+ (addr + mapping_size) >= __pa_symbol(_stext))
+ mapping_size = PAGE_SIZE;
+
+- if (mapping_size != previous_size) {
+- print_mapping(start, addr, previous_size);
+- start = addr;
+- }
+-
+ vaddr = (unsigned long)__va(addr);
+
+ if (overlaps_kernel_text(vaddr, vaddr + mapping_size) ||
+- overlaps_interrupt_vector_text(vaddr, vaddr + mapping_size))
++ overlaps_interrupt_vector_text(vaddr, vaddr + mapping_size)) {
+ prot = PAGE_KERNEL_X;
+- else
++ exec = true;
++ } else {
+ prot = PAGE_KERNEL;
++ exec = false;
++ }
++
++ if (mapping_size != previous_size || exec != prev_exec) {
++ print_mapping(start, addr, previous_size, prev_exec);
++ start = addr;
++ }
+
+ rc = radix__map_kernel_page(vaddr, addr, prot, mapping_size);
+ if (rc)
+ return rc;
+ }
+
+- print_mapping(start, addr, mapping_size);
++ print_mapping(start, addr, mapping_size, exec);
+ return 0;
+ }
+
diff --git a/series.conf b/series.conf
index 93da1bbbef..38ea33bbc7 100644
--- a/series.conf
+++ b/series.conf
@@ -19629,6 +19629,7 @@
patches.arch/powerpc-cacheinfo-Report-the-correct-shared_cpu_map-.patch
patches.arch/powerpc-rtas-Fix-a-potential-race-between-CPU-Offlin.patch
patches.arch/powerpc-mm-Add-missing-tracepoint-for-tlbie.patch
+ patches.arch/powerpc-mm-radix-Display-if-mappings-are-exec-or-not.patch
patches.arch/powerpc-traps-restore-recoverability-of-machine_chec.patch
patches.suse/net-udp-fix-handling-of-CHECKSUM_COMPLETE-packets.patch
patches.suse/ipv6-ndisc-Preserve-IPv6-control-buffer-if-protocol-.patch