From: David Miller <davem@davemloft.net>
To: hagaya@mellanox.com
Cc: dledford@redhat.com, linux-rdma@vger.kernel.org,
netdev@vger.kernel.org, okaya@codeaurora.org,
timur@codeaurora.org, eli@mellanox.com, ogerlitz@mellanox.com,
eranbe@mellanox.com, yishaih@mellanox.com, talal@mellanox.com,
saeedm@mellanox.com
Subject: Re: [PATCH v2 net-next] net/mlx4: Avoid wrong virtual mappings
Date: Thu, 05 May 2016 23:22:39 -0400 (EDT) [thread overview]
Message-ID: <20160505.232239.927667859977554070.davem@davemloft.net> (raw)
In-Reply-To: <1462362615-20238-1-git-send-email-hagaya@mellanox.com>
From: Haggai Abramovsky <hagaya@mellanox.com>
Date: Wed, 4 May 2016 14:50:15 +0300
> 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>
Applied, thanks.
prev parent reply other threads:[~2016-05-06 3:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-04 11:50 [PATCH v2 net-next] net/mlx4: Avoid wrong virtual mappings Haggai Abramovsky
2016-05-06 3:22 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160505.232239.927667859977554070.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dledford@redhat.com \
--cc=eli@mellanox.com \
--cc=eranbe@mellanox.com \
--cc=hagaya@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=okaya@codeaurora.org \
--cc=saeedm@mellanox.com \
--cc=talal@mellanox.com \
--cc=timur@codeaurora.org \
--cc=yishaih@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).