lkml.org 
[lkml]   [2021]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 1/3] MIPS: kernel: Support extracting off-line stack traces from user-space with perf
    From
    Date
    在 2021/1/4 下午6:59, Peter Zijlstra 写道:
    > On Tue, Dec 29, 2020 at 08:55:59PM +0800, Tiezhu Yang wrote:
    >> +u64 perf_reg_abi(struct task_struct *tsk)
    >> +{
    >> + if (test_tsk_thread_flag(tsk, TIF_32BIT_REGS))
    >> + return PERF_SAMPLE_REGS_ABI_32;
    >> + else
    >> + return PERF_SAMPLE_REGS_ABI_64;
    >> +}
    > So we recently changed this on x86 to not rely on TIF flags. IIRC the
    > problem is that on x86 you can change the mode of a task without the
    > kernel being aware of it. Is something like that possible on MIPS as
    > well?

    Hi all,

    In MIPS world it's impossible to raise a thread to 64bit without kernel
    aware.
    Without STATUS.UX set it will trigger reserved instruction exception
    when trying
    to run 64bit instructions.

    However it may be possible to run with 32bit ABI without TIF_32BIT_REGS
    if user
    program didn't get ELF ABI right. I think that's out of our current
    consideration.

    > The thing x86 does today is look at it's pt_regs state to determine the
    > actual state.
    It is possible to look at pt_regs Status.UX bit on MIPS. But it seems
    unnecessary
    as user can't change it.

    Thanks.

    - Jiaxun




    \
     
     \ /
      Last update: 2021-01-05 04:47    [W:5.227 / U:0.192 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site