• Zachary Amsden's avatar
    [PATCH] i386: Profile pc badness · 7b355202
    Zachary Amsden authored
    Profile_pc was broken when using paravirtualization because the
    assumption the kernel was running at CPL 0 was violated, causing
    bad logic to read a random value off the stack.
    
    The only way to be in kernel lock functions is to be in kernel
    code, so validate that assumption explicitly by checking the CS
    value.  We don't want to be fooled by BIOS / APM segments and
    try to read those stacks, so only match KERNEL_CS.
    
    I moved some stuff in segment.h to make it prettier.
    Signed-off-by: default avatarZachary Amsden <zach@vmware.com>
    Signed-off-by: default avatarAndi Kleen <ak@suse.de>
    7b355202
ptrace.h 1.44 KB