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
| ||
|
Date: Wed, 19 Aug 2020 11:37:00 +0100 From: Edward Cree <ecree@...arflare.com> To: Randy Dunlap <rdunlap@...radead.org>, "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 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)); -ed
Powered by blists - more mailing lists