linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Ingo Molnar <mingo@redhat.com>,
	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: Fri, 29 Jan 2021 14:56:10 -0300	[thread overview]
Message-ID: <20210129175610.GC794568@kernel.org> (raw)
In-Reply-To: <d2035b91-bcb9-bde4-8009-d81d177b2317@loongson.cn>

Em Fri, Jan 29, 2021 at 10:48:52AM +0800, Tiezhu Yang escreveu:
> On 01/28/2021 05:15 AM, Thomas Bogendoerfer wrote:
> > 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 ?
> 
> If it is possible, I prefer to merge this three patches together
> through mips-next tree.

The kernel part should go via the mips-next tree, the tooling I can
process, that is how these things go in other cases where kernel and
tooling changes for some new feature are needed.

This helps making sure tooling is not in lockstep with the kernel, one
should be able to use a new tool in an old kernel and vice-versa.

- Arnaldo

  reply	other threads:[~2021-01-29 17:56 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
2021-01-29  2:48           ` Tiezhu Yang
2021-01-29 17:56             ` Arnaldo Carvalho de Melo [this message]
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=20210129175610.GC794568@kernel.org \
    --to=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=tsbogend@alpha.franken.de \
    --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;
as well as URLs for NNTP newsgroup(s).