Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147451
b: refs/heads/master
c: a026dfe
h: refs/heads/master
i:
  147449: 9d2a22f
  147447: df72c8e
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed May 15, 2009
1 parent 7c9287e commit dd80159
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f5a5a2f6e69e88647ae12da39f0ff3a510bcf0a6
refs/heads/master: a026dfecc035f213c1cfa0bf6407ce3155f6a9df
5 changes: 4 additions & 1 deletion trunk/arch/x86/kernel/cpu/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,11 @@ static int __hw_perf_counter_init(struct perf_counter *counter)
* If privileged enough, allow NMI events:
*/
hwc->nmi = 0;
if (capable(CAP_SYS_ADMIN) && hw_event->nmi)
if (hw_event->nmi) {
if (sysctl_perf_counter_priv && !capable(CAP_SYS_ADMIN))
return -EACCES;
hwc->nmi = 1;
}

hwc->irq_period = hw_event->irq_period;
if ((s64)hwc->irq_period <= 0 || hwc->irq_period > x86_pmu.max_period)
Expand Down

0 comments on commit dd80159

Please sign in to comment.