OpenCloudOS-Kernel/include/linux/mlx4
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
..
cmd.h IB/mlx4: Add support for setting RoCEv2 gids in hardware 2016-01-19 15:35:00 -05:00
cq.h net/mlx4_en: Add support for hardware accelerated 802.1ad vlan 2015-07-27 15:00:37 -07:00
device.h net/mlx4: Avoid wrong virtual mappings 2016-05-05 23:23:05 -04:00
doorbell.h
driver.h mlx4: Implement devlink interface 2016-03-01 16:07:29 -05:00
qp.h IB/mlx4: Support modify_qp for RoCE v2 2016-01-19 15:35:01 -05:00
srq.h mlx4_core: Implement SRQ object lookup from srqn 2013-04-16 22:42:55 -07:00