From: Greg Kroah-Hartman Date: Tue, 13 Oct 2015 20:37:57 +0000 (-0700) Subject: 3.14-stable patches X-Git-Tag: v3.10.91~81 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=decddc842e090487dc8267dea9591776c56e162f;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: arm-8429-1-disable-gcc-sra-optimization.patch arm-dts-omap5-uevm.dts-fix-i2c5-pinctrl-offsets.patch arm-fix-thumb2-signal-handling-when-armv6-is-enabled.patch hwmon-nct6775-swap-step_up_time-and-step_down_time-registers-for-most-chips.patch perf-header-fixup-reading-of-header_nrcpus-feature.patch perf-hists-update-the-column-width-for-the-srcline-sort-key.patch perf-stat-get-correct-cpu-id-for-print_aggr.patch perf-tools-fix-copying-of-proc-kcore.patch windfarm-decrement-client-count-when-unregistering.patch --- diff --git a/queue-3.14/arm-8429-1-disable-gcc-sra-optimization.patch b/queue-3.14/arm-8429-1-disable-gcc-sra-optimization.patch new file mode 100644 index 00000000000..80c7b30bb72 --- /dev/null +++ b/queue-3.14/arm-8429-1-disable-gcc-sra-optimization.patch @@ -0,0 +1,84 @@ +From a077224fd35b2f7fbc93f14cf67074fc792fbac2 Mon Sep 17 00:00:00 2001 +From: Ard Biesheuvel +Date: Thu, 3 Sep 2015 13:24:40 +0100 +Subject: ARM: 8429/1: disable GCC SRA optimization + +From: Ard Biesheuvel + +commit a077224fd35b2f7fbc93f14cf67074fc792fbac2 upstream. + +While working on the 32-bit ARM port of UEFI, I noticed a strange +corruption in the kernel log. The following snprintf() statement +(in drivers/firmware/efi/efi.c:efi_md_typeattr_format()) + + snprintf(pos, size, "|%3s|%2s|%2s|%2s|%3s|%2s|%2s|%2s|%2s]", + +was producing the following output in the log: + + | | | | | |WB|WT|WC|UC] + | | | | | |WB|WT|WC|UC] + | | | | | |WB|WT|WC|UC] + |RUN| | | | |WB|WT|WC|UC]* + |RUN| | | | |WB|WT|WC|UC]* + | | | | | |WB|WT|WC|UC] + |RUN| | | | |WB|WT|WC|UC]* + | | | | | |WB|WT|WC|UC] + |RUN| | | | | | | |UC] + |RUN| | | | | | | |UC] + +As it turns out, this is caused by incorrect code being emitted for +the string() function in lib/vsprintf.c. The following code + + if (!(spec.flags & LEFT)) { + while (len < spec.field_width--) { + if (buf < end) + *buf = ' '; + ++buf; + } + } + for (i = 0; i < len; ++i) { + if (buf < end) + *buf = *s; + ++buf; ++s; + } + while (len < spec.field_width--) { + if (buf < end) + *buf = ' '; + ++buf; + } + +when called with len == 0, triggers an issue in the GCC SRA optimization +pass (Scalar Replacement of Aggregates), which handles promotion of signed +struct members incorrectly. This is a known but as yet unresolved issue. +(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932). In this particular +case, it is causing the second while loop to be executed erroneously a +single time, causing the additional space characters to be printed. + +So disable the optimization by passing -fno-ipa-sra. + +Acked-by: Nicolas Pitre +Signed-off-by: Ard Biesheuvel +Signed-off-by: Russell King +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/Makefile | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/arch/arm/Makefile ++++ b/arch/arm/Makefile +@@ -52,6 +52,14 @@ endif + + comma = , + ++# ++# The Scalar Replacement of Aggregates (SRA) optimization pass in GCC 4.9 and ++# later may result in code being generated that handles signed short and signed ++# char struct members incorrectly. So disable it. ++# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932) ++# ++KBUILD_CFLAGS += $(call cc-option,-fno-ipa-sra) ++ + # This selects which instruction set is used. + # Note that GCC does not numerically define an architecture version + # macro, but instead defines a whole series of macros which makes diff --git a/queue-3.14/arm-dts-omap5-uevm.dts-fix-i2c5-pinctrl-offsets.patch b/queue-3.14/arm-dts-omap5-uevm.dts-fix-i2c5-pinctrl-offsets.patch new file mode 100644 index 00000000000..b28d3c21993 --- /dev/null +++ b/queue-3.14/arm-dts-omap5-uevm.dts-fix-i2c5-pinctrl-offsets.patch @@ -0,0 +1,35 @@ +From 1dbdad75074d16c3e3005180f81a01cdc04a7872 Mon Sep 17 00:00:00 2001 +From: Grazvydas Ignotas +Date: Wed, 16 Sep 2015 01:34:31 +0300 +Subject: ARM: dts: omap5-uevm.dts: fix i2c5 pinctrl offsets + +From: Grazvydas Ignotas + +commit 1dbdad75074d16c3e3005180f81a01cdc04a7872 upstream. + +The i2c5 pinctrl offsets are wrong. If the bootloader doesn't set the +pins up, communication with tca6424a doesn't work (controller timeouts) +and it is not possible to enable HDMI. + +Fixes: 9be495c42609 ("ARM: dts: omap5-evm: Add I2c pinctrl data") +Signed-off-by: Grazvydas Ignotas +Signed-off-by: Tony Lindgren +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/omap5-uevm.dts | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/omap5-uevm.dts ++++ b/arch/arm/boot/dts/omap5-uevm.dts +@@ -111,8 +111,8 @@ + + i2c5_pins: pinmux_i2c5_pins { + pinctrl-single,pins = < +- 0x184 (PIN_INPUT | MUX_MODE0) /* i2c5_scl */ +- 0x186 (PIN_INPUT | MUX_MODE0) /* i2c5_sda */ ++ 0x186 (PIN_INPUT | MUX_MODE0) /* i2c5_scl */ ++ 0x188 (PIN_INPUT | MUX_MODE0) /* i2c5_sda */ + >; + }; + diff --git a/queue-3.14/arm-fix-thumb2-signal-handling-when-armv6-is-enabled.patch b/queue-3.14/arm-fix-thumb2-signal-handling-when-armv6-is-enabled.patch new file mode 100644 index 00000000000..b853b768d92 --- /dev/null +++ b/queue-3.14/arm-fix-thumb2-signal-handling-when-armv6-is-enabled.patch @@ -0,0 +1,59 @@ +From 9b55613f42e8d40d5c9ccb8970bde6af4764b2ab Mon Sep 17 00:00:00 2001 +From: Russell King +Date: Fri, 11 Sep 2015 16:44:02 +0100 +Subject: ARM: fix Thumb2 signal handling when ARMv6 is enabled + +From: Russell King + +commit 9b55613f42e8d40d5c9ccb8970bde6af4764b2ab upstream. + +When a kernel is built covering ARMv6 to ARMv7, we omit to clear the +IT state when entering a signal handler. This can cause the first +few instructions to be conditionally executed depending on the parent +context. + +In any case, the original test for >= ARMv7 is broken - ARMv6 can have +Thumb-2 support as well, and an ARMv6T2 specific build would omit this +code too. + +Relax the test back to ARMv6 or greater. This results in us always +clearing the IT state bits in the PSR, even on CPUs where these bits +are reserved. However, they're reserved for the IT state, so this +should cause no harm. + +Fixes: d71e1352e240 ("Clear the IT state when invoking a Thumb-2 signal handler") +Acked-by: Tony Lindgren +Tested-by: H. Nikolaus Schaller +Tested-by: Grazvydas Ignotas +Signed-off-by: Russell King +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/kernel/signal.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +--- a/arch/arm/kernel/signal.c ++++ b/arch/arm/kernel/signal.c +@@ -353,12 +353,17 @@ setup_return(struct pt_regs *regs, struc + */ + thumb = handler & 1; + +-#if __LINUX_ARM_ARCH__ >= 7 ++#if __LINUX_ARM_ARCH__ >= 6 + /* +- * Clear the If-Then Thumb-2 execution state +- * ARM spec requires this to be all 000s in ARM mode +- * Snapdragon S4/Krait misbehaves on a Thumb=>ARM +- * signal transition without this. ++ * Clear the If-Then Thumb-2 execution state. ARM spec ++ * requires this to be all 000s in ARM mode. Snapdragon ++ * S4/Krait misbehaves on a Thumb=>ARM signal transition ++ * without this. ++ * ++ * We must do this whenever we are running on a Thumb-2 ++ * capable CPU, which includes ARMv6T2. However, we elect ++ * to do this whenever we're on an ARMv6 or later CPU for ++ * simplicity. + */ + cpsr &= ~PSR_IT_MASK; + #endif diff --git a/queue-3.14/hwmon-nct6775-swap-step_up_time-and-step_down_time-registers-for-most-chips.patch b/queue-3.14/hwmon-nct6775-swap-step_up_time-and-step_down_time-registers-for-most-chips.patch new file mode 100644 index 00000000000..ecd15294c77 --- /dev/null +++ b/queue-3.14/hwmon-nct6775-swap-step_up_time-and-step_down_time-registers-for-most-chips.patch @@ -0,0 +1,67 @@ +From 728d29400488d54974d3317fe8a232b45fdb42ee Mon Sep 17 00:00:00 2001 +From: Guenter Roeck +Date: Mon, 31 Aug 2015 16:13:47 -0700 +Subject: hwmon: (nct6775) Swap STEP_UP_TIME and STEP_DOWN_TIME registers for most chips + +From: Guenter Roeck + +commit 728d29400488d54974d3317fe8a232b45fdb42ee upstream. + +The STEP_UP_TIME and STEP_DOWN_TIME registers are swapped for all chips but +NCT6775. + +Reported-by: Grazvydas Ignotas +Reviewed-by: Jean Delvare +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hwmon/nct6775.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +--- a/drivers/hwmon/nct6775.c ++++ b/drivers/hwmon/nct6775.c +@@ -350,6 +350,10 @@ static const u16 NCT6775_REG_TEMP_CRIT[A + + /* NCT6776 specific data */ + ++/* STEP_UP_TIME and STEP_DOWN_TIME regs are swapped for all chips but NCT6775 */ ++#define NCT6776_REG_FAN_STEP_UP_TIME NCT6775_REG_FAN_STEP_DOWN_TIME ++#define NCT6776_REG_FAN_STEP_DOWN_TIME NCT6775_REG_FAN_STEP_UP_TIME ++ + static const s8 NCT6776_ALARM_BITS[] = { + 0, 1, 2, 3, 8, 21, 20, 16, /* in0.. in7 */ + 17, -1, -1, -1, -1, -1, -1, /* in8..in14 */ +@@ -3476,8 +3480,8 @@ static int nct6775_probe(struct platform + data->REG_FAN_PULSES = NCT6776_REG_FAN_PULSES; + data->FAN_PULSE_SHIFT = NCT6775_FAN_PULSE_SHIFT; + data->REG_FAN_TIME[0] = NCT6775_REG_FAN_STOP_TIME; +- data->REG_FAN_TIME[1] = NCT6775_REG_FAN_STEP_UP_TIME; +- data->REG_FAN_TIME[2] = NCT6775_REG_FAN_STEP_DOWN_TIME; ++ data->REG_FAN_TIME[1] = NCT6776_REG_FAN_STEP_UP_TIME; ++ data->REG_FAN_TIME[2] = NCT6776_REG_FAN_STEP_DOWN_TIME; + data->REG_TOLERANCE_H = NCT6776_REG_TOLERANCE_H; + data->REG_PWM[0] = NCT6775_REG_PWM; + data->REG_PWM[1] = NCT6775_REG_FAN_START_OUTPUT; +@@ -3548,8 +3552,8 @@ static int nct6775_probe(struct platform + data->REG_FAN_PULSES = NCT6779_REG_FAN_PULSES; + data->FAN_PULSE_SHIFT = NCT6775_FAN_PULSE_SHIFT; + data->REG_FAN_TIME[0] = NCT6775_REG_FAN_STOP_TIME; +- data->REG_FAN_TIME[1] = NCT6775_REG_FAN_STEP_UP_TIME; +- data->REG_FAN_TIME[2] = NCT6775_REG_FAN_STEP_DOWN_TIME; ++ data->REG_FAN_TIME[1] = NCT6776_REG_FAN_STEP_UP_TIME; ++ data->REG_FAN_TIME[2] = NCT6776_REG_FAN_STEP_DOWN_TIME; + data->REG_TOLERANCE_H = NCT6776_REG_TOLERANCE_H; + data->REG_PWM[0] = NCT6775_REG_PWM; + data->REG_PWM[1] = NCT6775_REG_FAN_START_OUTPUT; +@@ -3624,8 +3628,8 @@ static int nct6775_probe(struct platform + data->REG_FAN_PULSES = NCT6779_REG_FAN_PULSES; + data->FAN_PULSE_SHIFT = NCT6775_FAN_PULSE_SHIFT; + data->REG_FAN_TIME[0] = NCT6775_REG_FAN_STOP_TIME; +- data->REG_FAN_TIME[1] = NCT6775_REG_FAN_STEP_UP_TIME; +- data->REG_FAN_TIME[2] = NCT6775_REG_FAN_STEP_DOWN_TIME; ++ data->REG_FAN_TIME[1] = NCT6776_REG_FAN_STEP_UP_TIME; ++ data->REG_FAN_TIME[2] = NCT6776_REG_FAN_STEP_DOWN_TIME; + data->REG_TOLERANCE_H = NCT6776_REG_TOLERANCE_H; + data->REG_PWM[0] = NCT6775_REG_PWM; + data->REG_PWM[1] = NCT6775_REG_FAN_START_OUTPUT; diff --git a/queue-3.14/perf-header-fixup-reading-of-header_nrcpus-feature.patch b/queue-3.14/perf-header-fixup-reading-of-header_nrcpus-feature.patch new file mode 100644 index 00000000000..61a14a670a2 --- /dev/null +++ b/queue-3.14/perf-header-fixup-reading-of-header_nrcpus-feature.patch @@ -0,0 +1,83 @@ +From caa470475d9b59eeff093ae650800d34612c4379 Mon Sep 17 00:00:00 2001 +From: Arnaldo Carvalho de Melo +Date: Fri, 11 Sep 2015 12:36:12 -0300 +Subject: perf header: Fixup reading of HEADER_NRCPUS feature + +From: Arnaldo Carvalho de Melo + +commit caa470475d9b59eeff093ae650800d34612c4379 upstream. + +The original patch introducing this header wrote the number of CPUs available +and online in one order and then swapped those values when reading, fix it. + +Before: + + # perf record usleep 1 + # perf report --header-only | grep 'nrcpus \(online\|avail\)' + # nrcpus online : 4 + # nrcpus avail : 4 + # echo 0 > /sys/devices/system/cpu/cpu2/online + # perf record usleep 1 + # perf report --header-only | grep 'nrcpus \(online\|avail\)' + # nrcpus online : 4 + # nrcpus avail : 3 + # echo 0 > /sys/devices/system/cpu/cpu1/online + # perf record usleep 1 + # perf report --header-only | grep 'nrcpus \(online\|avail\)' + # nrcpus online : 4 + # nrcpus avail : 2 + +After the fix, bringing back the CPUs online: + + # perf report --header-only | grep 'nrcpus \(online\|avail\)' + # nrcpus online : 2 + # nrcpus avail : 4 + # echo 1 > /sys/devices/system/cpu/cpu2/online + # perf record usleep 1 + # perf report --header-only | grep 'nrcpus \(online\|avail\)' + # nrcpus online : 3 + # nrcpus avail : 4 + # echo 1 > /sys/devices/system/cpu/cpu1/online + # perf record usleep 1 + # perf report --header-only | grep 'nrcpus \(online\|avail\)' + # nrcpus online : 4 + # nrcpus avail : 4 + +Acked-by: Namhyung Kim +Cc: Adrian Hunter +Cc: Borislav Petkov +Cc: David Ahern +Cc: Frederic Weisbecker +Cc: Jiri Olsa +Cc: Kan Liang +Cc: Stephane Eranian +Cc: Wang Nan +Fixes: fbe96f29ce4b ("perf tools: Make perf.data more self-descriptive (v8)") +Link: http://lkml.kernel.org/r/20150911153323.GP23511@kernel.org +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/util/header.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/tools/perf/util/header.c ++++ b/tools/perf/util/header.c +@@ -1715,7 +1715,7 @@ static int process_nrcpus(struct perf_fi + if (ph->needs_swap) + nr = bswap_32(nr); + +- ph->env.nr_cpus_online = nr; ++ ph->env.nr_cpus_avail = nr; + + ret = readn(fd, &nr, sizeof(nr)); + if (ret != sizeof(nr)) +@@ -1724,7 +1724,7 @@ static int process_nrcpus(struct perf_fi + if (ph->needs_swap) + nr = bswap_32(nr); + +- ph->env.nr_cpus_avail = nr; ++ ph->env.nr_cpus_online = nr; + return 0; + } + diff --git a/queue-3.14/perf-hists-update-the-column-width-for-the-srcline-sort-key.patch b/queue-3.14/perf-hists-update-the-column-width-for-the-srcline-sort-key.patch new file mode 100644 index 00000000000..84328d21a8a --- /dev/null +++ b/queue-3.14/perf-hists-update-the-column-width-for-the-srcline-sort-key.patch @@ -0,0 +1,42 @@ +From e8e6d37e73e6b950c891c780745460b87f4755b6 Mon Sep 17 00:00:00 2001 +From: Arnaldo Carvalho de Melo +Date: Mon, 10 Aug 2015 16:53:54 -0300 +Subject: perf hists: Update the column width for the "srcline" sort key + +From: Arnaldo Carvalho de Melo + +commit e8e6d37e73e6b950c891c780745460b87f4755b6 upstream. + +When we introduce a new sort key, we need to update the +hists__calc_col_len() function accordingly, otherwise the width +will be limited to strlen(header). + +We can't update it when obtaining a line value for a column (for +instance, in sort__srcline_cmp()), because we reset it all when doing a +resort (see hists__output_recalc_col_len()), so we need to, from what is +in the hist_entry fields, set each of the column widths. + +Cc: Namhyung Kim +Cc: Andi Kleen +Cc: Jiri Olsa +Fixes: 409a8be61560 ("perf tools: Add sort by src line/number") +Link: http://lkml.kernel.org/n/tip-jgbe0yx8v1gs89cslr93pvz2@git.kernel.org +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/util/hist.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/tools/perf/util/hist.c ++++ b/tools/perf/util/hist.c +@@ -160,6 +160,9 @@ void hists__calc_col_len(struct hists *h + hists__new_col_len(hists, HISTC_LOCAL_WEIGHT, 12); + hists__new_col_len(hists, HISTC_GLOBAL_WEIGHT, 12); + ++ if (h->srcline) ++ hists__new_col_len(hists, HISTC_SRCLINE, strlen(h->srcline)); ++ + if (h->transaction) + hists__new_col_len(hists, HISTC_TRANSACTION, + hist_entry__transaction_len()); diff --git a/queue-3.14/perf-stat-get-correct-cpu-id-for-print_aggr.patch b/queue-3.14/perf-stat-get-correct-cpu-id-for-print_aggr.patch new file mode 100644 index 00000000000..9db163d8b4c --- /dev/null +++ b/queue-3.14/perf-stat-get-correct-cpu-id-for-print_aggr.patch @@ -0,0 +1,78 @@ +From 601083cffb7cabdcc55b8195d732f0f7028570fa Mon Sep 17 00:00:00 2001 +From: Kan Liang +Date: Thu, 2 Jul 2015 03:08:43 -0400 +Subject: perf stat: Get correct cpu id for print_aggr + +From: Kan Liang + +commit 601083cffb7cabdcc55b8195d732f0f7028570fa upstream. + +print_aggr() fails to print per-core/per-socket statistics after commit +582ec0829b3d ("perf stat: Fix per-socket output bug for uncore events") +if events have differnt cpus. Because in print_aggr(), aggr_get_id needs +index (not cpu id) to find core/pkg id. Also, evsel cpu maps should be +used to get aggregated id. + +Here is an example: + +Counting events cycles,uncore_imc_0/cas_count_read/. (Uncore event has +cpumask 0,18) + + $ perf stat -e cycles,uncore_imc_0/cas_count_read/ -C0,18 --per-core sleep 2 + +Without this patch, it failes to get CPU 18 result. + + Performance counter stats for 'CPU(s) 0,18': + + S0-C0 1 7526851 cycles + S0-C0 1 1.05 MiB uncore_imc_0/cas_count_read/ + S1-C0 0 cycles + S1-C0 0 MiB uncore_imc_0/cas_count_read/ + +With this patch, it can get both CPU0 and CPU18 result. + + Performance counter stats for 'CPU(s) 0,18': + + S0-C0 1 6327768 cycles + S0-C0 1 0.47 MiB uncore_imc_0/cas_count_read/ + S1-C0 1 330228 cycles + S1-C0 1 0.29 MiB uncore_imc_0/cas_count_read/ + +Signed-off-by: Kan Liang +Acked-by: Jiri Olsa +Acked-by: Stephane Eranian +Cc: Adrian Hunter +Cc: Andi Kleen +Cc: David Ahern +Cc: Namhyung Kim +Cc: Peter Zijlstra +Fixes: 582ec0829b3d ("perf stat: Fix per-socket output bug for uncore events") +Link: http://lkml.kernel.org/r/1435820925-51091-1-git-send-email-kan.liang@intel.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/builtin-stat.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/tools/perf/builtin-stat.c ++++ b/tools/perf/builtin-stat.c +@@ -1108,7 +1108,7 @@ static void abs_printout(int cpu, int nr + static void print_aggr(char *prefix) + { + struct perf_evsel *counter; +- int cpu, cpu2, s, s2, id, nr; ++ int cpu, s, s2, id, nr; + double uval; + u64 ena, run, val; + +@@ -1121,8 +1121,7 @@ static void print_aggr(char *prefix) + val = ena = run = 0; + nr = 0; + for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) { +- cpu2 = perf_evsel__cpus(counter)->map[cpu]; +- s2 = aggr_get_id(evsel_list->cpus, cpu2); ++ s2 = aggr_get_id(perf_evsel__cpus(counter), cpu); + if (s2 != id) + continue; + val += counter->counts->cpu[cpu].val; diff --git a/queue-3.14/perf-tools-fix-copying-of-proc-kcore.patch b/queue-3.14/perf-tools-fix-copying-of-proc-kcore.patch new file mode 100644 index 00000000000..e13b706d61c --- /dev/null +++ b/queue-3.14/perf-tools-fix-copying-of-proc-kcore.patch @@ -0,0 +1,106 @@ +From b5cabbcbd157a4bf5a92dfc85134999a3b55342d Mon Sep 17 00:00:00 2001 +From: Adrian Hunter +Date: Thu, 24 Sep 2015 13:05:22 +0300 +Subject: perf tools: Fix copying of /proc/kcore + +From: Adrian Hunter + +commit b5cabbcbd157a4bf5a92dfc85134999a3b55342d upstream. + +A copy of /proc/kcore containing the kernel text can be made to the +buildid cache. e.g. + + perf buildid-cache -v -k /proc/kcore + +To workaround objdump limitations, a copy is also made when annotating +against /proc/kcore. + +The copying process stops working from libelf about v1.62 onwards (the +problem was found with v1.63). + +The cause is that a call to gelf_getphdr() in kcore__add_phdr() fails +because additional validation has been added to gelf_getphdr(). + +The use of gelf_getphdr() is a misguided attempt to get default +initialization of the Gelf_Phdr structure. That should not be +necessary because every member of the Gelf_Phdr structure is +subsequently assigned. So just remove the call to gelf_getphdr(). + +Similarly, a call to gelf_getehdr() in gelf_kcore__init() can be +removed also. + +Committer notes: + +Note to stable@kernel.org, from Adrian in the cover letter for this +patchkit: + +The "Fix copying of /proc/kcore" problem goes back to v3.13 if you think +it is important enough for stable. + +Signed-off-by: Adrian Hunter +Cc: Jiri Olsa +Link: http://lkml.kernel.org/r/1443089122-19082-3-git-send-email-adrian.hunter@intel.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/util/symbol-elf.c | 33 ++++++++++++--------------------- + 1 file changed, 12 insertions(+), 21 deletions(-) + +--- a/tools/perf/util/symbol-elf.c ++++ b/tools/perf/util/symbol-elf.c +@@ -1100,8 +1100,6 @@ out_close: + static int kcore__init(struct kcore *kcore, char *filename, int elfclass, + bool temp) + { +- GElf_Ehdr *ehdr; +- + kcore->elfclass = elfclass; + + if (temp) +@@ -1118,9 +1116,7 @@ static int kcore__init(struct kcore *kco + if (!gelf_newehdr(kcore->elf, elfclass)) + goto out_end; + +- ehdr = gelf_getehdr(kcore->elf, &kcore->ehdr); +- if (!ehdr) +- goto out_end; ++ memset(&kcore->ehdr, 0, sizeof(GElf_Ehdr)); + + return 0; + +@@ -1177,23 +1173,18 @@ static int kcore__copy_hdr(struct kcore + static int kcore__add_phdr(struct kcore *kcore, int idx, off_t offset, + u64 addr, u64 len) + { +- GElf_Phdr gphdr; +- GElf_Phdr *phdr; +- +- phdr = gelf_getphdr(kcore->elf, idx, &gphdr); +- if (!phdr) +- return -1; +- +- phdr->p_type = PT_LOAD; +- phdr->p_flags = PF_R | PF_W | PF_X; +- phdr->p_offset = offset; +- phdr->p_vaddr = addr; +- phdr->p_paddr = 0; +- phdr->p_filesz = len; +- phdr->p_memsz = len; +- phdr->p_align = page_size; ++ GElf_Phdr phdr = { ++ .p_type = PT_LOAD, ++ .p_flags = PF_R | PF_W | PF_X, ++ .p_offset = offset, ++ .p_vaddr = addr, ++ .p_paddr = 0, ++ .p_filesz = len, ++ .p_memsz = len, ++ .p_align = page_size, ++ }; + +- if (!gelf_update_phdr(kcore->elf, idx, phdr)) ++ if (!gelf_update_phdr(kcore->elf, idx, &phdr)) + return -1; + + return 0; diff --git a/queue-3.14/series b/queue-3.14/series index d59e23c97d0..8bd00995935 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -1,3 +1,12 @@ kvm-fix-zero-length-mmio-searching.patch scsi-fix-scsi_error_handler-vs.-scsi_host_dev_release-race.patch iser-target-remove-command-with-state-istate_remove.patch +perf-tools-fix-copying-of-proc-kcore.patch +perf-hists-update-the-column-width-for-the-srcline-sort-key.patch +perf-stat-get-correct-cpu-id-for-print_aggr.patch +perf-header-fixup-reading-of-header_nrcpus-feature.patch +hwmon-nct6775-swap-step_up_time-and-step_down_time-registers-for-most-chips.patch +arm-fix-thumb2-signal-handling-when-armv6-is-enabled.patch +arm-8429-1-disable-gcc-sra-optimization.patch +windfarm-decrement-client-count-when-unregistering.patch +arm-dts-omap5-uevm.dts-fix-i2c5-pinctrl-offsets.patch diff --git a/queue-3.14/windfarm-decrement-client-count-when-unregistering.patch b/queue-3.14/windfarm-decrement-client-count-when-unregistering.patch new file mode 100644 index 00000000000..1991674c027 --- /dev/null +++ b/queue-3.14/windfarm-decrement-client-count-when-unregistering.patch @@ -0,0 +1,34 @@ +From fe2b592173ff0274e70dc44d1d28c19bb995aa7c Mon Sep 17 00:00:00 2001 +From: Paul Bolle +Date: Fri, 31 Jul 2015 14:08:58 +0200 +Subject: windfarm: decrement client count when unregistering + +From: Paul Bolle + +commit fe2b592173ff0274e70dc44d1d28c19bb995aa7c upstream. + +wf_unregister_client() increments the client count when a client +unregisters. That is obviously incorrect. Decrement that client count +instead. + +Fixes: 75722d3992f5 ("[PATCH] ppc64: Thermal control for SMU based machines") + +Signed-off-by: Paul Bolle +Signed-off-by: Michael Ellerman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/macintosh/windfarm_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/macintosh/windfarm_core.c ++++ b/drivers/macintosh/windfarm_core.c +@@ -435,7 +435,7 @@ int wf_unregister_client(struct notifier + { + mutex_lock(&wf_lock); + blocking_notifier_chain_unregister(&wf_client_list, nb); +- wf_client_count++; ++ wf_client_count--; + if (wf_client_count == 0) + wf_stop_thread(); + mutex_unlock(&wf_lock);