diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/time.c | 2 | ||||
-rw-r--r-- | arch/x86_64/kernel/time.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c index 8705c0f05788..edd00f6cee37 100644 --- a/arch/i386/kernel/time.c +++ b/arch/i386/kernel/time.c | |||
@@ -135,7 +135,7 @@ unsigned long profile_pc(struct pt_regs *regs) | |||
135 | { | 135 | { |
136 | unsigned long pc = instruction_pointer(regs); | 136 | unsigned long pc = instruction_pointer(regs); |
137 | 137 | ||
138 | if (in_lock_functions(pc)) | 138 | if (!user_mode_vm(regs) && in_lock_functions(pc)) |
139 | return *(unsigned long *)(regs->ebp + 4); | 139 | return *(unsigned long *)(regs->ebp + 4); |
140 | 140 | ||
141 | return pc; | 141 | return pc; |
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c index b9ff75992c16..e0341c6808e5 100644 --- a/arch/x86_64/kernel/time.c +++ b/arch/x86_64/kernel/time.c | |||
@@ -193,7 +193,7 @@ unsigned long profile_pc(struct pt_regs *regs) | |||
193 | is just accounted to the spinlock function. | 193 | is just accounted to the spinlock function. |
194 | Better would be to write these functions in assembler again | 194 | Better would be to write these functions in assembler again |
195 | and check exactly. */ | 195 | and check exactly. */ |
196 | if (in_lock_functions(pc)) { | 196 | if (!user_mode(regs) && in_lock_functions(pc)) { |
197 | char *v = *(char **)regs->rsp; | 197 | char *v = *(char **)regs->rsp; |
198 | if ((v >= _stext && v <= _etext) || | 198 | if ((v >= _stext && v <= _etext) || |
199 | (v >= _sinittext && v <= _einittext) || | 199 | (v >= _sinittext && v <= _einittext) || |