lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 17 Apr 2019 21:15:48 -0500
From:   Josh Poimboeuf <jpoimboe@...hat.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Kairui Song <kasong@...hat.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Borislav Petkov <bp@...en8.de>, Dave Young <dyoung@...hat.com>
Subject: Re: [RFC PATCH v2] perf/x86: make perf callchain work without
 CONFIG_FRAME_POINTER

On Wed, Apr 17, 2019 at 09:07:35AM +0200, Peter Zijlstra wrote:
> On Tue, Apr 16, 2019 at 03:15:59PM -0500, Josh Poimboeuf wrote:
> > If you do the regs->eflags thing to mark the regs as fake in
> > (perf_arch_fetch_caller_regs()), then I don't think skip_sp would be
> > needed, because regs->sp could probably mark the skip point.
> > 
> > Instead I was actually hoping we could get rid of fake regs and
> > perf_arch_fetch_caller_regs() altogether, because it's a nasty hack.
> > But I don't know what else those fake regs are used for.
> 
> This is the generic perf generate a sample path. It doesn't know the
> context. Normally it is an interrupt or exception of sorts and we simply
> pass the pt_regs from that down the chain and all is good.
> 
> It is just for a few software events, such as SW_CONTEXT_SWITCH,
> SW_MIGRATIONS and all the TP muck that we do not have regs to pass down.
> 
> These regs are used by:
> 
>  - SAMPLE_IP,
>  - SAMPLE_CALLCHAIN (this here issue),
>  - SAMPLE_REGS_INTR,
>  - a few misc bits
> 
> There's actually comment on top of perf_fetch_caller_regs() that tries
> to explain what is needed -- although I suppose that could do with an
> update.

Ok, I guess it makes a little more sense now to my perf-ignorant brain.
An improved comment would definitely help.

Sounds like using a reserved regs->flags bit to indicate fake regs is
the way to go.

-- 
Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ