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]
Date:   Wed, 19 Aug 2020 07:57:34 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Edward Cree <ecree@...arflare.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Cc:     Michael Brown <mbrown@...systems.co.uk>,
        Solarflare linux maintainers <linux-net-drivers@...arflare.com>,
        Martin Habets <mhabets@...arflare.com>
Subject: Re: ethernet/sfc/ warnings with 32-bit dma_addr_t

On 8/19/20 3:37 AM, Edward Cree wrote:
> On 19/08/2020 01:28, Randy Dunlap wrote:
>> Hi,
>>
>> Does the drivers/net/ethernet/sfc/sfc driver require (expect)
>> dma_addr_t to be 64 bits (as opposed to 32 bits)?
>>
>> I see that several #defines in ef100_regs.h are 64...
>>
>> When used with DMA_BIT_MASK(64), does the value just need to be
>> truncated to 32 bits?  Will that work?
> As far as I can tell, truncation to 32 bits is harmless — the
>  called function (efx_init_io) already tries every mask from the
>  passed one down to 32 bits in case of PCIe hardware limitations.
> 
> The ef10 and siena versions also truncate like this (their
>  #defines are 48 and 46 respectively), but because they are
>  handled indirectly through efx_nic_type, the compiler isn't able
>  to determine this statically as it can with ef100.
>> When I build this driver on i386 with 32-bit dma_addr_t, I see
>> the following build warnings:
> Could you test whether explicitly casting to dma_addr_t suppresses
>  the warnings?  I.e.
> 
>     efx_init_io(efx, bar,
>                 (dma_addr_t)DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
>                 pci_resource_len(efx->pci_dev, bar));

Yes, that fixes the warnings.

thanks.
-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ