lkml.org 
[lkml]   [2012]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:perf/core] perf/x86: Fix USER/KERNEL tagging of samples

* Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:

> > > +static unsigned long code_segment_base(struct pt_regs *regs)
> > > +{
> > > +#ifdef CONFIG_32BIT
> > > + if (user_mode(regs) && regs->cs != __USER_CS)
> > > + return get_segment_base(regs->cs);
> > > +#else
> > > + if (test_thread_flag(TIF_IA32)) {
> > > + if (user_mode(regs) && regs->cs != __USER32_CS)
> > > + return get_segment_base(regs->cs);
> > > + }
> > > +#endif
> > > + return 0;
> > > +}
> >
> > Will this do the right thing for x32 mode?
>
> hpa? It looks like x32 has TIF_X32, but from the kernel's POV
> its really just another 64bit process, so as long as we don't
> trigger the TIF_IA32 case we'll just return 0.

Maybe add that as a comment or so, to stop future wondering.
Maybe list all the states an x86 process can be in, and describe
what we intend to do for each. That will make it easier to match
up intent with actual code and will make it easier to keep it
correct in the future as well.

> set_personality_ia32() looks like TIF_IA32 and TIF_X32 are
> mutually exclusive, so I think we do the right thing.

Ok.

Thanks,

Ingo


\
 
 \ /
  Last update: 2012-07-10 10:41    [W:0.072 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site