]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.11-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 May 2017 07:49:26 +0000 (16:49 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 May 2017 07:49:26 +0000 (16:49 +0900)
added patches:
sparc-fix-wstringop-overflow-warning.patch
sparc-ftrace-fix-ftrace-graph-time-measurement.patch
sparc64-fix-mapping-of-64k-pages-with-map_fixed.patch

queue-4.11/series
queue-4.11/sparc-fix-wstringop-overflow-warning.patch [new file with mode: 0644]
queue-4.11/sparc-ftrace-fix-ftrace-graph-time-measurement.patch [new file with mode: 0644]
queue-4.11/sparc64-fix-mapping-of-64k-pages-with-map_fixed.patch [new file with mode: 0644]

index 38a534adfae88843c05357ebe732f2597727fa0f..6fce4f06c4c33c603a504c5138fa66ebad20e890 100644 (file)
@@ -39,3 +39,6 @@ ipv4-add-reference-counting-to-metrics.patch
 bpf-add-bpf_clone_redirect-to-bpf_helper_changes_pkt_data.patch
 bpf-fix-wrong-exposure-of-map_flags-into-fdinfo-for-lpm.patch
 bpf-adjust-verifier-heuristics.patch
+sparc64-fix-mapping-of-64k-pages-with-map_fixed.patch
+sparc-fix-wstringop-overflow-warning.patch
+sparc-ftrace-fix-ftrace-graph-time-measurement.patch
diff --git a/queue-4.11/sparc-fix-wstringop-overflow-warning.patch b/queue-4.11/sparc-fix-wstringop-overflow-warning.patch
new file mode 100644 (file)
index 0000000..21b36ae
--- /dev/null
@@ -0,0 +1,73 @@
+From foo@baz Wed May 31 16:49:09 JST 2017
+From: Orlando Arias <oarias@knights.ucf.edu>
+Date: Tue, 16 May 2017 15:34:00 -0400
+Subject: sparc: Fix -Wstringop-overflow warning
+
+From: Orlando Arias <oarias@knights.ucf.edu>
+
+
+[ Upstream commit deba804c90642c8ed0f15ac1083663976d578f54 ]
+
+Greetings,
+
+GCC 7 introduced the -Wstringop-overflow flag to detect buffer overflows
+in calls to string handling functions [1][2]. Due to the way
+``empty_zero_page'' is declared in arch/sparc/include/setup.h, this
+causes a warning to trigger at compile time in the function mem_init(),
+which is subsequently converted to an error. The ensuing patch fixes
+this issue and aligns the declaration of empty_zero_page to that of
+other architectures. Thank you.
+
+Cheers,
+Orlando.
+
+[1] https://gcc.gnu.org/ml/gcc-patches/2016-10/msg02308.html
+[2] https://gcc.gnu.org/gcc-7/changes.html
+
+Signed-off-by: Orlando Arias <oarias@knights.ucf.edu>
+
+--------------------------------------------------------------------------------
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/sparc/include/asm/pgtable_32.h |    4 ++--
+ arch/sparc/include/asm/setup.h      |    2 +-
+ arch/sparc/mm/init_32.c             |    2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/arch/sparc/include/asm/pgtable_32.h
++++ b/arch/sparc/include/asm/pgtable_32.h
+@@ -91,9 +91,9 @@ extern unsigned long pfn_base;
+  * ZERO_PAGE is a global shared page that is always zero: used
+  * for zero-mapped memory areas etc..
+  */
+-extern unsigned long empty_zero_page;
++extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
+-#define ZERO_PAGE(vaddr) (virt_to_page(&empty_zero_page))
++#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
+ /*
+  * In general all page table modifications should use the V8 atomic
+--- a/arch/sparc/include/asm/setup.h
++++ b/arch/sparc/include/asm/setup.h
+@@ -16,7 +16,7 @@ extern char reboot_command[];
+  */
+ extern unsigned char boot_cpu_id;
+-extern unsigned long empty_zero_page;
++extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
+ extern int serial_console;
+ static inline int con_is_present(void)
+--- a/arch/sparc/mm/init_32.c
++++ b/arch/sparc/mm/init_32.c
+@@ -290,7 +290,7 @@ void __init mem_init(void)
+       /* Saves us work later. */
+-      memset((void *)&empty_zero_page, 0, PAGE_SIZE);
++      memset((void *)empty_zero_page, 0, PAGE_SIZE);
+       i = last_valid_pfn >> ((20 - PAGE_SHIFT) + 5);
+       i += 1;
diff --git a/queue-4.11/sparc-ftrace-fix-ftrace-graph-time-measurement.patch b/queue-4.11/sparc-ftrace-fix-ftrace-graph-time-measurement.patch
new file mode 100644 (file)
index 0000000..71ab010
--- /dev/null
@@ -0,0 +1,57 @@
+From foo@baz Wed May 31 16:49:09 JST 2017
+From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
+Date: Wed, 17 May 2017 11:47:00 -0400
+Subject: sparc/ftrace: Fix ftrace graph time measurement
+
+From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
+
+
+[ Upstream commit 48078d2dac0a26f84f5f3ec704f24f7c832cce14 ]
+
+The ftrace function_graph time measurements of a given function is not
+accurate according to those recorded by ftrace using the function
+filters.  This change pulls the x86_64 fix from 'commit 722b3c746953
+("ftrace/graph: Trace function entry before updating index")' into the
+sparc specific prepare_ftrace_return which stops ftrace from
+counting interrupted tasks in the time measurement.
+
+Example measurements for select_task_rq_fair running "hackbench 100
+process 1000":
+
+              |  tracing/trace_stat/function0  |  function_graph
+ Before patch |  2.802 us                      |  4.255 us
+ After patch  |  2.749 us                      |  3.094 us
+
+Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/sparc/kernel/ftrace.c |   13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+--- a/arch/sparc/kernel/ftrace.c
++++ b/arch/sparc/kernel/ftrace.c
+@@ -130,17 +130,16 @@ unsigned long prepare_ftrace_return(unsi
+       if (unlikely(atomic_read(&current->tracing_graph_pause)))
+               return parent + 8UL;
+-      if (ftrace_push_return_trace(parent, self_addr, &trace.depth,
+-                                   frame_pointer, NULL) == -EBUSY)
+-              return parent + 8UL;
+-
+       trace.func = self_addr;
++      trace.depth = current->curr_ret_stack + 1;
+       /* Only trace if the calling function expects to */
+-      if (!ftrace_graph_entry(&trace)) {
+-              current->curr_ret_stack--;
++      if (!ftrace_graph_entry(&trace))
++              return parent + 8UL;
++
++      if (ftrace_push_return_trace(parent, self_addr, &trace.depth,
++                                   frame_pointer, NULL) == -EBUSY)
+               return parent + 8UL;
+-      }
+       return return_hooker;
+ }
diff --git a/queue-4.11/sparc64-fix-mapping-of-64k-pages-with-map_fixed.patch b/queue-4.11/sparc64-fix-mapping-of-64k-pages-with-map_fixed.patch
new file mode 100644 (file)
index 0000000..ba801aa
--- /dev/null
@@ -0,0 +1,40 @@
+From foo@baz Wed May 31 16:49:09 JST 2017
+From: Nitin Gupta <nitin.m.gupta@oracle.com>
+Date: Mon, 15 May 2017 16:28:17 -0700
+Subject: sparc64: Fix mapping of 64k pages with MAP_FIXED
+
+From: Nitin Gupta <nitin.m.gupta@oracle.com>
+
+
+[ Upstream commit b6c41cb050d5debc7e4eaa0a81cbdbad72588891 ]
+
+An incorrect huge page alignment check caused
+mmap failure for 64K pages when MAP_FIXED is used
+with address not aligned to HPAGE_SIZE.
+
+Orabug: 25885991
+
+Fixes: dcd1912d21a0 ("sparc64: Add 64K page size support")
+Signed-off-by: Nitin Gupta <nitin.m.gupta@oracle.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/sparc/include/asm/hugetlb.h |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/arch/sparc/include/asm/hugetlb.h
++++ b/arch/sparc/include/asm/hugetlb.h
+@@ -24,9 +24,11 @@ static inline int is_hugepage_only_range
+ static inline int prepare_hugepage_range(struct file *file,
+                       unsigned long addr, unsigned long len)
+ {
+-      if (len & ~HPAGE_MASK)
++      struct hstate *h = hstate_file(file);
++
++      if (len & ~huge_page_mask(h))
+               return -EINVAL;
+-      if (addr & ~HPAGE_MASK)
++      if (addr & ~huge_page_mask(h))
+               return -EINVAL;
+       return 0;
+ }