diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/audit.c | 4 | ||||
| -rw-r--r-- | kernel/context_tracking.c | 2 | ||||
| -rw-r--r-- | kernel/hrtimer.c | 22 | ||||
| -rw-r--r-- | kernel/irq/irqdesc.c | 7 | ||||
| -rw-r--r-- | kernel/irq/manage.c | 17 | ||||
| -rw-r--r-- | kernel/locking/lockdep.c | 2 | ||||
| -rw-r--r-- | kernel/module.c | 6 | ||||
| -rw-r--r-- | kernel/power/snapshot.c | 2 | ||||
| -rw-r--r-- | kernel/power/suspend.c | 3 | ||||
| -rw-r--r-- | kernel/printk/printk.c | 4 | ||||
| -rw-r--r-- | kernel/sched/core.c | 10 | ||||
| -rw-r--r-- | kernel/softirq.c | 9 | ||||
| -rw-r--r-- | kernel/timer.c | 2 | ||||
| -rw-r--r-- | kernel/trace/ftrace.c | 27 | ||||
| -rw-r--r-- | kernel/trace/trace_events_trigger.c | 2 | ||||
| -rw-r--r-- | kernel/tracepoint.c | 4 |
16 files changed, 68 insertions, 55 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index 7c2893602d06..47845c57eb19 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
| @@ -643,13 +643,13 @@ static int audit_netlink_ok(struct sk_buff *skb, u16 msg_type) | |||
| 643 | if ((task_active_pid_ns(current) != &init_pid_ns)) | 643 | if ((task_active_pid_ns(current) != &init_pid_ns)) |
| 644 | return -EPERM; | 644 | return -EPERM; |
| 645 | 645 | ||
| 646 | if (!capable(CAP_AUDIT_CONTROL)) | 646 | if (!netlink_capable(skb, CAP_AUDIT_CONTROL)) |
| 647 | err = -EPERM; | 647 | err = -EPERM; |
| 648 | break; | 648 | break; |
| 649 | case AUDIT_USER: | 649 | case AUDIT_USER: |
| 650 | case AUDIT_FIRST_USER_MSG ... AUDIT_LAST_USER_MSG: | 650 | case AUDIT_FIRST_USER_MSG ... AUDIT_LAST_USER_MSG: |
| 651 | case AUDIT_FIRST_USER_MSG2 ... AUDIT_LAST_USER_MSG2: | 651 | case AUDIT_FIRST_USER_MSG2 ... AUDIT_LAST_USER_MSG2: |
| 652 | if (!capable(CAP_AUDIT_WRITE)) | 652 | if (!netlink_capable(skb, CAP_AUDIT_WRITE)) |
| 653 | err = -EPERM; | 653 | err = -EPERM; |
| 654 | break; | 654 | break; |
| 655 | default: /* bad msg */ | 655 | default: /* bad msg */ |
diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c index 6cb20d2e7ee0..019d45008448 100644 --- a/kernel/context_tracking.c +++ b/kernel/context_tracking.c | |||
| @@ -120,7 +120,7 @@ void context_tracking_user_enter(void) | |||
| 120 | * instead of preempt_schedule() to exit user context if needed before | 120 | * instead of preempt_schedule() to exit user context if needed before |
| 121 | * calling the scheduler. | 121 | * calling the scheduler. |
| 122 | */ | 122 | */ |
| 123 | asmlinkage void __sched notrace preempt_schedule_context(void) | 123 | asmlinkage __visible void __sched notrace preempt_schedule_context(void) |
| 124 | { | 124 | { |
| 125 | enum ctx_state prev_ctx; | 125 | enum ctx_state prev_ctx; |
| 126 | 126 | ||
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index d55092ceee29..6b715c0af1b1 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
| @@ -234,6 +234,11 @@ again: | |||
| 234 | goto again; | 234 | goto again; |
| 235 | } | 235 | } |
| 236 | timer->base = new_base; | 236 | timer->base = new_base; |
| 237 | } else { | ||
| 238 | if (cpu != this_cpu && hrtimer_check_target(timer, new_base)) { | ||
| 239 | cpu = this_cpu; | ||
| 240 | goto again; | ||
| 241 | } | ||
| 237 | } | 242 | } |
| 238 | return new_base; | 243 | return new_base; |
| 239 | } | 244 | } |
| @@ -569,6 +574,23 @@ hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal) | |||
| 569 | 574 | ||
| 570 | cpu_base->expires_next.tv64 = expires_next.tv64; | 575 | cpu_base->expires_next.tv64 = expires_next.tv64; |
| 571 | 576 | ||
| 577 | /* | ||
| 578 | * If a hang was detected in the last timer interrupt then we | ||
| 579 | * leave the hang delay active in the hardware. We want the | ||
| 580 | * system to make progress. That also prevents the following | ||
| 581 | * scenario: | ||
| 582 | * T1 expires 50ms from now | ||
| 583 | * T2 expires 5s from now | ||
| 584 | * | ||
| 585 | * T1 is removed, so this code is called and would reprogram | ||
| 586 | * the hardware to 5s from now. Any hrtimer_start after that | ||
| 587 | * will not reprogram the hardware due to hang_detected being | ||
| 588 | * set. So we'd effectivly block all timers until the T2 event | ||
| 589 | * fires. | ||
| 590 | */ | ||
| 591 | if (cpu_base->hang_detected) | ||
| 592 | return; | ||
| 593 | |||
| 572 | if (cpu_base->expires_next.tv64 != KTIME_MAX) | 594 | if (cpu_base->expires_next.tv64 != KTIME_MAX) |
| 573 | tick_program_event(cpu_base->expires_next, 1); | 595 | tick_program_event(cpu_base->expires_next, 1); |
| 574 | } | 596 | } |
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index a7174617616b..bb07f2928f4b 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c | |||
| @@ -363,6 +363,13 @@ __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node, | |||
| 363 | if (from > irq) | 363 | if (from > irq) |
| 364 | return -EINVAL; | 364 | return -EINVAL; |
| 365 | from = irq; | 365 | from = irq; |
| 366 | } else { | ||
| 367 | /* | ||
| 368 | * For interrupts which are freely allocated the | ||
| 369 | * architecture can force a lower bound to the @from | ||
| 370 | * argument. x86 uses this to exclude the GSI space. | ||
| 371 | */ | ||
| 372 | from = arch_dynirq_lower_bound(from); | ||
| 366 | } | 373 | } |
| 367 | 374 | ||
| 368 | mutex_lock(&sparse_irq_lock); | 375 | mutex_lock(&sparse_irq_lock); |
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 2486a4c1a710..d34131ca372b 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
| @@ -180,7 +180,7 @@ int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask, | |||
| 180 | struct irq_chip *chip = irq_data_get_irq_chip(data); | 180 | struct irq_chip *chip = irq_data_get_irq_chip(data); |
| 181 | int ret; | 181 | int ret; |
| 182 | 182 | ||
| 183 | ret = chip->irq_set_affinity(data, mask, false); | 183 | ret = chip->irq_set_affinity(data, mask, force); |
| 184 | switch (ret) { | 184 | switch (ret) { |
| 185 | case IRQ_SET_MASK_OK: | 185 | case IRQ_SET_MASK_OK: |
| 186 | cpumask_copy(data->affinity, mask); | 186 | cpumask_copy(data->affinity, mask); |
| @@ -192,7 +192,8 @@ int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask, | |||
| 192 | return ret; | 192 | return ret; |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask) | 195 | int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask, |
| 196 | bool force) | ||
| 196 | { | 197 | { |
| 197 | struct irq_chip *chip = irq_data_get_irq_chip(data); | 198 | struct irq_chip *chip = irq_data_get_irq_chip(data); |
| 198 | struct irq_desc *desc = irq_data_to_desc(data); | 199 | struct irq_desc *desc = irq_data_to_desc(data); |
| @@ -202,7 +203,7 @@ int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask) | |||
| 202 | return -EINVAL; | 203 | return -EINVAL; |
| 203 | 204 | ||
| 204 | if (irq_can_move_pcntxt(data)) { | 205 | if (irq_can_move_pcntxt(data)) { |
| 205 | ret = irq_do_set_affinity(data, mask, false); | 206 | ret = irq_do_set_affinity(data, mask, force); |
| 206 | } else { | 207 | } else { |
| 207 | irqd_set_move_pending(data); | 208 | irqd_set_move_pending(data); |
| 208 | irq_copy_pending(desc, mask); | 209 | irq_copy_pending(desc, mask); |
| @@ -217,13 +218,7 @@ int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask) | |||
| 217 | return ret; | 218 | return ret; |
| 218 | } | 219 | } |
| 219 | 220 | ||
| 220 | /** | 221 | int __irq_set_affinity(unsigned int irq, const struct cpumask *mask, bool force) |
| 221 | * irq_set_affinity - Set the irq affinity of a given irq | ||
| 222 | * @irq: Interrupt to set affinity | ||
| 223 | * @mask: cpumask | ||
| 224 | * | ||
| 225 | */ | ||
| 226 | int irq_set_affinity(unsigned int irq, const struct cpumask *mask) | ||
| 227 | { | 222 | { |
| 228 | struct irq_desc *desc = irq_to_desc(irq); | 223 | struct irq_desc *desc = irq_to_desc(irq); |
| 229 | unsigned long flags; | 224 | unsigned long flags; |
| @@ -233,7 +228,7 @@ int irq_set_affinity(unsigned int irq, const struct cpumask *mask) | |||
| 233 | return -EINVAL; | 228 | return -EINVAL; |
| 234 | 229 | ||
| 235 | raw_spin_lock_irqsave(&desc->lock, flags); | 230 | raw_spin_lock_irqsave(&desc->lock, flags); |
| 236 | ret = __irq_set_affinity_locked(irq_desc_get_irq_data(desc), mask); | 231 | ret = irq_set_affinity_locked(irq_desc_get_irq_data(desc), mask, force); |
| 237 | raw_spin_unlock_irqrestore(&desc->lock, flags); | 232 | raw_spin_unlock_irqrestore(&desc->lock, flags); |
| 238 | return ret; | 233 | return ret; |
| 239 | } | 234 | } |
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index b0e9467922e1..d24e4339b46d 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c | |||
| @@ -4188,7 +4188,7 @@ void debug_show_held_locks(struct task_struct *task) | |||
| 4188 | } | 4188 | } |
| 4189 | EXPORT_SYMBOL_GPL(debug_show_held_locks); | 4189 | EXPORT_SYMBOL_GPL(debug_show_held_locks); |
| 4190 | 4190 | ||
| 4191 | asmlinkage void lockdep_sys_exit(void) | 4191 | asmlinkage __visible void lockdep_sys_exit(void) |
| 4192 | { | 4192 | { |
| 4193 | struct task_struct *curr = current; | 4193 | struct task_struct *curr = current; |
| 4194 | 4194 | ||
diff --git a/kernel/module.c b/kernel/module.c index 11869408f79b..079c4615607d 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
| @@ -815,9 +815,6 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user, | |||
| 815 | return -EFAULT; | 815 | return -EFAULT; |
| 816 | name[MODULE_NAME_LEN-1] = '\0'; | 816 | name[MODULE_NAME_LEN-1] = '\0'; |
| 817 | 817 | ||
| 818 | if (!(flags & O_NONBLOCK)) | ||
| 819 | pr_warn("waiting module removal not supported: please upgrade\n"); | ||
| 820 | |||
| 821 | if (mutex_lock_interruptible(&module_mutex) != 0) | 818 | if (mutex_lock_interruptible(&module_mutex) != 0) |
| 822 | return -EINTR; | 819 | return -EINTR; |
| 823 | 820 | ||
| @@ -3271,6 +3268,9 @@ static int load_module(struct load_info *info, const char __user *uargs, | |||
| 3271 | 3268 | ||
| 3272 | dynamic_debug_setup(info->debug, info->num_debug); | 3269 | dynamic_debug_setup(info->debug, info->num_debug); |
| 3273 | 3270 | ||
| 3271 | /* Ftrace init must be called in the MODULE_STATE_UNFORMED state */ | ||
| 3272 | ftrace_module_init(mod); | ||
| 3273 | |||
| 3274 | /* Finally it's fully formed, ready to start executing. */ | 3274 | /* Finally it's fully formed, ready to start executing. */ |
| 3275 | err = complete_formation(mod, info); | 3275 | err = complete_formation(mod, info); |
| 3276 | if (err) | 3276 | if (err) |
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 18fb7a2fb14b..1ea328aafdc9 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c | |||
| @@ -1586,7 +1586,7 @@ swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm, | |||
| 1586 | return -ENOMEM; | 1586 | return -ENOMEM; |
| 1587 | } | 1587 | } |
| 1588 | 1588 | ||
| 1589 | asmlinkage int swsusp_save(void) | 1589 | asmlinkage __visible int swsusp_save(void) |
| 1590 | { | 1590 | { |
| 1591 | unsigned int nr_pages, nr_highmem; | 1591 | unsigned int nr_pages, nr_highmem; |
| 1592 | 1592 | ||
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index c3ad9cafe930..8233cd4047d7 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
| 15 | #include <linux/console.h> | 15 | #include <linux/console.h> |
| 16 | #include <linux/cpu.h> | 16 | #include <linux/cpu.h> |
| 17 | #include <linux/cpuidle.h> | ||
| 17 | #include <linux/syscalls.h> | 18 | #include <linux/syscalls.h> |
| 18 | #include <linux/gfp.h> | 19 | #include <linux/gfp.h> |
| 19 | #include <linux/io.h> | 20 | #include <linux/io.h> |
| @@ -53,7 +54,9 @@ static void freeze_begin(void) | |||
| 53 | 54 | ||
| 54 | static void freeze_enter(void) | 55 | static void freeze_enter(void) |
| 55 | { | 56 | { |
| 57 | cpuidle_resume(); | ||
| 56 | wait_event(suspend_freeze_wait_head, suspend_freeze_wake); | 58 | wait_event(suspend_freeze_wait_head, suspend_freeze_wake); |
| 59 | cpuidle_pause(); | ||
| 57 | } | 60 | } |
| 58 | 61 | ||
| 59 | void freeze_wake(void) | 62 | void freeze_wake(void) |
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index a45b50962295..7228258b85ec 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c | |||
| @@ -1674,7 +1674,7 @@ EXPORT_SYMBOL(printk_emit); | |||
| 1674 | * | 1674 | * |
| 1675 | * See the vsnprintf() documentation for format string extensions over C99. | 1675 | * See the vsnprintf() documentation for format string extensions over C99. |
| 1676 | */ | 1676 | */ |
| 1677 | asmlinkage int printk(const char *fmt, ...) | 1677 | asmlinkage __visible int printk(const char *fmt, ...) |
| 1678 | { | 1678 | { |
| 1679 | va_list args; | 1679 | va_list args; |
| 1680 | int r; | 1680 | int r; |
| @@ -1737,7 +1737,7 @@ void early_vprintk(const char *fmt, va_list ap) | |||
| 1737 | } | 1737 | } |
| 1738 | } | 1738 | } |
| 1739 | 1739 | ||
| 1740 | asmlinkage void early_printk(const char *fmt, ...) | 1740 | asmlinkage __visible void early_printk(const char *fmt, ...) |
| 1741 | { | 1741 | { |
| 1742 | va_list ap; | 1742 | va_list ap; |
| 1743 | 1743 | ||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 268a45ea238c..d9d8ece46a15 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
| @@ -2192,7 +2192,7 @@ static inline void post_schedule(struct rq *rq) | |||
| 2192 | * schedule_tail - first thing a freshly forked thread must call. | 2192 | * schedule_tail - first thing a freshly forked thread must call. |
| 2193 | * @prev: the thread we just switched away from. | 2193 | * @prev: the thread we just switched away from. |
| 2194 | */ | 2194 | */ |
| 2195 | asmlinkage void schedule_tail(struct task_struct *prev) | 2195 | asmlinkage __visible void schedule_tail(struct task_struct *prev) |
| 2196 | __releases(rq->lock) | 2196 | __releases(rq->lock) |
| 2197 | { | 2197 | { |
| 2198 | struct rq *rq = this_rq(); | 2198 | struct rq *rq = this_rq(); |
| @@ -2741,7 +2741,7 @@ static inline void sched_submit_work(struct task_struct *tsk) | |||
| 2741 | blk_schedule_flush_plug(tsk); | 2741 | blk_schedule_flush_plug(tsk); |
| 2742 | } | 2742 | } |
| 2743 | 2743 | ||
| 2744 | asmlinkage void __sched schedule(void) | 2744 | asmlinkage __visible void __sched schedule(void) |
| 2745 | { | 2745 | { |
| 2746 | struct task_struct *tsk = current; | 2746 | struct task_struct *tsk = current; |
| 2747 | 2747 | ||
| @@ -2751,7 +2751,7 @@ asmlinkage void __sched schedule(void) | |||
| 2751 | EXPORT_SYMBOL(schedule); | 2751 | EXPORT_SYMBOL(schedule); |
| 2752 | 2752 | ||
| 2753 | #ifdef CONFIG_CONTEXT_TRACKING | 2753 | #ifdef CONFIG_CONTEXT_TRACKING |
| 2754 | asmlinkage void __sched schedule_user(void) | 2754 | asmlinkage __visible void __sched schedule_user(void) |
| 2755 | { | 2755 | { |
| 2756 | /* | 2756 | /* |
| 2757 | * If we come here after a random call to set_need_resched(), | 2757 | * If we come here after a random call to set_need_resched(), |
| @@ -2783,7 +2783,7 @@ void __sched schedule_preempt_disabled(void) | |||
| 2783 | * off of preempt_enable. Kernel preemptions off return from interrupt | 2783 | * off of preempt_enable. Kernel preemptions off return from interrupt |
| 2784 | * occur there and call schedule directly. | 2784 | * occur there and call schedule directly. |
| 2785 | */ | 2785 | */ |
| 2786 | asmlinkage void __sched notrace preempt_schedule(void) | 2786 | asmlinkage __visible void __sched notrace preempt_schedule(void) |
| 2787 | { | 2787 | { |
| 2788 | /* | 2788 | /* |
| 2789 | * If there is a non-zero preempt_count or interrupts are disabled, | 2789 | * If there is a non-zero preempt_count or interrupts are disabled, |
| @@ -2813,7 +2813,7 @@ EXPORT_SYMBOL(preempt_schedule); | |||
| 2813 | * Note, that this is called and return with irqs disabled. This will | 2813 | * Note, that this is called and return with irqs disabled. This will |
| 2814 | * protect us against recursive calling from irq. | 2814 | * protect us against recursive calling from irq. |
| 2815 | */ | 2815 | */ |
| 2816 | asmlinkage void __sched preempt_schedule_irq(void) | 2816 | asmlinkage __visible void __sched preempt_schedule_irq(void) |
| 2817 | { | 2817 | { |
| 2818 | enum ctx_state prev_state; | 2818 | enum ctx_state prev_state; |
| 2819 | 2819 | ||
diff --git a/kernel/softirq.c b/kernel/softirq.c index b50990a5bea0..92f24f5e8d52 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
| @@ -223,7 +223,7 @@ static inline bool lockdep_softirq_start(void) { return false; } | |||
| 223 | static inline void lockdep_softirq_end(bool in_hardirq) { } | 223 | static inline void lockdep_softirq_end(bool in_hardirq) { } |
| 224 | #endif | 224 | #endif |
| 225 | 225 | ||
| 226 | asmlinkage void __do_softirq(void) | 226 | asmlinkage __visible void __do_softirq(void) |
| 227 | { | 227 | { |
| 228 | unsigned long end = jiffies + MAX_SOFTIRQ_TIME; | 228 | unsigned long end = jiffies + MAX_SOFTIRQ_TIME; |
| 229 | unsigned long old_flags = current->flags; | 229 | unsigned long old_flags = current->flags; |
| @@ -299,7 +299,7 @@ restart: | |||
| 299 | tsk_restore_flags(current, old_flags, PF_MEMALLOC); | 299 | tsk_restore_flags(current, old_flags, PF_MEMALLOC); |
| 300 | } | 300 | } |
| 301 | 301 | ||
| 302 | asmlinkage void do_softirq(void) | 302 | asmlinkage __visible void do_softirq(void) |
| 303 | { | 303 | { |
| 304 | __u32 pending; | 304 | __u32 pending; |
| 305 | unsigned long flags; | 305 | unsigned long flags; |
| @@ -779,3 +779,8 @@ int __init __weak arch_early_irq_init(void) | |||
| 779 | { | 779 | { |
| 780 | return 0; | 780 | return 0; |
| 781 | } | 781 | } |
| 782 | |||
| 783 | unsigned int __weak arch_dynirq_lower_bound(unsigned int from) | ||
| 784 | { | ||
| 785 | return from; | ||
| 786 | } | ||
diff --git a/kernel/timer.c b/kernel/timer.c index 87bd529879c2..3bb01a323b2a 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
| @@ -838,7 +838,7 @@ unsigned long apply_slack(struct timer_list *timer, unsigned long expires) | |||
| 838 | 838 | ||
| 839 | bit = find_last_bit(&mask, BITS_PER_LONG); | 839 | bit = find_last_bit(&mask, BITS_PER_LONG); |
| 840 | 840 | ||
| 841 | mask = (1 << bit) - 1; | 841 | mask = (1UL << bit) - 1; |
| 842 | 842 | ||
| 843 | expires_limit = expires_limit & ~(mask); | 843 | expires_limit = expires_limit & ~(mask); |
| 844 | 844 | ||
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 1fd4b9479210..4a54a25afa2f 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
| @@ -4330,16 +4330,11 @@ static void ftrace_init_module(struct module *mod, | |||
| 4330 | ftrace_process_locs(mod, start, end); | 4330 | ftrace_process_locs(mod, start, end); |
| 4331 | } | 4331 | } |
| 4332 | 4332 | ||
| 4333 | static int ftrace_module_notify_enter(struct notifier_block *self, | 4333 | void ftrace_module_init(struct module *mod) |
| 4334 | unsigned long val, void *data) | ||
| 4335 | { | 4334 | { |
| 4336 | struct module *mod = data; | 4335 | ftrace_init_module(mod, mod->ftrace_callsites, |
| 4337 | 4336 | mod->ftrace_callsites + | |
| 4338 | if (val == MODULE_STATE_COMING) | 4337 | mod->num_ftrace_callsites); |
| 4339 | ftrace_init_module(mod, mod->ftrace_callsites, | ||
| 4340 | mod->ftrace_callsites + | ||
| 4341 | mod->num_ftrace_callsites); | ||
| 4342 | return 0; | ||
| 4343 | } | 4338 | } |
| 4344 | 4339 | ||
| 4345 | static int ftrace_module_notify_exit(struct notifier_block *self, | 4340 | static int ftrace_module_notify_exit(struct notifier_block *self, |
| @@ -4353,11 +4348,6 @@ static int ftrace_module_notify_exit(struct notifier_block *self, | |||
| 4353 | return 0; | 4348 | return 0; |
| 4354 | } | 4349 | } |
| 4355 | #else | 4350 | #else |
| 4356 | static int ftrace_module_notify_enter(struct notifier_block *self, | ||
| 4357 | unsigned long val, void *data) | ||
| 4358 | { | ||
| 4359 | return 0; | ||
| 4360 | } | ||
| 4361 | static int ftrace_module_notify_exit(struct notifier_block *self, | 4351 | static int ftrace_module_notify_exit(struct notifier_block *self, |
| 4362 | unsigned long val, void *data) | 4352 | unsigned long val, void *data) |
| 4363 | { | 4353 | { |
| @@ -4365,11 +4355,6 @@ static int ftrace_module_notify_exit(struct notifier_block *self, | |||
| 4365 | } | 4355 | } |
| 4366 | #endif /* CONFIG_MODULES */ | 4356 | #endif /* CONFIG_MODULES */ |
| 4367 | 4357 | ||
| 4368 | struct notifier_block ftrace_module_enter_nb = { | ||
| 4369 | .notifier_call = ftrace_module_notify_enter, | ||
| 4370 | .priority = INT_MAX, /* Run before anything that can use kprobes */ | ||
| 4371 | }; | ||
| 4372 | |||
| 4373 | struct notifier_block ftrace_module_exit_nb = { | 4358 | struct notifier_block ftrace_module_exit_nb = { |
| 4374 | .notifier_call = ftrace_module_notify_exit, | 4359 | .notifier_call = ftrace_module_notify_exit, |
| 4375 | .priority = INT_MIN, /* Run after anything that can remove kprobes */ | 4360 | .priority = INT_MIN, /* Run after anything that can remove kprobes */ |
| @@ -4403,10 +4388,6 @@ void __init ftrace_init(void) | |||
| 4403 | __start_mcount_loc, | 4388 | __start_mcount_loc, |
| 4404 | __stop_mcount_loc); | 4389 | __stop_mcount_loc); |
| 4405 | 4390 | ||
| 4406 | ret = register_module_notifier(&ftrace_module_enter_nb); | ||
| 4407 | if (ret) | ||
| 4408 | pr_warning("Failed to register trace ftrace module enter notifier\n"); | ||
| 4409 | |||
| 4410 | ret = register_module_notifier(&ftrace_module_exit_nb); | 4391 | ret = register_module_notifier(&ftrace_module_exit_nb); |
| 4411 | if (ret) | 4392 | if (ret) |
| 4412 | pr_warning("Failed to register trace ftrace module exit notifier\n"); | 4393 | pr_warning("Failed to register trace ftrace module exit notifier\n"); |
diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c index 925f537f07d1..4747b476a030 100644 --- a/kernel/trace/trace_events_trigger.c +++ b/kernel/trace/trace_events_trigger.c | |||
| @@ -77,7 +77,7 @@ event_triggers_call(struct ftrace_event_file *file, void *rec) | |||
| 77 | data->ops->func(data); | 77 | data->ops->func(data); |
| 78 | continue; | 78 | continue; |
| 79 | } | 79 | } |
| 80 | filter = rcu_dereference(data->filter); | 80 | filter = rcu_dereference_sched(data->filter); |
| 81 | if (filter && !filter_match_preds(filter, rec)) | 81 | if (filter && !filter_match_preds(filter, rec)) |
| 82 | continue; | 82 | continue; |
| 83 | if (data->cmd_ops->post_trigger) { | 83 | if (data->cmd_ops->post_trigger) { |
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c index ac5b23cf7212..6620e5837ce2 100644 --- a/kernel/tracepoint.c +++ b/kernel/tracepoint.c | |||
| @@ -188,7 +188,6 @@ static int tracepoint_add_func(struct tracepoint *tp, | |||
| 188 | WARN_ON_ONCE(1); | 188 | WARN_ON_ONCE(1); |
| 189 | return PTR_ERR(old); | 189 | return PTR_ERR(old); |
| 190 | } | 190 | } |
| 191 | release_probes(old); | ||
| 192 | 191 | ||
| 193 | /* | 192 | /* |
| 194 | * rcu_assign_pointer has a smp_wmb() which makes sure that the new | 193 | * rcu_assign_pointer has a smp_wmb() which makes sure that the new |
| @@ -200,6 +199,7 @@ static int tracepoint_add_func(struct tracepoint *tp, | |||
| 200 | rcu_assign_pointer(tp->funcs, tp_funcs); | 199 | rcu_assign_pointer(tp->funcs, tp_funcs); |
| 201 | if (!static_key_enabled(&tp->key)) | 200 | if (!static_key_enabled(&tp->key)) |
| 202 | static_key_slow_inc(&tp->key); | 201 | static_key_slow_inc(&tp->key); |
| 202 | release_probes(old); | ||
| 203 | return 0; | 203 | return 0; |
| 204 | } | 204 | } |
| 205 | 205 | ||
| @@ -221,7 +221,6 @@ static int tracepoint_remove_func(struct tracepoint *tp, | |||
| 221 | WARN_ON_ONCE(1); | 221 | WARN_ON_ONCE(1); |
| 222 | return PTR_ERR(old); | 222 | return PTR_ERR(old); |
| 223 | } | 223 | } |
| 224 | release_probes(old); | ||
| 225 | 224 | ||
| 226 | if (!tp_funcs) { | 225 | if (!tp_funcs) { |
| 227 | /* Removed last function */ | 226 | /* Removed last function */ |
| @@ -232,6 +231,7 @@ static int tracepoint_remove_func(struct tracepoint *tp, | |||
| 232 | static_key_slow_dec(&tp->key); | 231 | static_key_slow_dec(&tp->key); |
| 233 | } | 232 | } |
| 234 | rcu_assign_pointer(tp->funcs, tp_funcs); | 233 | rcu_assign_pointer(tp->funcs, tp_funcs); |
| 234 | release_probes(old); | ||
| 235 | return 0; | 235 | return 0; |
| 236 | } | 236 | } |
| 237 | 237 | ||
