diff options
author | Ingo Molnar <mingo@kernel.org> | 2014-09-09 06:48:07 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-09-09 06:48:07 +0200 |
commit | bdea534db894ea19320f470ce2e63b1d9de96a15 (patch) | |
tree | 8ec2a0a93d9bb5e7205253c67aa624b9ec227477 /kernel/events | |
parent | 39b5a56ec0be5effe9b7d0f18cb27724bf2e5d47 (diff) | |
parent | 2ce7598c9a453e0acd0e07be7be3f5eb39608ebd (diff) | |
download | talos-obmc-linux-bdea534db894ea19320f470ce2e63b1d9de96a15.tar.gz talos-obmc-linux-bdea534db894ea19320f470ce2e63b1d9de96a15.zip |
Merge tag 'v3.17-rc4' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/events')
-rw-r--r-- | kernel/events/core.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index d8cb4d21a346..01bd42ed516c 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -41,6 +41,7 @@ #include <linux/cgroup.h> #include <linux/module.h> #include <linux/mman.h> +#include <linux/compat.h> #include "internal.h" @@ -3821,6 +3822,26 @@ static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return 0; } +#ifdef CONFIG_COMPAT +static long perf_compat_ioctl(struct file *file, unsigned int cmd, + unsigned long arg) +{ + switch (_IOC_NR(cmd)) { + case _IOC_NR(PERF_EVENT_IOC_SET_FILTER): + case _IOC_NR(PERF_EVENT_IOC_ID): + /* Fix up pointer size (usually 4 -> 8 in 32-on-64-bit case */ + if (_IOC_SIZE(cmd) == sizeof(compat_uptr_t)) { + cmd &= ~IOCSIZE_MASK; + cmd |= sizeof(void *) << IOCSIZE_SHIFT; + } + break; + } + return perf_ioctl(file, cmd, arg); +} +#else +# define perf_compat_ioctl NULL +#endif + int perf_event_task_enable(void) { struct perf_event *event; @@ -4326,7 +4347,7 @@ static const struct file_operations perf_fops = { .read = perf_read, .poll = perf_poll, .unlocked_ioctl = perf_ioctl, - .compat_ioctl = perf_ioctl, + .compat_ioctl = perf_compat_ioctl, .mmap = perf_mmap, .fasync = perf_fasync, }; |