Re: [GIT PULL] perf fix

2020-10-11 Thread pr-tracker-bot
The pull request you sent on Sun, 11 Oct 2020 10:00:15 +0200:

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
> perf-urgent-2020-10-11

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/aa5c3a2911e6d5feaf0c3c7af5bbc652f129d8b2

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html


[GIT PULL] perf fix

2020-10-11 Thread Ingo Molnar
Linus,

Please pull the latest perf/urgent git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-2020-10-11

   # HEAD: 6d6b8b9f4fceab7266ca03d194f60ec72bd4b654 perf: Fix 
task_function_call() error handling

Fix an error handling bug that can cause a lockup if a CPU is offline. (doh ...)

 Thanks,

Ingo

-->
Kajol Jain (1):
  perf: Fix task_function_call() error handling


 kernel/events/core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 7ed5248f0445..e8bf92202542 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -99,7 +99,7 @@ static void remote_function(void *data)
  * retry due to any failures in smp_call_function_single(), such as if the
  * task_cpu() goes offline concurrently.
  *
- * returns @func return value or -ESRCH when the process isn't running
+ * returns @func return value or -ESRCH or -ENXIO when the process isn't 
running
  */
 static int
 task_function_call(struct task_struct *p, remote_function_f func, void *info)
@@ -115,7 +115,8 @@ task_function_call(struct task_struct *p, remote_function_f 
func, void *info)
for (;;) {
ret = smp_call_function_single(task_cpu(p), remote_function,
   , 1);
-   ret = !ret ? data.ret : -EAGAIN;
+   if (!ret)
+   ret = data.ret;
 
if (ret != -EAGAIN)
break;


Re: [GIT PULL] perf fix

2020-06-28 Thread pr-tracker-bot
The pull request you sent on Sun, 28 Jun 2020 20:33:23 +0200:

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
> perf-urgent-2020-06-28

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/ae71d4bf0074a81cc04255c96e3de0a49b1d95fa

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


[GIT PULL] perf fix

2020-06-28 Thread Ingo Molnar
Linus,

Please pull the latest perf/urgent git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-2020-06-28

   # HEAD: 16accae3d97f97d7f61c4ee5d0002bccdef59088 perf/x86/rapl: Fix RAPL 
config variable bug

A single Kbuild dependency fix.

Signed-off-by: Ingo Molnar 
 Thanks,

Ingo

-->
Stephane Eranian (1):
  perf/x86/rapl: Fix RAPL config variable bug


 arch/x86/events/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/Makefile b/arch/x86/events/Makefile
index 12c42eba77ec..9933c0e8e97a 100644
--- a/arch/x86/events/Makefile
+++ b/arch/x86/events/Makefile
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0-only
 obj-y  += core.o probe.o
-obj-$(PERF_EVENTS_INTEL_RAPL)  += rapl.o
+obj-$(CONFIG_PERF_EVENTS_INTEL_RAPL)   += rapl.o
 obj-y  += amd/
 obj-$(CONFIG_X86_LOCAL_APIC)+= msr.o
 obj-$(CONFIG_CPU_SUP_INTEL)+= intel/


Re: [GIT PULL] perf fix

2019-09-12 Thread pr-tracker-bot
The pull request you sent on Thu, 12 Sep 2019 10:39:03 +0200:

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
> perf-urgent-for-linus

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/6dcf6a4eb95a8a78c181cd27132f41aca36aeb94

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


[GIT PULL] perf fix

2019-09-12 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: 310aa0a25b338b3100c94880c9a69bec8ce8c3ae perf/hw_breakpoint: Fix 
arch_hw_breakpoint use-before-initialization

Fix an initialization bug in the hw-breakpoints, which triggered on the 
ARM platform.

 Thanks,

Ingo

-->
Mark-PK Tsai (1):
  perf/hw_breakpoint: Fix arch_hw_breakpoint use-before-initialization


 kernel/events/hw_breakpoint.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/events/hw_breakpoint.c b/kernel/events/hw_breakpoint.c
index c5cd852fe86b..3cc8416ec844 100644
--- a/kernel/events/hw_breakpoint.c
+++ b/kernel/events/hw_breakpoint.c
@@ -413,7 +413,7 @@ static int hw_breakpoint_parse(struct perf_event *bp,
 
 int register_perf_hw_breakpoint(struct perf_event *bp)
 {
-   struct arch_hw_breakpoint hw;
+   struct arch_hw_breakpoint hw = { };
int err;
 
err = reserve_bp_slot(bp);
@@ -461,7 +461,7 @@ int
 modify_user_hw_breakpoint_check(struct perf_event *bp, struct perf_event_attr 
*attr,
bool check)
 {
-   struct arch_hw_breakpoint hw;
+   struct arch_hw_breakpoint hw = { };
int err;
 
err = hw_breakpoint_parse(bp, attr, );


Re: [GIT PULL] perf fix

2019-04-27 Thread pr-tracker-bot
The pull request you sent on Sat, 27 Apr 2019 16:38:18 +0200:

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
> perf-urgent-for-linus

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/5084991663650a238dd9d1981e09eef00a90594c

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


[GIT PULL] perf fix

2019-04-27 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: 82c99f7a81f28f8c1be5f701c8377d14c4075b10 perf/x86/intel: Update KBL 
Package C-state events to also include PC8/PC9/PC10 counters

A cstate event enumeration fix for Kaby/Coffee Lake CPUs.

 Thanks,

Ingo

-->
Harry Pan (1):
  perf/x86/intel: Update KBL Package C-state events to also include 
PC8/PC9/PC10 counters


 arch/x86/events/intel/cstate.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c
index 94a4b7fc75d0..d41de9af7a39 100644
--- a/arch/x86/events/intel/cstate.c
+++ b/arch/x86/events/intel/cstate.c
@@ -76,15 +76,15 @@
  *Scope: Package (physical package)
  * MSR_PKG_C8_RESIDENCY:  Package C8 Residency Counter.
  *perf code: 0x04
- *Available model: HSW ULT,CNL
+ *Available model: HSW ULT,KBL,CNL
  *Scope: Package (physical package)
  * MSR_PKG_C9_RESIDENCY:  Package C9 Residency Counter.
  *perf code: 0x05
- *Available model: HSW ULT,CNL
+ *Available model: HSW ULT,KBL,CNL
  *Scope: Package (physical package)
  * MSR_PKG_C10_RESIDENCY: Package C10 Residency Counter.
  *perf code: 0x06
- *Available model: HSW ULT,GLM,CNL
+ *Available model: HSW ULT,KBL,GLM,CNL
  *Scope: Package (physical package)
  *
  */
@@ -566,8 +566,8 @@ static const struct x86_cpu_id intel_cstates_match[] 
__initconst = {
X86_CSTATES_MODEL(INTEL_FAM6_SKYLAKE_DESKTOP, snb_cstates),
X86_CSTATES_MODEL(INTEL_FAM6_SKYLAKE_X, snb_cstates),
 
-   X86_CSTATES_MODEL(INTEL_FAM6_KABYLAKE_MOBILE,  snb_cstates),
-   X86_CSTATES_MODEL(INTEL_FAM6_KABYLAKE_DESKTOP, snb_cstates),
+   X86_CSTATES_MODEL(INTEL_FAM6_KABYLAKE_MOBILE,  hswult_cstates),
+   X86_CSTATES_MODEL(INTEL_FAM6_KABYLAKE_DESKTOP, hswult_cstates),
 
X86_CSTATES_MODEL(INTEL_FAM6_CANNONLAKE_MOBILE, cnl_cstates),
 


Re: [GIT pull] perf fix for 4.19

2018-09-29 Thread Greg Kroah-Hartman
On Sat, Sep 29, 2018 at 08:25:47PM +0200, Thomas Gleixner wrote:
> Greg,
> 
> please pull the latest perf-urgent-for-linus git tree from:
> 
>git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
> perf-urgent-for-linus

Now pulled, thanks.

greg k-h


Re: [GIT pull] perf fix for 4.19

2018-09-29 Thread Greg Kroah-Hartman
On Sat, Sep 29, 2018 at 08:25:47PM +0200, Thomas Gleixner wrote:
> Greg,
> 
> please pull the latest perf-urgent-for-linus git tree from:
> 
>git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
> perf-urgent-for-linus

Now pulled, thanks.

greg k-h


[GIT pull] perf fix for 4.19

2018-09-29 Thread Thomas Gleixner
Greg,

please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

A single fix for a missing sanity check when a pinned event is tried to be
read on the wrong CPU due to a legit event scheduling failure.

Thanks,

tglx

-->
Reinette Chatre (1):
  perf/core: Add sanity check to deal with pinned event failure


 kernel/events/core.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index c80549bf82c6..dcb093e7b377 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -3935,6 +3935,12 @@ int perf_event_read_local(struct perf_event *event, u64 
*value,
goto out;
}
 
+   /* If this is a pinned event it must be running on this CPU */
+   if (event->attr.pinned && event->oncpu != smp_processor_id()) {
+   ret = -EBUSY;
+   goto out;
+   }
+
/*
 * If the event is currently on this CPU, its either a per-task event,
 * or local to this CPU. Furthermore it means its ACTIVE (otherwise



[GIT pull] perf fix for 4.19

2018-09-29 Thread Thomas Gleixner
Greg,

please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

A single fix for a missing sanity check when a pinned event is tried to be
read on the wrong CPU due to a legit event scheduling failure.

Thanks,

tglx

-->
Reinette Chatre (1):
  perf/core: Add sanity check to deal with pinned event failure


 kernel/events/core.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index c80549bf82c6..dcb093e7b377 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -3935,6 +3935,12 @@ int perf_event_read_local(struct perf_event *event, u64 
*value,
goto out;
}
 
+   /* If this is a pinned event it must be running on this CPU */
+   if (event->attr.pinned && event->oncpu != smp_processor_id()) {
+   ret = -EBUSY;
+   goto out;
+   }
+
/*
 * If the event is currently on this CPU, its either a per-task event,
 * or local to this CPU. Furthermore it means its ACTIVE (otherwise



[GIT pull] perf fix for 4.16

2018-02-25 Thread Thomas Gleixner
Linus,

please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

A single commit which shuts up a bogus GCC-8 warning.

Thanks,

tglx

-->
Arnd Bergmann (1):
  x86/oprofile: Fix bogus GCC-8 warning in nmi_setup()


 arch/x86/oprofile/nmi_int.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 174c59774cc9..a7a7677265b6 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -460,7 +460,7 @@ static int nmi_setup(void)
goto fail;
 
for_each_possible_cpu(cpu) {
-   if (!cpu)
+   if (!IS_ENABLED(CONFIG_SMP) || !cpu)
continue;
 
memcpy(per_cpu(cpu_msrs, cpu).counters,


[GIT pull] perf fix for 4.16

2018-02-25 Thread Thomas Gleixner
Linus,

please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

A single commit which shuts up a bogus GCC-8 warning.

Thanks,

tglx

-->
Arnd Bergmann (1):
  x86/oprofile: Fix bogus GCC-8 warning in nmi_setup()


 arch/x86/oprofile/nmi_int.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 174c59774cc9..a7a7677265b6 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -460,7 +460,7 @@ static int nmi_setup(void)
goto fail;
 
for_each_possible_cpu(cpu) {
-   if (!cpu)
+   if (!IS_ENABLED(CONFIG_SMP) || !cpu)
continue;
 
memcpy(per_cpu(cpu_msrs, cpu).counters,


[GIT PULL] perf fix

2018-01-17 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: 1289e0e29857e606a70a0200bf7849ae38d3493a perf/x86/rapl: Fix Haswell 
and Broadwell server RAPL event

An Intel RAPL events fix.

 Thanks,

Ingo

-->
Kan Liang (1):
  perf/x86/rapl: Fix Haswell and Broadwell server RAPL event


 arch/x86/events/intel/rapl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/events/intel/rapl.c b/arch/x86/events/intel/rapl.c
index 005908ee9333..a2efb490f743 100644
--- a/arch/x86/events/intel/rapl.c
+++ b/arch/x86/events/intel/rapl.c
@@ -755,14 +755,14 @@ static const struct x86_cpu_id rapl_cpu_match[] 
__initconst = {
X86_RAPL_MODEL_MATCH(INTEL_FAM6_IVYBRIDGE_X, snbep_rapl_init),
 
X86_RAPL_MODEL_MATCH(INTEL_FAM6_HASWELL_CORE, hsw_rapl_init),
-   X86_RAPL_MODEL_MATCH(INTEL_FAM6_HASWELL_X,hsw_rapl_init),
+   X86_RAPL_MODEL_MATCH(INTEL_FAM6_HASWELL_X,hsx_rapl_init),
X86_RAPL_MODEL_MATCH(INTEL_FAM6_HASWELL_ULT,  hsw_rapl_init),
X86_RAPL_MODEL_MATCH(INTEL_FAM6_HASWELL_GT3E, hsw_rapl_init),
 
X86_RAPL_MODEL_MATCH(INTEL_FAM6_BROADWELL_CORE,   hsw_rapl_init),
X86_RAPL_MODEL_MATCH(INTEL_FAM6_BROADWELL_GT3E,   hsw_rapl_init),
X86_RAPL_MODEL_MATCH(INTEL_FAM6_BROADWELL_X,  hsx_rapl_init),
-   X86_RAPL_MODEL_MATCH(INTEL_FAM6_BROADWELL_XEON_D, hsw_rapl_init),
+   X86_RAPL_MODEL_MATCH(INTEL_FAM6_BROADWELL_XEON_D, hsx_rapl_init),
 
X86_RAPL_MODEL_MATCH(INTEL_FAM6_XEON_PHI_KNL, knl_rapl_init),
X86_RAPL_MODEL_MATCH(INTEL_FAM6_XEON_PHI_KNM, knl_rapl_init),


[GIT PULL] perf fix

2018-01-17 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: 1289e0e29857e606a70a0200bf7849ae38d3493a perf/x86/rapl: Fix Haswell 
and Broadwell server RAPL event

An Intel RAPL events fix.

 Thanks,

Ingo

-->
Kan Liang (1):
  perf/x86/rapl: Fix Haswell and Broadwell server RAPL event


 arch/x86/events/intel/rapl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/events/intel/rapl.c b/arch/x86/events/intel/rapl.c
index 005908ee9333..a2efb490f743 100644
--- a/arch/x86/events/intel/rapl.c
+++ b/arch/x86/events/intel/rapl.c
@@ -755,14 +755,14 @@ static const struct x86_cpu_id rapl_cpu_match[] 
__initconst = {
X86_RAPL_MODEL_MATCH(INTEL_FAM6_IVYBRIDGE_X, snbep_rapl_init),
 
X86_RAPL_MODEL_MATCH(INTEL_FAM6_HASWELL_CORE, hsw_rapl_init),
-   X86_RAPL_MODEL_MATCH(INTEL_FAM6_HASWELL_X,hsw_rapl_init),
+   X86_RAPL_MODEL_MATCH(INTEL_FAM6_HASWELL_X,hsx_rapl_init),
X86_RAPL_MODEL_MATCH(INTEL_FAM6_HASWELL_ULT,  hsw_rapl_init),
X86_RAPL_MODEL_MATCH(INTEL_FAM6_HASWELL_GT3E, hsw_rapl_init),
 
X86_RAPL_MODEL_MATCH(INTEL_FAM6_BROADWELL_CORE,   hsw_rapl_init),
X86_RAPL_MODEL_MATCH(INTEL_FAM6_BROADWELL_GT3E,   hsw_rapl_init),
X86_RAPL_MODEL_MATCH(INTEL_FAM6_BROADWELL_X,  hsx_rapl_init),
-   X86_RAPL_MODEL_MATCH(INTEL_FAM6_BROADWELL_XEON_D, hsw_rapl_init),
+   X86_RAPL_MODEL_MATCH(INTEL_FAM6_BROADWELL_XEON_D, hsx_rapl_init),
 
X86_RAPL_MODEL_MATCH(INTEL_FAM6_XEON_PHI_KNL, knl_rapl_init),
X86_RAPL_MODEL_MATCH(INTEL_FAM6_XEON_PHI_KNM, knl_rapl_init),


[GIT PULL] perf fix

2017-10-27 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: 2eece390bf68ec8f733d7e4a3ba8a5ea350082ae perf/x86/intel/bts: Fix 
exclusive event reference leak

A fix for a misplaced permission check that can leave perf PT or LBR disabled 
(on 
Intel CPUs) permanently until the next reboot.

 Thanks,

Ingo

-->
Alexander Shishkin (1):
  perf/x86/intel/bts: Fix exclusive event reference leak


 arch/x86/events/intel/bts.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/events/intel/bts.c b/arch/x86/events/intel/bts.c
index 16076eb34699..141e07b06216 100644
--- a/arch/x86/events/intel/bts.c
+++ b/arch/x86/events/intel/bts.c
@@ -546,9 +546,6 @@ static int bts_event_init(struct perf_event *event)
if (event->attr.type != bts_pmu.type)
return -ENOENT;
 
-   if (x86_add_exclusive(x86_lbr_exclusive_bts))
-   return -EBUSY;
-
/*
 * BTS leaks kernel addresses even when CPL0 tracing is
 * disabled, so disallow intel_bts driver for unprivileged
@@ -562,6 +559,9 @@ static int bts_event_init(struct perf_event *event)
!capable(CAP_SYS_ADMIN))
return -EACCES;
 
+   if (x86_add_exclusive(x86_lbr_exclusive_bts))
+   return -EBUSY;
+
ret = x86_reserve_hardware();
if (ret) {
x86_del_exclusive(x86_lbr_exclusive_bts);


[GIT PULL] perf fix

2017-10-27 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: 2eece390bf68ec8f733d7e4a3ba8a5ea350082ae perf/x86/intel/bts: Fix 
exclusive event reference leak

A fix for a misplaced permission check that can leave perf PT or LBR disabled 
(on 
Intel CPUs) permanently until the next reboot.

 Thanks,

Ingo

-->
Alexander Shishkin (1):
  perf/x86/intel/bts: Fix exclusive event reference leak


 arch/x86/events/intel/bts.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/events/intel/bts.c b/arch/x86/events/intel/bts.c
index 16076eb34699..141e07b06216 100644
--- a/arch/x86/events/intel/bts.c
+++ b/arch/x86/events/intel/bts.c
@@ -546,9 +546,6 @@ static int bts_event_init(struct perf_event *event)
if (event->attr.type != bts_pmu.type)
return -ENOENT;
 
-   if (x86_add_exclusive(x86_lbr_exclusive_bts))
-   return -EBUSY;
-
/*
 * BTS leaks kernel addresses even when CPL0 tracing is
 * disabled, so disallow intel_bts driver for unprivileged
@@ -562,6 +559,9 @@ static int bts_event_init(struct perf_event *event)
!capable(CAP_SYS_ADMIN))
return -EACCES;
 
+   if (x86_add_exclusive(x86_lbr_exclusive_bts))
+   return -EBUSY;
+
ret = x86_reserve_hardware();
if (ret) {
x86_del_exclusive(x86_lbr_exclusive_bts);


[GIT PULL] perf fix

2017-08-26 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: 64aee2a965cf2954a038b5522f11d2cd2f0f8f3e perf/core: Fix group 
{cpu,task} validation

A single fix to not allow nonsensical event groups that result in kernel 
warnings.

 Thanks,

Ingo

-->
Mark Rutland (1):
  perf/core: Fix group {cpu,task} validation


 kernel/events/core.c | 39 +++
 1 file changed, 19 insertions(+), 20 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index ee20d4c546b5..3504125871d2 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -10032,28 +10032,27 @@ SYSCALL_DEFINE5(perf_event_open,
goto err_context;
 
/*
-* Do not allow to attach to a group in a different
-* task or CPU context:
+* Make sure we're both events for the same CPU;
+* grouping events for different CPUs is broken; since
+* you can never concurrently schedule them anyhow.
 */
-   if (move_group) {
-   /*
-* Make sure we're both on the same task, or both
-* per-cpu events.
-*/
-   if (group_leader->ctx->task != ctx->task)
-   goto err_context;
+   if (group_leader->cpu != event->cpu)
+   goto err_context;
 
-   /*
-* Make sure we're both events for the same CPU;
-* grouping events for different CPUs is broken; since
-* you can never concurrently schedule them anyhow.
-*/
-   if (group_leader->cpu != event->cpu)
-   goto err_context;
-   } else {
-   if (group_leader->ctx != ctx)
-   goto err_context;
-   }
+   /*
+* Make sure we're both on the same task, or both
+* per-CPU events.
+*/
+   if (group_leader->ctx->task != ctx->task)
+   goto err_context;
+
+   /*
+* Do not allow to attach to a group in a different task
+* or CPU context. If we're moving SW events, we'll fix
+* this up later, so allow that.
+*/
+   if (!move_group && group_leader->ctx != ctx)
+   goto err_context;
 
/*
 * Only a group leader can be exclusive or pinned


[GIT PULL] perf fix

2017-08-26 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: 64aee2a965cf2954a038b5522f11d2cd2f0f8f3e perf/core: Fix group 
{cpu,task} validation

A single fix to not allow nonsensical event groups that result in kernel 
warnings.

 Thanks,

Ingo

-->
Mark Rutland (1):
  perf/core: Fix group {cpu,task} validation


 kernel/events/core.c | 39 +++
 1 file changed, 19 insertions(+), 20 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index ee20d4c546b5..3504125871d2 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -10032,28 +10032,27 @@ SYSCALL_DEFINE5(perf_event_open,
goto err_context;
 
/*
-* Do not allow to attach to a group in a different
-* task or CPU context:
+* Make sure we're both events for the same CPU;
+* grouping events for different CPUs is broken; since
+* you can never concurrently schedule them anyhow.
 */
-   if (move_group) {
-   /*
-* Make sure we're both on the same task, or both
-* per-cpu events.
-*/
-   if (group_leader->ctx->task != ctx->task)
-   goto err_context;
+   if (group_leader->cpu != event->cpu)
+   goto err_context;
 
-   /*
-* Make sure we're both events for the same CPU;
-* grouping events for different CPUs is broken; since
-* you can never concurrently schedule them anyhow.
-*/
-   if (group_leader->cpu != event->cpu)
-   goto err_context;
-   } else {
-   if (group_leader->ctx != ctx)
-   goto err_context;
-   }
+   /*
+* Make sure we're both on the same task, or both
+* per-CPU events.
+*/
+   if (group_leader->ctx->task != ctx->task)
+   goto err_context;
+
+   /*
+* Do not allow to attach to a group in a different task
+* or CPU context. If we're moving SW events, we'll fix
+* this up later, so allow that.
+*/
+   if (!move_group && group_leader->ctx != ctx)
+   goto err_context;
 
/*
 * Only a group leader can be exclusive or pinned


[GIT PULL] perf fix

2016-07-13 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: eb019503569c8c701f1e9c70e848d99c6680839b perf/x86: Fix bogus kernel 
printk, again

A single printk message fix.

 Thanks,

Ingo

-->
Vegard Nossum (1):
  perf/x86: Fix bogus kernel printk, again


 arch/x86/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
index 26ced536005a..91eac39625be 100644
--- a/arch/x86/events/core.c
+++ b/arch/x86/events/core.c
@@ -263,7 +263,7 @@ static bool check_hw_exists(void)
 
 msr_fail:
pr_cont("Broken PMU hardware detected, using software events only.\n");
-   pr_info("%sFailed to access perfctr msr (MSR %x is %Lx)\n",
+   printk("%sFailed to access perfctr msr (MSR %x is %Lx)\n",
boot_cpu_has(X86_FEATURE_HYPERVISOR) ? KERN_INFO : KERN_ERR,
reg, val_new);
 


[GIT PULL] perf fix

2016-07-13 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: eb019503569c8c701f1e9c70e848d99c6680839b perf/x86: Fix bogus kernel 
printk, again

A single printk message fix.

 Thanks,

Ingo

-->
Vegard Nossum (1):
  perf/x86: Fix bogus kernel printk, again


 arch/x86/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
index 26ced536005a..91eac39625be 100644
--- a/arch/x86/events/core.c
+++ b/arch/x86/events/core.c
@@ -263,7 +263,7 @@ static bool check_hw_exists(void)
 
 msr_fail:
pr_cont("Broken PMU hardware detected, using software events only.\n");
-   pr_info("%sFailed to access perfctr msr (MSR %x is %Lx)\n",
+   printk("%sFailed to access perfctr msr (MSR %x is %Lx)\n",
boot_cpu_has(X86_FEATURE_HYPERVISOR) ? KERN_INFO : KERN_ERR,
reg, val_new);
 


[GIT pull] perf fix for 4.7

2016-06-25 Thread Thomas Gleixner
Linus,

please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

A single fix clearing the TF bit when a fault is single stepped.

Thanks,

tglx

-->
Masami Hiramatsu (1):
  kprobes/x86: Clear TF bit in fault on single-stepping


 arch/x86/kernel/kprobes/core.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index 38cf7a741250..7847e5c0e0b5 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -961,7 +961,19 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
 * normal page fault.
 */
regs->ip = (unsigned long)cur->addr;
+   /*
+* Trap flag (TF) has been set here because this fault
+* happened where the single stepping will be done.
+* So clear it by resetting the current kprobe:
+*/
+   regs->flags &= ~X86_EFLAGS_TF;
+
+   /*
+* If the TF flag was set before the kprobe hit,
+* don't touch it:
+*/
regs->flags |= kcb->kprobe_old_flags;
+
if (kcb->kprobe_status == KPROBE_REENTER)
restore_previous_kprobe(kcb);
else


[GIT pull] perf fix for 4.7

2016-06-25 Thread Thomas Gleixner
Linus,

please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

A single fix clearing the TF bit when a fault is single stepped.

Thanks,

tglx

-->
Masami Hiramatsu (1):
  kprobes/x86: Clear TF bit in fault on single-stepping


 arch/x86/kernel/kprobes/core.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index 38cf7a741250..7847e5c0e0b5 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -961,7 +961,19 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
 * normal page fault.
 */
regs->ip = (unsigned long)cur->addr;
+   /*
+* Trap flag (TF) has been set here because this fault
+* happened where the single stepping will be done.
+* So clear it by resetting the current kprobe:
+*/
+   regs->flags &= ~X86_EFLAGS_TF;
+
+   /*
+* If the TF flag was set before the kprobe hit,
+* don't touch it:
+*/
regs->flags |= kcb->kprobe_old_flags;
+
if (kcb->kprobe_status == KPROBE_REENTER)
restore_previous_kprobe(kcb);
else


[GIT PULL] perf fix

2016-05-10 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: 93193230f7b8bd484d1749f4044d1214d521c804 perf/core: Change the 
default paranoia level to 2

Bump up the default perf paranoia level to 2 because otherwise perf can be used 
by 
local users to defeat KASLR, amongst other things.

 Thanks,

Ingo

-->
Andy Lutomirski (1):
  perf/core: Change the default paranoia level to 2


 Documentation/sysctl/kernel.txt | 2 +-
 kernel/events/core.c| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index 57653a44b128..fcddfd5ded99 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -645,7 +645,7 @@ allowed to execute.
 perf_event_paranoid:
 
 Controls use of the performance events system by unprivileged
-users (without CAP_SYS_ADMIN).  The default value is 1.
+users (without CAP_SYS_ADMIN).  The default value is 2.
 
  -1: Allow use of (almost) all events by all users
 >=0: Disallow raw tracepoint access by users without CAP_IOC_LOCK
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 4e2ebf6f2f1f..c0ded2416615 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -351,7 +351,7 @@ static struct srcu_struct pmus_srcu;
  *   1 - disallow cpu events for unpriv
  *   2 - disallow kernel profiling for unpriv
  */
-int sysctl_perf_event_paranoid __read_mostly = 1;
+int sysctl_perf_event_paranoid __read_mostly = 2;
 
 /* Minimum for 512 kiB + 1 user control page */
 int sysctl_perf_event_mlock __read_mostly = 512 + (PAGE_SIZE / 1024); /* 
'free' kiB per user */


[GIT PULL] perf fix

2016-05-10 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: 93193230f7b8bd484d1749f4044d1214d521c804 perf/core: Change the 
default paranoia level to 2

Bump up the default perf paranoia level to 2 because otherwise perf can be used 
by 
local users to defeat KASLR, amongst other things.

 Thanks,

Ingo

-->
Andy Lutomirski (1):
  perf/core: Change the default paranoia level to 2


 Documentation/sysctl/kernel.txt | 2 +-
 kernel/events/core.c| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index 57653a44b128..fcddfd5ded99 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -645,7 +645,7 @@ allowed to execute.
 perf_event_paranoid:
 
 Controls use of the performance events system by unprivileged
-users (without CAP_SYS_ADMIN).  The default value is 1.
+users (without CAP_SYS_ADMIN).  The default value is 2.
 
  -1: Allow use of (almost) all events by all users
 >=0: Disallow raw tracepoint access by users without CAP_IOC_LOCK
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 4e2ebf6f2f1f..c0ded2416615 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -351,7 +351,7 @@ static struct srcu_struct pmus_srcu;
  *   1 - disallow cpu events for unpriv
  *   2 - disallow kernel profiling for unpriv
  */
-int sysctl_perf_event_paranoid __read_mostly = 1;
+int sysctl_perf_event_paranoid __read_mostly = 2;
 
 /* Minimum for 512 kiB + 1 user control page */
 int sysctl_perf_event_mlock __read_mostly = 512 + (PAGE_SIZE / 1024); /* 
'free' kiB per user */


[GIT PULL] perf fix

2016-04-23 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: a19cad6d66823ddd54b0e7c88d7bddd307cb1161 Merge tag 
'perf-urgent-for-mingo-20160418' of 
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent

A single tooling fix for a user-triggerable segfault.

 Thanks,

Ingo

-->
Adrian Hunter (1):
  perf intel-pt: Fix segfault tracing transactions


 tools/perf/util/intel-pt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index 407f11b97c8d..617578440989 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -1130,7 +1130,7 @@ static int intel_pt_synth_transaction_sample(struct 
intel_pt_queue *ptq)
pr_err("Intel Processor Trace: failed to deliver transaction 
event, error %d\n",
   ret);
 
-   if (pt->synth_opts.callchain)
+   if (pt->synth_opts.last_branch)
intel_pt_reset_last_branch_rb(ptq);
 
return ret;


[GIT PULL] perf fix

2016-04-23 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: a19cad6d66823ddd54b0e7c88d7bddd307cb1161 Merge tag 
'perf-urgent-for-mingo-20160418' of 
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent

A single tooling fix for a user-triggerable segfault.

 Thanks,

Ingo

-->
Adrian Hunter (1):
  perf intel-pt: Fix segfault tracing transactions


 tools/perf/util/intel-pt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index 407f11b97c8d..617578440989 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -1130,7 +1130,7 @@ static int intel_pt_synth_transaction_sample(struct 
intel_pt_queue *ptq)
pr_err("Intel Processor Trace: failed to deliver transaction 
event, error %d\n",
   ret);
 
-   if (pt->synth_opts.callchain)
+   if (pt->synth_opts.last_branch)
intel_pt_reset_last_branch_rb(ptq);
 
return ret;


[GIT PULL] perf fix

2015-03-28 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: d525211f9d1be8b523ec7633f080f2116f5ea536 perf: Fix irq_work 'tail' 
recursion

A perf kernel side fix for a fuzzer triggered lockup.

 Thanks,

Ingo

-->
Peter Zijlstra (1):
  perf: Fix irq_work 'tail' recursion


 kernel/events/core.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 453ef61311d4..2fabc0627165 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -4574,6 +4574,13 @@ static void perf_pending_event(struct irq_work *entry)
 {
struct perf_event *event = container_of(entry,
struct perf_event, pending);
+   int rctx;
+
+   rctx = perf_swevent_get_recursion_context();
+   /*
+* If we 'fail' here, that's OK, it means recursion is already disabled
+* and we won't recurse 'further'.
+*/
 
if (event->pending_disable) {
event->pending_disable = 0;
@@ -4584,6 +4591,9 @@ static void perf_pending_event(struct irq_work *entry)
event->pending_wakeup = 0;
perf_event_wakeup(event);
}
+
+   if (rctx >= 0)
+   perf_swevent_put_recursion_context(rctx);
 }
 
 /*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] perf fix

2015-03-28 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: d525211f9d1be8b523ec7633f080f2116f5ea536 perf: Fix irq_work 'tail' 
recursion

A perf kernel side fix for a fuzzer triggered lockup.

 Thanks,

Ingo

--
Peter Zijlstra (1):
  perf: Fix irq_work 'tail' recursion


 kernel/events/core.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 453ef61311d4..2fabc0627165 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -4574,6 +4574,13 @@ static void perf_pending_event(struct irq_work *entry)
 {
struct perf_event *event = container_of(entry,
struct perf_event, pending);
+   int rctx;
+
+   rctx = perf_swevent_get_recursion_context();
+   /*
+* If we 'fail' here, that's OK, it means recursion is already disabled
+* and we won't recurse 'further'.
+*/
 
if (event-pending_disable) {
event-pending_disable = 0;
@@ -4584,6 +4591,9 @@ static void perf_pending_event(struct irq_work *entry)
event-pending_wakeup = 0;
perf_event_wakeup(event);
}
+
+   if (rctx = 0)
+   perf_swevent_put_recursion_context(rctx);
 }
 
 /*
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] perf fix

2013-12-17 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: cf30d52e2d11523c42048ab89ed4215b5021526a perf/x86: Fix constraint 
table end marker bug

An x86/intel event constraint fix.

 Thanks,

Ingo

-->
Maria Dimakopoulou (1):
  perf/x86: Fix constraint table end marker bug


 arch/x86/kernel/cpu/perf_event.h | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h
index fd00bb2..c1a8618 100644
--- a/arch/x86/kernel/cpu/perf_event.h
+++ b/arch/x86/kernel/cpu/perf_event.h
@@ -262,11 +262,20 @@ struct cpu_hw_events {
__EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVENT_MASK, \
  HWEIGHT(n), 0, PERF_X86_EVENT_PEBS_ST_HSW)
 
-#define EVENT_CONSTRAINT_END   \
-   EVENT_CONSTRAINT(0, 0, 0)
+/*
+ * We define the end marker as having a weight of -1
+ * to enable blacklisting of events using a counter bitmask
+ * of zero and thus a weight of zero.
+ * The end marker has a weight that cannot possibly be
+ * obtained from counting the bits in the bitmask.
+ */
+#define EVENT_CONSTRAINT_END { .weight = -1 }
 
+/*
+ * Check for end marker with weight == -1
+ */
 #define for_each_event_constraint(e, c)\
-   for ((e) = (c); (e)->weight; (e)++)
+   for ((e) = (c); (e)->weight != -1; (e)++)
 
 /*
  * Extra registers for specific events.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] perf fix

2013-12-17 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   # HEAD: cf30d52e2d11523c42048ab89ed4215b5021526a perf/x86: Fix constraint 
table end marker bug

An x86/intel event constraint fix.

 Thanks,

Ingo

--
Maria Dimakopoulou (1):
  perf/x86: Fix constraint table end marker bug


 arch/x86/kernel/cpu/perf_event.h | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h
index fd00bb2..c1a8618 100644
--- a/arch/x86/kernel/cpu/perf_event.h
+++ b/arch/x86/kernel/cpu/perf_event.h
@@ -262,11 +262,20 @@ struct cpu_hw_events {
__EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVENT_MASK, \
  HWEIGHT(n), 0, PERF_X86_EVENT_PEBS_ST_HSW)
 
-#define EVENT_CONSTRAINT_END   \
-   EVENT_CONSTRAINT(0, 0, 0)
+/*
+ * We define the end marker as having a weight of -1
+ * to enable blacklisting of events using a counter bitmask
+ * of zero and thus a weight of zero.
+ * The end marker has a weight that cannot possibly be
+ * obtained from counting the bits in the bitmask.
+ */
+#define EVENT_CONSTRAINT_END { .weight = -1 }
 
+/*
+ * Check for end marker with weight == -1
+ */
 #define for_each_event_constraint(e, c)\
-   for ((e) = (c); (e)-weight; (e)++)
+   for ((e) = (c); (e)-weight != -1; (e)++)
 
 /*
  * Extra registers for specific events.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] perf fix

2013-09-29 Thread Ingo Molnar

* Markus Trippelsdorf  wrote:

> On 2013.09.28 at 20:03 +0200, Ingo Molnar wrote:
> > Andi Kleen (1):
> >   perf symbols: Demangle cloned functions
> 
> The commit above e95ab53645:
> 
>  commit de95ab53645a2f0015e0f68ee723f18dce2b8b51
>  Author: Andi Kleen 
>  Date:   Thu Sep 12 08:16:38 2013 -0700
> 
>  perf symbols: Demangle cloned functions
> 
> breaks "perf top" on my machine. I just see a gray screen with no text
> at all. Sometimes the following error messages are printed:
>  *** Error in `perf': invalid fastbin entry (free): 0x029b18c0 ***
>  *** Error in `perf': malloc(): memory corruption (fast): 0x00ee0b10 
> ***
> 
> Reverting the commit "fixes" the issue.

Sorry about that.

Looking at the commit it fails on several quality levels:

 - sloppy structure: the code is unreadable, it should have been a 
 separate helper function

 - sloppy flow:  why the heck does it do strchr() twice? Not to 
 mention the fragile way of how the new flow tries 
 to merge with the old instead of cleanly separating.

 - sloppy types: it casts a const char * over into char *

 - sloppy style: variable block not separated from statements, 
 meaningless temporary variable names, etc. etc.

 - and it's not even a regression fix to begin with!

So the right resolution is a revert. Andi, please send a fixed patch with 
all of these issues and the crash fixed.

Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   HEAD: 14951f22f1cc8375ead345d2ca08455e91f2152b Revert "perf symbols: 
Demangle cloned functions"

It fixes the 'perf top' regression Markus Trippelsdorf reported.

 Thanks,

Ingo

-->
Ingo Molnar (1):
  Revert "perf symbols: Demangle cloned functions"


 tools/perf/util/symbol-elf.c | 27 +--
 1 file changed, 1 insertion(+), 26 deletions(-)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index d2a888e..a9c829b 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -928,33 +928,8 @@ int dso__load_sym(struct dso *dso, struct map *map,
 * to it...
 */
if (symbol_conf.demangle) {
-   /*
-* The demangler doesn't deal with cloned functions.
-* .clone.NUM or similar
-* Strip the dot part and readd it later.
-*/
-   char *p = (char *)elf_name, *dot;
-   dot = strchr(elf_name, '.');
-   if (dot) {
-   p = strdup(elf_name);
-   if (!p)
-   goto new_symbol;
-   dot = strchr(p, '.');
-   *dot = 0;
-   }
-
-   demangled = bfd_demangle(NULL, p,
+   demangled = bfd_demangle(NULL, elf_name,
 DMGL_PARAMS | DMGL_ANSI);
-   if (dot)
-   *dot = '.';
-   if (demangled && dot) {
-   demangled = realloc(demangled, 
strlen(demangled) + strlen(dot) + 1);
-   if (!demangled)
-   goto new_symbol;
-   strcpy(demangled + (dot - p), dot);
-   }
-   if (p != elf_name)
-   free(p);
if (demangled != NULL)
elf_name = demangled;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] perf fix

2013-09-29 Thread Ingo Molnar

* Markus Trippelsdorf mar...@trippelsdorf.de wrote:

 On 2013.09.28 at 20:03 +0200, Ingo Molnar wrote:
  Andi Kleen (1):
perf symbols: Demangle cloned functions
 
 The commit above e95ab53645:
 
  commit de95ab53645a2f0015e0f68ee723f18dce2b8b51
  Author: Andi Kleen a...@linux.intel.com
  Date:   Thu Sep 12 08:16:38 2013 -0700
 
  perf symbols: Demangle cloned functions
 
 breaks perf top on my machine. I just see a gray screen with no text
 at all. Sometimes the following error messages are printed:
  *** Error in `perf': invalid fastbin entry (free): 0x029b18c0 ***
  *** Error in `perf': malloc(): memory corruption (fast): 0x00ee0b10 
 ***
 
 Reverting the commit fixes the issue.

Sorry about that.

Looking at the commit it fails on several quality levels:

 - sloppy structure: the code is unreadable, it should have been a 
 separate helper function

 - sloppy flow:  why the heck does it do strchr() twice? Not to 
 mention the fragile way of how the new flow tries 
 to merge with the old instead of cleanly separating.

 - sloppy types: it casts a const char * over into char *

 - sloppy style: variable block not separated from statements, 
 meaningless temporary variable names, etc. etc.

 - and it's not even a regression fix to begin with!

So the right resolution is a revert. Andi, please send a fixed patch with 
all of these issues and the crash fixed.

Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   HEAD: 14951f22f1cc8375ead345d2ca08455e91f2152b Revert perf symbols: 
Demangle cloned functions

It fixes the 'perf top' regression Markus Trippelsdorf reported.

 Thanks,

Ingo

--
Ingo Molnar (1):
  Revert perf symbols: Demangle cloned functions


 tools/perf/util/symbol-elf.c | 27 +--
 1 file changed, 1 insertion(+), 26 deletions(-)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index d2a888e..a9c829b 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -928,33 +928,8 @@ int dso__load_sym(struct dso *dso, struct map *map,
 * to it...
 */
if (symbol_conf.demangle) {
-   /*
-* The demangler doesn't deal with cloned functions.
-* .clone.NUM or similar
-* Strip the dot part and readd it later.
-*/
-   char *p = (char *)elf_name, *dot;
-   dot = strchr(elf_name, '.');
-   if (dot) {
-   p = strdup(elf_name);
-   if (!p)
-   goto new_symbol;
-   dot = strchr(p, '.');
-   *dot = 0;
-   }
-
-   demangled = bfd_demangle(NULL, p,
+   demangled = bfd_demangle(NULL, elf_name,
 DMGL_PARAMS | DMGL_ANSI);
-   if (dot)
-   *dot = '.';
-   if (demangled  dot) {
-   demangled = realloc(demangled, 
strlen(demangled) + strlen(dot) + 1);
-   if (!demangled)
-   goto new_symbol;
-   strcpy(demangled + (dot - p), dot);
-   }
-   if (p != elf_name)
-   free(p);
if (demangled != NULL)
elf_name = demangled;
}
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] perf fix

2013-09-03 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   HEAD: ae23bff1d71f8b416ed740bc458df67355c77c92 perf: Prevent race in 
unthrottling code

This is a leftover fix from the v3.11 cycle.

 Thanks,

Ingo

-->
Jiri Olsa (1):
  perf: Prevent race in unthrottling code


 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index f86599e..258eaaf 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -2712,7 +2712,7 @@ static void perf_adjust_freq_unthr_context(struct 
perf_event_context *ctx,
 
hwc = >hw;
 
-   if (needs_unthr && hwc->interrupts == MAX_INTERRUPTS) {
+   if (hwc->interrupts == MAX_INTERRUPTS) {
hwc->interrupts = 0;
perf_log_throttle(event, 1);
event->pmu->start(event, 0);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] perf fix

2013-09-03 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   HEAD: ae23bff1d71f8b416ed740bc458df67355c77c92 perf: Prevent race in 
unthrottling code

This is a leftover fix from the v3.11 cycle.

 Thanks,

Ingo

--
Jiri Olsa (1):
  perf: Prevent race in unthrottling code


 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index f86599e..258eaaf 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -2712,7 +2712,7 @@ static void perf_adjust_freq_unthr_context(struct 
perf_event_context *ctx,
 
hwc = event-hw;
 
-   if (needs_unthr  hwc-interrupts == MAX_INTERRUPTS) {
+   if (hwc-interrupts == MAX_INTERRUPTS) {
hwc-interrupts = 0;
perf_log_throttle(event, 1);
event-pmu-start(event, 0);
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] perf fix

2013-06-27 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   HEAD: 2976b10f05bd7f6dab9f9e7524451ddfed656a89 perf: Disable monitoring on 
setuid processes for regular users

One more fix for a recently discovered bug.

 Thanks,

Ingo

-->
Stephane Eranian (1):
  perf: Disable monitoring on setuid processes for regular users


 fs/exec.c | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index 6430195..ffd7a81 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1135,13 +1135,6 @@ void setup_new_exec(struct linux_binprm * bprm)
set_dumpable(current->mm, suid_dumpable);
}
 
-   /*
-* Flush performance counters when crossing a
-* security domain:
-*/
-   if (!get_dumpable(current->mm))
-   perf_event_exit_task(current);
-
/* An exec changes our domain. We are no longer part of the thread
   group */
 
@@ -1205,6 +1198,15 @@ void install_exec_creds(struct linux_binprm *bprm)
 
commit_creds(bprm->cred);
bprm->cred = NULL;
+
+   /*
+* Disable monitoring for regular users
+* when executing setuid binaries. Must
+* wait until new credentials are committed
+* by commit_creds() above
+*/
+   if (get_dumpable(current->mm) != SUID_DUMP_USER)
+   perf_event_exit_task(current);
/*
 * cred_guard_mutex must be held at least to this point to prevent
 * ptrace_attach() from altering our determination of the task's
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] perf fix

2013-06-27 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   HEAD: 2976b10f05bd7f6dab9f9e7524451ddfed656a89 perf: Disable monitoring on 
setuid processes for regular users

One more fix for a recently discovered bug.

 Thanks,

Ingo

--
Stephane Eranian (1):
  perf: Disable monitoring on setuid processes for regular users


 fs/exec.c | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index 6430195..ffd7a81 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1135,13 +1135,6 @@ void setup_new_exec(struct linux_binprm * bprm)
set_dumpable(current-mm, suid_dumpable);
}
 
-   /*
-* Flush performance counters when crossing a
-* security domain:
-*/
-   if (!get_dumpable(current-mm))
-   perf_event_exit_task(current);
-
/* An exec changes our domain. We are no longer part of the thread
   group */
 
@@ -1205,6 +1198,15 @@ void install_exec_creds(struct linux_binprm *bprm)
 
commit_creds(bprm-cred);
bprm-cred = NULL;
+
+   /*
+* Disable monitoring for regular users
+* when executing setuid binaries. Must
+* wait until new credentials are committed
+* by commit_creds() above
+*/
+   if (get_dumpable(current-mm) != SUID_DUMP_USER)
+   perf_event_exit_task(current);
/*
 * cred_guard_mutex must be held at least to this point to prevent
 * ptrace_attach() from altering our determination of the task's
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] perf fix

2013-04-27 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   HEAD: c79aa0d96548aee50570209eb2d45c8f4ac49230 events: Protect access via 
task_subsys_state_check()

This fix adds missing RCU read protection.

 Thanks,

Ingo

-->
Paul E. McKenney (1):
  events: Protect access via task_subsys_state_check()


 kernel/events/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 4d3124b..9fcb094 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -4596,6 +4596,7 @@ void perf_event_comm(struct task_struct *task)
struct perf_event_context *ctx;
int ctxn;
 
+   rcu_read_lock();
for_each_task_context_nr(ctxn) {
ctx = task->perf_event_ctxp[ctxn];
if (!ctx)
@@ -4603,6 +4604,7 @@ void perf_event_comm(struct task_struct *task)
 
perf_event_enable_on_exec(ctx);
}
+   rcu_read_unlock();
 
if (!atomic_read(_comm_events))
return;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] perf fix

2013-04-27 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   HEAD: c79aa0d96548aee50570209eb2d45c8f4ac49230 events: Protect access via 
task_subsys_state_check()

This fix adds missing RCU read protection.

 Thanks,

Ingo

--
Paul E. McKenney (1):
  events: Protect access via task_subsys_state_check()


 kernel/events/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 4d3124b..9fcb094 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -4596,6 +4596,7 @@ void perf_event_comm(struct task_struct *task)
struct perf_event_context *ctx;
int ctxn;
 
+   rcu_read_lock();
for_each_task_context_nr(ctxn) {
ctx = task-perf_event_ctxp[ctxn];
if (!ctx)
@@ -4603,6 +4604,7 @@ void perf_event_comm(struct task_struct *task)
 
perf_event_enable_on_exec(ctx);
}
+   rcu_read_unlock();
 
if (!atomic_read(nr_comm_events))
return;
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT PULL] perf fix for v3.9

2013-02-20 Thread Arnaldo Carvalho de Melo
Em Wed, Feb 20, 2013 at 10:17:58AM +0100, Ingo Molnar escreveu:
> * Linus Torvalds  wrote:
> > On Tue, Feb 19, 2013 at 6:16 AM, Ingo Molnar  wrote:
> > > Please pull the latest perf-urgent-for-linus git tree from:

> > >git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
> > > perf-urgent-for-linus
> > >HEAD: e97cbe3edf7d88aad4c21dd3de124d9f9d039881 perf/hwbp: Fix cleanup 
> > > in case of kzalloc() failure

> > > Leftover fix from the v3.8 cycle.

> > This was already in the other (big) perf pull, as commit
> > 02e176af92f3

> Oops, sorry - Arnaldo picked up the fix too and I never noticed the
> overlap.

Yeah, I need to have a perf/kcore, for kernel bits that are not tied to
userspace ones.

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT PULL] perf fix for v3.9

2013-02-20 Thread Ingo Molnar

* Linus Torvalds  wrote:

> On Tue, Feb 19, 2013 at 6:16 AM, Ingo Molnar  wrote:
> >
> > Please pull the latest perf-urgent-for-linus git tree from:
> >
> >git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
> > perf-urgent-for-linus
> >
> >HEAD: e97cbe3edf7d88aad4c21dd3de124d9f9d039881 perf/hwbp: Fix cleanup in 
> > case of kzalloc() failure
> >
> > Leftover fix from the v3.8 cycle.
> 
> This was already in the other (big) perf pull, as commit 
> 02e176af92f3

Oops, sorry - Arnaldo picked up the fix too and I never noticed 
the overlap.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT PULL] perf fix for v3.9

2013-02-20 Thread Ingo Molnar

* Linus Torvalds torva...@linux-foundation.org wrote:

 On Tue, Feb 19, 2013 at 6:16 AM, Ingo Molnar mi...@kernel.org wrote:
 
  Please pull the latest perf-urgent-for-linus git tree from:
 
 git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
  perf-urgent-for-linus
 
 HEAD: e97cbe3edf7d88aad4c21dd3de124d9f9d039881 perf/hwbp: Fix cleanup in 
  case of kzalloc() failure
 
  Leftover fix from the v3.8 cycle.
 
 This was already in the other (big) perf pull, as commit 
 02e176af92f3

Oops, sorry - Arnaldo picked up the fix too and I never noticed 
the overlap.

Thanks,

Ingo
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT PULL] perf fix for v3.9

2013-02-20 Thread Arnaldo Carvalho de Melo
Em Wed, Feb 20, 2013 at 10:17:58AM +0100, Ingo Molnar escreveu:
 * Linus Torvalds torva...@linux-foundation.org wrote:
  On Tue, Feb 19, 2013 at 6:16 AM, Ingo Molnar mi...@kernel.org wrote:
   Please pull the latest perf-urgent-for-linus git tree from:

  git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
   perf-urgent-for-linus
  HEAD: e97cbe3edf7d88aad4c21dd3de124d9f9d039881 perf/hwbp: Fix cleanup 
   in case of kzalloc() failure

   Leftover fix from the v3.8 cycle.

  This was already in the other (big) perf pull, as commit
  02e176af92f3

 Oops, sorry - Arnaldo picked up the fix too and I never noticed the
 overlap.

Yeah, I need to have a perf/kcore, for kernel bits that are not tied to
userspace ones.

- Arnaldo
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT PULL] perf fix for v3.9

2013-02-19 Thread Linus Torvalds
On Tue, Feb 19, 2013 at 6:16 AM, Ingo Molnar  wrote:
>
> Please pull the latest perf-urgent-for-linus git tree from:
>
>git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
> perf-urgent-for-linus
>
>HEAD: e97cbe3edf7d88aad4c21dd3de124d9f9d039881 perf/hwbp: Fix cleanup in 
> case of kzalloc() failure
>
> Leftover fix from the v3.8 cycle.

This was already in the other (big) perf pull, as commit 02e176af92f3

 Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] perf fix for v3.9

2013-02-19 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   HEAD: e97cbe3edf7d88aad4c21dd3de124d9f9d039881 perf/hwbp: Fix cleanup in 
case of kzalloc() failure

Leftover fix from the v3.8 cycle.

 Thanks,

Ingo

-->
Daniel Baluta (1):
  perf/hwbp: Fix cleanup in case of kzalloc() failure


 kernel/events/hw_breakpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/hw_breakpoint.c b/kernel/events/hw_breakpoint.c
index fe8a916..a64f8ae 100644
--- a/kernel/events/hw_breakpoint.c
+++ b/kernel/events/hw_breakpoint.c
@@ -676,7 +676,7 @@ int __init init_hw_breakpoint(void)
  err_alloc:
for_each_possible_cpu(err_cpu) {
for (i = 0; i < TYPE_MAX; i++)
-   kfree(per_cpu(nr_task_bp_pinned[i], cpu));
+   kfree(per_cpu(nr_task_bp_pinned[i], err_cpu));
if (err_cpu == cpu)
break;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] perf fix for v3.9

2013-02-19 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   HEAD: e97cbe3edf7d88aad4c21dd3de124d9f9d039881 perf/hwbp: Fix cleanup in 
case of kzalloc() failure

Leftover fix from the v3.8 cycle.

 Thanks,

Ingo

--
Daniel Baluta (1):
  perf/hwbp: Fix cleanup in case of kzalloc() failure


 kernel/events/hw_breakpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/hw_breakpoint.c b/kernel/events/hw_breakpoint.c
index fe8a916..a64f8ae 100644
--- a/kernel/events/hw_breakpoint.c
+++ b/kernel/events/hw_breakpoint.c
@@ -676,7 +676,7 @@ int __init init_hw_breakpoint(void)
  err_alloc:
for_each_possible_cpu(err_cpu) {
for (i = 0; i  TYPE_MAX; i++)
-   kfree(per_cpu(nr_task_bp_pinned[i], cpu));
+   kfree(per_cpu(nr_task_bp_pinned[i], err_cpu));
if (err_cpu == cpu)
break;
}
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT PULL] perf fix for v3.9

2013-02-19 Thread Linus Torvalds
On Tue, Feb 19, 2013 at 6:16 AM, Ingo Molnar mi...@kernel.org wrote:

 Please pull the latest perf-urgent-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
 perf-urgent-for-linus

HEAD: e97cbe3edf7d88aad4c21dd3de124d9f9d039881 perf/hwbp: Fix cleanup in 
 case of kzalloc() failure

 Leftover fix from the v3.8 cycle.

This was already in the other (big) perf pull, as commit 02e176af92f3

 Linus
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] perf fix for v3.7

2012-10-01 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   HEAD: 402537fd9f5499d1a50a6f20cdd9031d24ee2e47 perf/x86: Fix typo in 
uncore_pmu_to_box

Leftover perf/urgent fix from the v3.6 cycle.

 Thanks,

Ingo

-->
Yan, Zheng (1):
  perf/x86: Fix typo in uncore_pmu_to_box


 arch/x86/kernel/cpu/perf_event_intel_uncore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c 
b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
index 38e4894..c7c55e7 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
@@ -1950,7 +1950,7 @@ struct intel_uncore_box *uncore_alloc_box(struct 
intel_uncore_type *type, int cp
 static struct intel_uncore_box *
 uncore_pmu_to_box(struct intel_uncore_pmu *pmu, int cpu)
 {
-   static struct intel_uncore_box *box;
+   struct intel_uncore_box *box;
 
box = *per_cpu_ptr(pmu->box, cpu);
if (box)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] perf fix for v3.7

2012-10-01 Thread Ingo Molnar
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
perf-urgent-for-linus

   HEAD: 402537fd9f5499d1a50a6f20cdd9031d24ee2e47 perf/x86: Fix typo in 
uncore_pmu_to_box

Leftover perf/urgent fix from the v3.6 cycle.

 Thanks,

Ingo

--
Yan, Zheng (1):
  perf/x86: Fix typo in uncore_pmu_to_box


 arch/x86/kernel/cpu/perf_event_intel_uncore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c 
b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
index 38e4894..c7c55e7 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
@@ -1950,7 +1950,7 @@ struct intel_uncore_box *uncore_alloc_box(struct 
intel_uncore_type *type, int cp
 static struct intel_uncore_box *
 uncore_pmu_to_box(struct intel_uncore_pmu *pmu, int cpu)
 {
-   static struct intel_uncore_box *box;
+   struct intel_uncore_box *box;
 
box = *per_cpu_ptr(pmu-box, cpu);
if (box)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/