lkml.org 
[lkml]   [2012]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/15] perf: Add ability to dump user regs
Hi, Jiri -

On Wed, Mar 28, 2012 at 02:35:47PM +0200, Jiri Olsa wrote:
> [...]
> The register value here are those of the user space context as
> it was before the user entered the kernel for whatever reason
> (syscall, irq, exception, or a PMI happening in userspace).
> [...]

As I understand the situation, there is a complication here that you
haven't accounted for. Upon a normal syscall entry to the kernel, not
all user registers are saved explicitly for such easy retrieval. The
others may be spilled to the stack by gcc during the various sys_*
functions or elsewhere. It turns out that some of these saved
registers are sometimes necessary to accomplish a user-space unwind.

To recover these registers at run time, we found that the kernel stack
itself has to be partially unwound - and not via frame pointers, but
the full dwarf unwind/cfi machinery. This RFC code does not appear
aware of the difference between the explicitly saved and the
incidentally-spilled registers, and thus may accidentally pass garbage
data to perf userspace. Correcting this could require a kernel-space
libunwind.

- FChE


\
 
 \ /
  Last update: 2012-03-28 16:11    [W:0.163 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site