diff options
author | Haggai Abramovsky <hagaya@mellanox.com> | 2016-05-04 11:50:15 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-06 03:23:05 (GMT) |
commit | 73898db0430125606c86c798c0627aefef9af9ed (patch) | |
tree | 030372ba2bcf54a7d2ce4e0f0388bd41f03d0a6c /tools | |
parent | 035cd6ba53eff060760c4f4d11339fcc916a967c (diff) | |
download | linux-73898db0430125606c86c798c0627aefef9af9ed.tar.xz |
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>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions