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:   Tue, 10 Apr 2018 14:28:04 -0700
From:   Alexei Starovoitov <ast@...com>
To:     Peter Zijlstra <peterz@...radead.org>, Yonghong Song <yhs@...com>
CC:     <mingo@...nel.org>, <daniel@...earbox.net>,
        <linux-kernel@...r.kernel.org>, <x86@...nel.org>,
        <kernel-team@...com>, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] x86/cpufeature: guard asm_volatile_goto usage with
 CC_HAVE_ASM_GOTO

On 4/10/18 2:07 PM, Peter Zijlstra wrote:
> On Tue, Apr 10, 2018 at 01:42:59PM -0700, Yonghong Song wrote:
>> Commit d0266046ad54 ("x86: Remove FAST_FEATURE_TESTS")
>> removed X86_FAST_FEATURE_TESTS and make macro static_cpu_has() always
>> use __always_inline function _static_cpu_has() funciton.
>> The static_cpu_has() uses gcc feature asm_volatile_goto construct,
>> which is not supported by clang.
>
> There will be more unconditional asm-goto usage, clang is in the process
> of growing asm-goto.

Eventually yes, but we need a solution today.
Right now all of bpf based tracing is broken because we have to
compile on the fly with clang.
Instead of
#ifdef CC_HAVE_ASM_GOTO
we can replace it with
#ifndef __BPF__
or some other name,
but it's more hacky, since we'd need add -D__BPF__ to samples/bpf
and to all other places that use native clang to compile.

Whereas with 'ifdef CC_HAVE_ASM_GOTO' everything works as-is.
Top kernel makefile defines it and kernel is still compiled with
asm-goto, whereas native clang path for the purpose of compiling
bpf progs doesn't have this define and also fine.

imo this patch is the best solution _today_.

bpf compilation needs kernel headers only. If later you add
unconditional asm-goto to .c, it's all fine.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ