From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>,
Tiezhu Yang <yangtiezhu@loongson.cn>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
Xuefeng Li <lixuefeng@loongson.cn>,
David Daney <david.daney@cavium.com>,
Ralf Baechle <ralf@linux-mips.org>,
Archer Yan <ayan@wavecomp.com>,
x86@kernel.org
Subject: Re: [PATCH 1/3] MIPS: kernel: Support extracting off-line stack traces from user-space with perf
Date: Wed, 27 Jan 2021 22:15:06 +0100 [thread overview]
Message-ID: <20210127211506.GA21163@alpha.franken.de> (raw)
In-Reply-To: <20210105101806.GG3040@hirez.programming.kicks-ass.net>
On Tue, Jan 05, 2021 at 11:18:06AM +0100, Peter Zijlstra wrote:
> On Tue, Jan 05, 2021 at 11:45:37AM +0800, Jiaxun Yang wrote:
> > 在 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.
>
> The other way around is the case on x86, a 64bit program can create and
> execute 32bit code sections without the kernel being aware. But if
> clearing STATUS.UX has the same issue as setting it, that should not be
> a problem for you.
>
> > 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.
>
> Fair enough.
>
> > > 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.
>
> Ok, good. Then no objection, proceed! :-)
this patch aims more to mips-next, while patch 2 and 3 are targeting
tools/perf. Should I take them into mips-next, too ?
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
next prev parent reply other threads:[~2021-01-27 21:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-29 12:55 [PATCH 0/3] Add some perf support for mips Tiezhu Yang
2020-12-29 12:55 ` [PATCH 1/3] MIPS: kernel: Support extracting off-line stack traces from user-space with perf Tiezhu Yang
2021-01-04 10:59 ` Peter Zijlstra
2021-01-05 3:45 ` Jiaxun Yang
2021-01-05 10:18 ` Peter Zijlstra
2021-01-27 21:15 ` Thomas Bogendoerfer [this message]
2021-01-29 2:48 ` Tiezhu Yang
2021-01-29 17:56 ` Arnaldo Carvalho de Melo
2021-01-29 17:58 ` Arnaldo Carvalho de Melo
2021-02-01 10:43 ` Thomas Bogendoerfer
2021-02-01 12:56 ` Tiezhu Yang
2021-02-03 10:40 ` Thomas Bogendoerfer
2021-02-03 13:12 ` Tiezhu Yang
2021-02-03 13:41 ` Thomas Bogendoerfer
2020-12-29 12:56 ` [PATCH 2/3] perf tools: Support mips unwinding and dwarf-regs Tiezhu Yang
2020-12-29 12:56 ` [PATCH 3/3] perf tools: Generate mips syscalls_n64.c syscall table Tiezhu Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210127211506.GA21163@alpha.franken.de \
--to=tsbogend@alpha.franken.de \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=ayan@wavecomp.com \
--cc=david.daney@cavium.com \
--cc=jiaxun.yang@flygoat.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=lixuefeng@loongson.cn \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=ralf@linux-mips.org \
--cc=x86@kernel.org \
--cc=yangtiezhu@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox