Commit 5a4ccaf3 authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Len Brown

kprobes: check CONFIG_FREEZER instead of CONFIG_PM

Check CONFIG_FREEZER instead of CONFIG_PM because kprobe booster
depends on freeze_processes() and thaw_processes() when CONFIG_PREEMPT=y.

This fixes a linkage error which occurs when CONFIG_PREEMPT=y, CONFIG_PM=y
and CONFIG_FREEZER=n.
Reported-by: default avatarCheng Renquan <crquan@gmail.com>
Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 33f1d7ec
...@@ -870,7 +870,7 @@ static int __kprobes pre_kprobes_handler(struct die_args *args) ...@@ -870,7 +870,7 @@ static int __kprobes pre_kprobes_handler(struct die_args *args)
return 1; return 1;
ss_probe: ss_probe:
#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PM) #if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER)
if (p->ainsn.inst_flag == INST_FLAG_BOOSTABLE && !p->post_handler) { if (p->ainsn.inst_flag == INST_FLAG_BOOSTABLE && !p->post_handler) {
/* Boost up -- we can execute copied instructions directly */ /* Boost up -- we can execute copied instructions directly */
ia64_psr(regs)->ri = p->ainsn.slot; ia64_psr(regs)->ri = p->ainsn.slot;
......
...@@ -446,7 +446,7 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri, ...@@ -446,7 +446,7 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri,
static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs, static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs,
struct kprobe_ctlblk *kcb) struct kprobe_ctlblk *kcb)
{ {
#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PM) #if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER)
if (p->ainsn.boostable == 1 && !p->post_handler) { if (p->ainsn.boostable == 1 && !p->post_handler) {
/* Boost up -- we can execute copied instructions directly */ /* Boost up -- we can execute copied instructions directly */
reset_current_kprobe(); reset_current_kprobe();
......
...@@ -123,7 +123,7 @@ static int collect_garbage_slots(void); ...@@ -123,7 +123,7 @@ static int collect_garbage_slots(void);
static int __kprobes check_safety(void) static int __kprobes check_safety(void)
{ {
int ret = 0; int ret = 0;
#if defined(CONFIG_PREEMPT) && defined(CONFIG_PM) #if defined(CONFIG_PREEMPT) && defined(CONFIG_FREEZER)
ret = freeze_processes(); ret = freeze_processes();
if (ret == 0) { if (ret == 0) {
struct task_struct *p, *q; struct task_struct *p, *q;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment