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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 26 Nov 2016 09:32:29 -0800
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Wang Nan <wangnan0@...wei.com>
Cc:     acme@...hat.com, ast@...com, lizefan@...wei.com,
        hekuang@...wei.com, linux-kernel@...r.kernel.org, pi3orama@....com,
        joe@....org, Jiri Olsa <jolsa@...nel.org>
Subject: Re: [PATCH v3 19/30] perf clang jit: Insignt BPF and JIT functions
 in a Module

On Sat, Nov 26, 2016 at 07:03:43AM +0000, Wang Nan wrote:
> Identify BPF functions, JIT functions and maps during init. Functions in
> section starting with "perfhook:" are JIT functions. They will be JIT
> compiled and hooked at perfhooks.
> 
> During init of PerfModule, mark JIT functions as AvailableExternallyLinkage.
> LLVM skips functions with linkage like this so they won't be compiled
> into BPF objects.
> 
> Signed-off-by: Wang Nan <wangnan0@...wei.com>
...
> +void PerfModule::prepareBPF(void)
> +{
> +	for (llvm::Function *F : JITFunctions)
> +		F->setLinkage(llvm::GlobalValue::AvailableExternallyLinkage);
> +	for (llvm::Function *F : BPFFunctions)
> +		F->setLinkage(llvm::GlobalValue::ExternalLinkage);
> +
> +}
> +
> +void PerfModule::prepareJIT(void)
> +{
> +	for (llvm::Function *F : BPFFunctions)
> +		F->setLinkage(llvm::GlobalValue::AvailableExternallyLinkage);
> +	for (llvm::Function *F : JITFunctions)
> +		F->setLinkage(llvm::GlobalValue::ExternalLinkage);
> +
> +}

Nice trick.
Please document it in the perf+llvm design doc.

Acked-by: Alexei Starovoitov <ast@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ