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

queue-4.9/series
queue-4.9/sparc-fix-wstringop-overflow-warning.patch [new file with mode: 0644]
queue-4.9/sparc-ftrace-fix-ftrace-graph-time-measurement.patch [new file with mode: 0644]

index b57eea84ea4615ee1c7c8e14ccb2558b080a9cab..eedbed3299d0a7d2a32946e48771d2aaec2c804c 100644 (file)
@@ -32,3 +32,5 @@ tcp-avoid-fastopen-api-to-be-used-on-af_unspec.patch
 sctp-fix-icmp-processing-if-skb-is-non-linear.patch
 ipv4-add-reference-counting-to-metrics.patch
 bpf-add-bpf_clone_redirect-to-bpf_helper_changes_pkt_data.patch
+sparc-fix-wstringop-overflow-warning.patch
+sparc-ftrace-fix-ftrace-graph-time-measurement.patch
diff --git a/queue-4.9/sparc-fix-wstringop-overflow-warning.patch b/queue-4.9/sparc-fix-wstringop-overflow-warning.patch
new file mode 100644 (file)
index 0000000..bc72369
--- /dev/null
@@ -0,0 +1,73 @@
+From foo@baz Wed May 31 16:49:17 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
+@@ -301,7 +301,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.9/sparc-ftrace-fix-ftrace-graph-time-measurement.patch b/queue-4.9/sparc-ftrace-fix-ftrace-graph-time-measurement.patch
new file mode 100644 (file)
index 0000000..34ccadf
--- /dev/null
@@ -0,0 +1,57 @@
+From foo@baz Wed May 31 16:49:17 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;
+ }