2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 20:53:53 +08:00
linux-next/drivers/infiniband/hw
Haggai Abramovsky 73898db043 net/mlx4: Avoid wrong virtual mappings
The dma_alloc_coherent() function returns a virtual address which can
be used for coherent access to the underlying memory.  On some
architectures, like arm64, undefined behavior results if this memory is
also accessed via virtual mappings that are not coherent.  Because of
their undefined nature, operations like virt_to_page() return garbage
when passed virtual addresses obtained from dma_alloc_coherent().  Any
subsequent mappings via vmap() of the garbage page values are unusable
and result in bad things like bus errors (synchronous aborts in ARM64
speak).

The mlx4 driver contains code that does the equivalent of:
vmap(virt_to_page(dma_alloc_coherent)), this results in an OOPs when the
device is opened.

Prevent Ethernet driver to run this problematic code by forcing it to
allocate contiguous memory. As for the Infiniband driver, at first we
are trying to allocate contiguous memory, but in case of failure roll
back to work with fragmented memory.

Signed-off-by: Haggai Abramovsky <hagaya@mellanox.com>
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Reported-by: David Daney <david.daney@cavium.com>
Tested-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-05-05 23:23:05 -04:00
..
cxgb3 iw_cxgb3: initialize ibdev.iwcm->ifname for port mapping 2016-04-26 12:46:54 -04:00
cxgb4 RDMA/iw_cxgb4: Fix bar2 virt addr calculation for T4 chips 2016-04-26 12:47:09 -04:00
i40iw i40iw: avoid potential uninitialized variable use 2016-04-06 10:37:16 -04:00
mlx4 net/mlx4: Avoid wrong virtual mappings 2016-05-05 23:23:05 -04:00
mlx5 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-05-04 00:52:29 -04:00
mthca mm/gup: Switch all callers of get_user_pages() to not pass tsk/mm 2016-02-16 10:11:12 +01:00
nes treewide: replace dev->trans_start update with helper 2016-05-04 14:16:49 -04:00
ocrdma IB/ocrdma: Skip using unneeded intermediate variable 2016-03-03 13:33:22 -05:00
qib IB/security: Restrict use of the write() interface 2016-04-28 12:03:16 -04:00
usnic Merge branch 'mm-pkeys-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-03-20 19:08:56 -07:00
Makefile i40iw: changes for build of i40iw module 2016-03-16 13:50:54 -04:00