From: Jason Gunthorpe <jgg@nvidia.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Leon Romanovsky <leon@kernel.org>,
Doug Ledford <dledford@redhat.com>,
Yishai Hadas <yishaih@mellanox.com>, <linux-rdma@vger.kernel.org>
Subject: Re: [PATCH rdma-next 1/4] IB/core: Improve ODP to use hmm_range_fault()
Date: Wed, 16 Sep 2020 14:21:00 -0300 [thread overview]
Message-ID: <20200916172100.GE3699@nvidia.com> (raw)
In-Reply-To: <20200916164516.GA11582@infradead.org>
On Wed, Sep 16, 2020 at 05:45:16PM +0100, Christoph Hellwig wrote:
> Note that 0 is a valid DMA address. I think due the access bit this
> works, but it is a little subtle..
It should be checked again carefully.. This looks a bit questionable
if the flags are what makes it work:
+ dma_addr = dma & ODP_DMA_ADDR_MASK;
+ if (dma_addr) {
> But more importantly except for (dma_addr_t)-1 (DMA_MAPPING_ERROR)
> all dma_addr_t values are valid, so taking more than a single bit
> from a dma_addr_t is not strictly speaking correct.
This is the result of dma_map_page(). The HW requires that
dma_map_page(page_size) returns a DMA address that is page_size
aligned, even for huge pages.
So at least the last 12 bits of the DMA address are always 0, they can
be used for flags. This is also the HW representation in the page
table.
Last time you pointed at this code you agreed this alignment was met,
is it still OK?
Jason
next prev parent reply other threads:[~2020-09-16 20:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-14 11:39 [PATCH rdma-next 0/4] Improve ODP by using HMM API Leon Romanovsky
2020-09-14 11:39 ` [PATCH rdma-next 1/4] IB/core: Improve ODP to use hmm_range_fault() Leon Romanovsky
2020-09-16 16:45 ` Christoph Hellwig
2020-09-16 17:21 ` Jason Gunthorpe [this message]
2020-09-16 17:22 ` Christoph Hellwig
2020-09-17 10:01 ` Yishai Hadas
2020-09-17 9:54 ` Yishai Hadas
2020-09-14 11:39 ` [PATCH rdma-next 2/4] IB/core: Enable ODP sync without faulting Leon Romanovsky
2020-09-16 16:47 ` Christoph Hellwig
2020-09-16 18:19 ` Leon Romanovsky
2020-09-16 18:25 ` Christoph Hellwig
2020-09-16 18:30 ` Leon Romanovsky
2020-09-17 10:05 ` Yishai Hadas
2020-09-14 11:39 ` [PATCH rdma-next 3/4] RDMA/mlx5: Extend advice MR to support non faulting mode Leon Romanovsky
2020-09-14 11:39 ` [PATCH rdma-next 4/4] RDMA/mlx5: Sync device with CPU pages upon ODP MR registration Leon Romanovsky
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=20200916172100.GE3699@nvidia.com \
--to=jgg@nvidia.com \
--cc=dledford@redhat.com \
--cc=hch@infradead.org \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.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).