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] [day] [month] [year] [list]
Message-ID: <e7c934d7-e5f4-ee1b-0647-c31a98d9e944@oracle.com>
Date:   Wed, 7 Feb 2018 09:02:17 -0800
From:   Shannon Nelson <shannon.nelson@...cle.com>
To:     James Hogan <jhogan@...nel.org>,
        Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Cc:     davem@...emloft.net, Alice Michael <alice.michael@...el.com>,
        netdev@...r.kernel.org, nhorman@...hat.com, sassmann@...hat.com,
        jogreene@...hat.com, Ralf Baechle <ralf@...ux-mips.org>,
        linux-mips@...ux-mips.org
Subject: Re: [net-next,06/15] i40e: change flags to use 64 bits

On 2/7/2018 7:09 AM, James Hogan wrote:
> On Fri, Jan 26, 2018 at 01:24:50PM -0800, Jeff Kirsher wrote:
>> From: Alice Michael <alice.michael@...el.com>
>>
>> As we have added more flags, we need to now use more
>> bits and have over flooded the 32 bit size.  So
>> make it 64.
>>
>> Also change all the existing bits to unsigned long long
>> bits.
>>
>> Signed-off-by: Alice Michael <alice.michael@...el.com>
>> Tested-by: Andrew Bowers <andrewx.bowers@...el.com>
>> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
>> ---
>>   drivers/net/ethernet/intel/i40e/i40e.h         | 67 +++++++++++++-------------
>>   drivers/net/ethernet/intel/i40e/i40e_ethtool.c |  4 +-
>>   2 files changed, 36 insertions(+), 35 deletions(-)
> 
> ...
> 
>> @@ -4323,7 +4323,7 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
>>   	 * originally. We'll just punt with an error and log something in the
>>   	 * message buffer.
>>   	 */
>> -	if (cmpxchg(&pf->flags, orig_flags, new_flags) != orig_flags) {
>> +	if (cmpxchg64(&pf->flags, orig_flags, new_flags) != orig_flags) {
> 
> This breaks allyesconfig builds on certain architectures, for example
> MIPS 32-bit with SMP enabled, which doesn't support cmpxchg64:
> 
>    CC      drivers/net/ethernet/intel/i40e/i40e_ethtool.o
> drivers/net/ethernet/intel/i40e/i40e_ethtool.c: In function ‘i40e_set_priv_flags’:
> drivers/net/ethernet/intel/i40e/i40e_ethtool.c:4326:6: error: implicit declaration of function ‘cmpxchg64’; did you mean ‘__cmpxchg’? [-Werror=implicit-function-declaration]
>    if (cmpxchg64(&pf->flags, orig_flags, new_flags) != orig_flags) {
>        ^~~~~~~~~
>        __cmpxchg
> 
> Should the driver now depend on 64BIT or something?

A long time ago this was the original expectation for this driver, but 
it was strongly suggested that in order to play well in the kernel it 
needed to be usable in 32-bit builds as well.  I suspect this sentiment 
remains, and besides we don't want to break existing support, so this 
probably needs to be addressed for 32-bit.

sln

> 
> Cheers
> James
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ