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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 18 Aug 2020 17:28:24 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Cc:     Michael Brown <mbrown@...systems.co.uk>,
        Solarflare linux maintainers <linux-net-drivers@...arflare.com>,
        Edward Cree <ecree@...arflare.com>,
        Martin Habets <mhabets@...arflare.com>
Subject: ethernet/sfc/ warnings with 32-bit dma_addr_t

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?


When I build this driver on i386 with 32-bit dma_addr_t, I see
the following build warnings:


  CC      drivers/net/ethernet/sfc/ef100.o
In file included from ../include/linux/skbuff.h:31:0,
                 from ../include/linux/if_ether.h:19,
                 from ../include/uapi/linux/ethtool.h:19,
                 from ../include/linux/ethtool.h:18,
                 from ../include/linux/netdevice.h:37,
                 from ../drivers/net/ethernet/sfc/net_driver.h:13,
                 from ../drivers/net/ethernet/sfc/ef100.c:12:
../drivers/net/ethernet/sfc/ef100.c: In function ‘ef100_pci_parse_continue_entry’:
../include/linux/dma-mapping.h:139:25: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                         ^
../drivers/net/ethernet/sfc/ef100.c:145:6: note: in expansion of macro ‘DMA_BIT_MASK’
      DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
      ^~~~~~~~~~~~
../include/linux/dma-mapping.h:139:25: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                         ^
../drivers/net/ethernet/sfc/ef100.c:163:6: note: in expansion of macro ‘DMA_BIT_MASK’
      DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
      ^~~~~~~~~~~~
../drivers/net/ethernet/sfc/ef100.c: In function ‘ef100_pci_parse_xilinx_cap’:
../include/linux/dma-mapping.h:139:25: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                         ^
../drivers/net/ethernet/sfc/ef100.c:337:5: note: in expansion of macro ‘DMA_BIT_MASK’
     DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
     ^~~~~~~~~~~~
../drivers/net/ethernet/sfc/ef100.c: In function ‘ef100_pci_probe’:
../include/linux/dma-mapping.h:139:25: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                         ^
../drivers/net/ethernet/sfc/ef100.c:498:5: note: in expansion of macro ‘DMA_BIT_MASK’
     DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
     ^~~~~~~~~~~~


thanks.
-- 
~Randy

Powered by blists - more mailing lists