Fix BUG() with spm_processor_id()
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 1 Dec 2016 10:49:22 +0000 (13:49 +0300)
committerDmitry Kovalenko <d.kovalenko@samsung.com>
Tue, 6 Dec 2016 06:44:11 +0000 (22:44 -0800)
Use raw_smp_processor_id() instead. If CONFIG_DEBUG_PREEMPT is enabled,
spm_processor_id() is defined as debug_smp_processor_id() which should
be called only in atomic context.

Change-Id: I039f2c0b50bb319a5473a2823db68984bedfe2fe
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
ks_features/ksf_msg.c
parser/features.c
retprobe/rp_msg.c

index b465359..d18352d 100644 (file)
@@ -67,7 +67,7 @@ static void pack_header(struct msg_sys_header *h, unsigned long func_addr,
        h->probe_type = (u32)type;
        h->pc_addr = func_addr;
        h->caller_pc_addr = ret_addr;
-       h->cpu_num = smp_processor_id();
+       h->cpu_num = raw_smp_processor_id();
 }
 
 static void pack_entry_header(struct msg_sys_entry *e, struct pt_regs *regs,
@@ -358,7 +358,7 @@ static void context_switch(struct pt_regs *regs, enum swap_msg_id id)
        mcs->pc_addr = 0;
        mcs->pid = task->tgid;
        mcs->tid = task->pid;
-       mcs->cpu_num = smp_processor_id();
+       mcs->cpu_num = raw_smp_processor_id();
 
        swap_msg_flush_wakeupoff(m, sizeof(*mcs));
        swap_msg_put(m);
index 392f5f5..b17e22e 100644 (file)
@@ -307,7 +307,7 @@ static void sample_msg(struct pt_regs *regs)
        s->pid = task->tgid;
        s->pc_addr = instruction_pointer(regs);
        s->tid = task->pid;
-       s->cpu_num = smp_processor_id();
+       s->cpu_num = raw_smp_processor_id();
 
        swap_msg_flush(m, sizeof(*s));
        swap_msg_put(m);
index fbbd3b0..3fb4426 100644 (file)
@@ -68,7 +68,7 @@ void rp_msg_entry(struct pt_regs *regs, unsigned long func_addr,
        ent->tid = task->pid;
        ent->pc_addr = func_addr;
        ent->caller_pc_addr = get_regs_ret_func(regs);
-       ent->cpu_num = smp_processor_id();
+       ent->cpu_num = raw_smp_processor_id();
        ent->cnt_args = strlen(fmt);
 
        size = swap_msg_size(m);
@@ -104,7 +104,7 @@ void rp_msg_exit(struct pt_regs *regs, unsigned long func_addr,
        ext->tid = task->pid;
        ext->pc_addr = func_addr;
        ext->caller_pc_addr = ret_addr;
-       ext->cpu_num = smp_processor_id();
+       ext->cpu_num = raw_smp_processor_id();
 
        size = swap_msg_size(m);
        ret = swap_msg_pack_ret_val(p + sizeof(*ext), size - sizeof(*ext),