diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2014-09-05 10:53:56 -0400 |
|---|---|---|
| committer | Arnd Bergmann <arnd@arndb.de> | 2014-09-05 10:53:56 -0400 |
| commit | 184df9ddaab4a572e61b321abc079ca49155fc12 (patch) | |
| tree | 5c99704d8508224b25552f24959b54772d8eec1e /kernel | |
| parent | 647f95fa99b16e7c7854a202e91e6aa22ebeecf4 (diff) | |
| parent | 13298fbbdb3f6a0ef55419dc048e064c7a7b0ef8 (diff) | |
Merge tag 'renesas-kconfig-cleanups-for-v3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/cleanup
Pull "Renesas ARM Based SoC Kconfig Cleanups for v3.18" from Simon Horman:
* Update name of "R-Car M2-W" SoC (previously there was no "-W")
* Consolidate Legacy SH_CLK_CPG and CPU_V7 Kconfig
* Only select PM_RMOBILE for legacy case
* Cleanup pm-rcar.o and pm-rmobile.o build using Kconfig
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* tag 'renesas-kconfig-cleanups-for-v3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
ARM: shmobile: r8a7791 is now called "R-Car M2-W"
ARM: shmobile: Consolidate Legacy SH_CLK_CPG Kconfig
ARM: shmobile: Consolidate Legacy CPU_V7 Kconfig
ARM: shmobile: Only select PM_RMOBILE for legacy case
ARM: shmobile: Cleanup pm-rmobile.o build using Kconfig
ARM: shmobile: Cleanup pm-rcar.o build using Kconfig
ARM: shmobile: Introduce a Kconfig entry for R-Car Gen2
ARM: shmobile: Introduce a Kconfig entry for R-Car Gen1
ARM: shmobile: Introduce a Kconfig entry for R-Mobile
Includes an update to 3.17-rc2 to avoid a dependency
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/events/core.c | 23 | ||||
| -rw-r--r-- | kernel/kprobes.c | 13 | ||||
| -rw-r--r-- | kernel/trace/ftrace.c | 246 |
3 files changed, 191 insertions, 91 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 1cf24b3e42ec..f9c1ed002dbc 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
| @@ -41,6 +41,7 @@ | |||
| 41 | #include <linux/cgroup.h> | 41 | #include <linux/cgroup.h> |
| 42 | #include <linux/module.h> | 42 | #include <linux/module.h> |
| 43 | #include <linux/mman.h> | 43 | #include <linux/mman.h> |
| 44 | #include <linux/compat.h> | ||
| 44 | 45 | ||
| 45 | #include "internal.h" | 46 | #include "internal.h" |
| 46 | 47 | ||
| @@ -3717,6 +3718,26 @@ static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
| 3717 | return 0; | 3718 | return 0; |
| 3718 | } | 3719 | } |
| 3719 | 3720 | ||
| 3721 | #ifdef CONFIG_COMPAT | ||
| 3722 | static long perf_compat_ioctl(struct file *file, unsigned int cmd, | ||
| 3723 | unsigned long arg) | ||
| 3724 | { | ||
| 3725 | switch (_IOC_NR(cmd)) { | ||
| 3726 | case _IOC_NR(PERF_EVENT_IOC_SET_FILTER): | ||
| 3727 | case _IOC_NR(PERF_EVENT_IOC_ID): | ||
| 3728 | /* Fix up pointer size (usually 4 -> 8 in 32-on-64-bit case */ | ||
| 3729 | if (_IOC_SIZE(cmd) == sizeof(compat_uptr_t)) { | ||
| 3730 | cmd &= ~IOCSIZE_MASK; | ||
| 3731 | cmd |= sizeof(void *) << IOCSIZE_SHIFT; | ||
| 3732 | } | ||
| 3733 | break; | ||
| 3734 | } | ||
| 3735 | return perf_ioctl(file, cmd, arg); | ||
| 3736 | } | ||
| 3737 | #else | ||
| 3738 | # define perf_compat_ioctl NULL | ||
| 3739 | #endif | ||
| 3740 | |||
| 3720 | int perf_event_task_enable(void) | 3741 | int perf_event_task_enable(void) |
| 3721 | { | 3742 | { |
| 3722 | struct perf_event *event; | 3743 | struct perf_event *event; |
| @@ -4222,7 +4243,7 @@ static const struct file_operations perf_fops = { | |||
| 4222 | .read = perf_read, | 4243 | .read = perf_read, |
| 4223 | .poll = perf_poll, | 4244 | .poll = perf_poll, |
| 4224 | .unlocked_ioctl = perf_ioctl, | 4245 | .unlocked_ioctl = perf_ioctl, |
| 4225 | .compat_ioctl = perf_ioctl, | 4246 | .compat_ioctl = perf_compat_ioctl, |
| 4226 | .mmap = perf_mmap, | 4247 | .mmap = perf_mmap, |
| 4227 | .fasync = perf_fasync, | 4248 | .fasync = perf_fasync, |
| 4228 | }; | 4249 | }; |
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 734e9a7d280b..3995f546d0f3 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
| @@ -1778,7 +1778,18 @@ static int pre_handler_kretprobe(struct kprobe *p, struct pt_regs *regs) | |||
| 1778 | unsigned long hash, flags = 0; | 1778 | unsigned long hash, flags = 0; |
| 1779 | struct kretprobe_instance *ri; | 1779 | struct kretprobe_instance *ri; |
| 1780 | 1780 | ||
| 1781 | /*TODO: consider to only swap the RA after the last pre_handler fired */ | 1781 | /* |
| 1782 | * To avoid deadlocks, prohibit return probing in NMI contexts, | ||
| 1783 | * just skip the probe and increase the (inexact) 'nmissed' | ||
| 1784 | * statistical counter, so that the user is informed that | ||
| 1785 | * something happened: | ||
| 1786 | */ | ||
| 1787 | if (unlikely(in_nmi())) { | ||
| 1788 | rp->nmissed++; | ||
| 1789 | return 0; | ||
| 1790 | } | ||
| 1791 | |||
| 1792 | /* TODO: consider to only swap the RA after the last pre_handler fired */ | ||
| 1782 | hash = hash_ptr(current, KPROBE_HASH_BITS); | 1793 | hash = hash_ptr(current, KPROBE_HASH_BITS); |
| 1783 | raw_spin_lock_irqsave(&rp->lock, flags); | 1794 | raw_spin_lock_irqsave(&rp->lock, flags); |
| 1784 | if (!hlist_empty(&rp->free_instances)) { | 1795 | if (!hlist_empty(&rp->free_instances)) { |
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 1654b12c891a..5916a8e59e87 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
| @@ -65,15 +65,21 @@ | |||
| 65 | #define FL_GLOBAL_CONTROL_MASK (FTRACE_OPS_FL_CONTROL) | 65 | #define FL_GLOBAL_CONTROL_MASK (FTRACE_OPS_FL_CONTROL) |
| 66 | 66 | ||
| 67 | #ifdef CONFIG_DYNAMIC_FTRACE | 67 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 68 | #define INIT_REGEX_LOCK(opsname) \ | 68 | #define INIT_OPS_HASH(opsname) \ |
| 69 | .regex_lock = __MUTEX_INITIALIZER(opsname.regex_lock), | 69 | .func_hash = &opsname.local_hash, \ |
| 70 | .local_hash.regex_lock = __MUTEX_INITIALIZER(opsname.local_hash.regex_lock), | ||
| 71 | #define ASSIGN_OPS_HASH(opsname, val) \ | ||
| 72 | .func_hash = val, \ | ||
| 73 | .local_hash.regex_lock = __MUTEX_INITIALIZER(opsname.local_hash.regex_lock), | ||
| 70 | #else | 74 | #else |
| 71 | #define INIT_REGEX_LOCK(opsname) | 75 | #define INIT_OPS_HASH(opsname) |
| 76 | #define ASSIGN_OPS_HASH(opsname, val) | ||
| 72 | #endif | 77 | #endif |
| 73 | 78 | ||
| 74 | static struct ftrace_ops ftrace_list_end __read_mostly = { | 79 | static struct ftrace_ops ftrace_list_end __read_mostly = { |
| 75 | .func = ftrace_stub, | 80 | .func = ftrace_stub, |
| 76 | .flags = FTRACE_OPS_FL_RECURSION_SAFE | FTRACE_OPS_FL_STUB, | 81 | .flags = FTRACE_OPS_FL_RECURSION_SAFE | FTRACE_OPS_FL_STUB, |
| 82 | INIT_OPS_HASH(ftrace_list_end) | ||
| 77 | }; | 83 | }; |
| 78 | 84 | ||
| 79 | /* ftrace_enabled is a method to turn ftrace on or off */ | 85 | /* ftrace_enabled is a method to turn ftrace on or off */ |
| @@ -140,7 +146,8 @@ static inline void ftrace_ops_init(struct ftrace_ops *ops) | |||
| 140 | { | 146 | { |
| 141 | #ifdef CONFIG_DYNAMIC_FTRACE | 147 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 142 | if (!(ops->flags & FTRACE_OPS_FL_INITIALIZED)) { | 148 | if (!(ops->flags & FTRACE_OPS_FL_INITIALIZED)) { |
| 143 | mutex_init(&ops->regex_lock); | 149 | mutex_init(&ops->local_hash.regex_lock); |
| 150 | ops->func_hash = &ops->local_hash; | ||
| 144 | ops->flags |= FTRACE_OPS_FL_INITIALIZED; | 151 | ops->flags |= FTRACE_OPS_FL_INITIALIZED; |
| 145 | } | 152 | } |
| 146 | #endif | 153 | #endif |
| @@ -899,7 +906,7 @@ static void unregister_ftrace_profiler(void) | |||
| 899 | static struct ftrace_ops ftrace_profile_ops __read_mostly = { | 906 | static struct ftrace_ops ftrace_profile_ops __read_mostly = { |
| 900 | .func = function_profile_call, | 907 | .func = function_profile_call, |
| 901 | .flags = FTRACE_OPS_FL_RECURSION_SAFE | FTRACE_OPS_FL_INITIALIZED, | 908 | .flags = FTRACE_OPS_FL_RECURSION_SAFE | FTRACE_OPS_FL_INITIALIZED, |
| 902 | INIT_REGEX_LOCK(ftrace_profile_ops) | 909 | INIT_OPS_HASH(ftrace_profile_ops) |
| 903 | }; | 910 | }; |
| 904 | 911 | ||
| 905 | static int register_ftrace_profiler(void) | 912 | static int register_ftrace_profiler(void) |
| @@ -1081,11 +1088,12 @@ static const struct ftrace_hash empty_hash = { | |||
| 1081 | #define EMPTY_HASH ((struct ftrace_hash *)&empty_hash) | 1088 | #define EMPTY_HASH ((struct ftrace_hash *)&empty_hash) |
| 1082 | 1089 | ||
| 1083 | static struct ftrace_ops global_ops = { | 1090 | static struct ftrace_ops global_ops = { |
| 1084 | .func = ftrace_stub, | 1091 | .func = ftrace_stub, |
| 1085 | .notrace_hash = EMPTY_HASH, | 1092 | .local_hash.notrace_hash = EMPTY_HASH, |
| 1086 | .filter_hash = EMPTY_HASH, | 1093 | .local_hash.filter_hash = EMPTY_HASH, |
| 1087 | .flags = FTRACE_OPS_FL_RECURSION_SAFE | FTRACE_OPS_FL_INITIALIZED, | 1094 | INIT_OPS_HASH(global_ops) |
| 1088 | INIT_REGEX_LOCK(global_ops) | 1095 | .flags = FTRACE_OPS_FL_RECURSION_SAFE | |
| 1096 | FTRACE_OPS_FL_INITIALIZED, | ||
| 1089 | }; | 1097 | }; |
| 1090 | 1098 | ||
| 1091 | struct ftrace_page { | 1099 | struct ftrace_page { |
| @@ -1226,8 +1234,8 @@ static void free_ftrace_hash_rcu(struct ftrace_hash *hash) | |||
| 1226 | void ftrace_free_filter(struct ftrace_ops *ops) | 1234 | void ftrace_free_filter(struct ftrace_ops *ops) |
| 1227 | { | 1235 | { |
| 1228 | ftrace_ops_init(ops); | 1236 | ftrace_ops_init(ops); |
| 1229 | free_ftrace_hash(ops->filter_hash); | 1237 | free_ftrace_hash(ops->func_hash->filter_hash); |
| 1230 | free_ftrace_hash(ops->notrace_hash); | 1238 | free_ftrace_hash(ops->func_hash->notrace_hash); |
| 1231 | } | 1239 | } |
| 1232 | 1240 | ||
| 1233 | static struct ftrace_hash *alloc_ftrace_hash(int size_bits) | 1241 | static struct ftrace_hash *alloc_ftrace_hash(int size_bits) |
| @@ -1288,9 +1296,9 @@ alloc_and_copy_ftrace_hash(int size_bits, struct ftrace_hash *hash) | |||
| 1288 | } | 1296 | } |
| 1289 | 1297 | ||
| 1290 | static void | 1298 | static void |
| 1291 | ftrace_hash_rec_disable(struct ftrace_ops *ops, int filter_hash); | 1299 | ftrace_hash_rec_disable_modify(struct ftrace_ops *ops, int filter_hash); |
| 1292 | static void | 1300 | static void |
| 1293 | ftrace_hash_rec_enable(struct ftrace_ops *ops, int filter_hash); | 1301 | ftrace_hash_rec_enable_modify(struct ftrace_ops *ops, int filter_hash); |
| 1294 | 1302 | ||
| 1295 | static int | 1303 | static int |
| 1296 | ftrace_hash_move(struct ftrace_ops *ops, int enable, | 1304 | ftrace_hash_move(struct ftrace_ops *ops, int enable, |
| @@ -1342,13 +1350,13 @@ update: | |||
| 1342 | * Remove the current set, update the hash and add | 1350 | * Remove the current set, update the hash and add |
| 1343 | * them back. | 1351 | * them back. |
| 1344 | */ | 1352 | */ |
| 1345 | ftrace_hash_rec_disable(ops, enable); | 1353 | ftrace_hash_rec_disable_modify(ops, enable); |
| 1346 | 1354 | ||
| 1347 | old_hash = *dst; | 1355 | old_hash = *dst; |
| 1348 | rcu_assign_pointer(*dst, new_hash); | 1356 | rcu_assign_pointer(*dst, new_hash); |
