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:   Tue, 3 Oct 2017 14:50:00 -0700
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     Matthias Kaehlcke <mka@...omium.org>
Cc:     "David S . Miller" <davem@...emloft.net>,
        Simon Horman <simon.horman@...ronome.com>,
        Dirk van der Merwe <dirk.vandermerwe@...ronome.com>,
        oss-drivers@...ronome.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Renato Golin <renato.golin@...aro.org>,
        Manoj Gupta <manojgupta@...omium.org>,
        Guenter Roeck <groeck@...omium.org>,
        Doug Anderson <dianders@...omium.org>
Subject: Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

On Tue,  3 Oct 2017 13:05:46 -0700, Matthias Kaehlcke wrote:
> nfp_eth_set_bit_config() is marked as __always_inline to allow gcc to
> identify the 'mask' parameter as known to be constant at compile time,
> which is required to use the FIELD_GET() macro.
> 
> The forced inlining does the trick for gcc, but for kernel builds with
> clang it results in undefined symbols:
> 
> drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.o: In function
>   `__nfp_eth_set_aneg':
> drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c:(.text+0x787):
>   undefined reference to `__compiletime_assert_492'
> drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c:(.text+0x7b1):
>   undefined reference to `__compiletime_assert_496'
> 
> These __compiletime_assert_xyx() calls would have been optimized away if
> the compiler had seen 'mask' as a constant.
> 
> Convert nfp_eth_set_bit_config() into a macro, which allows both gcc and
> clang to identify 'mask' as a compile time constant.
> 
> Signed-off-by: Matthias Kaehlcke <mka@...omium.org>

:(

Is there no chance of fixing the constant propagation in the compiler?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ