linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: "Jesper Dangaard Brouer" <brouer@redhat.com>,
	netdev@vger.kernel.org, linux-mm@kvack.org,
	"Toke Høiland-Jørgensen" <toke@toke.dk>,
	"Ilias Apalodimas" <ilias.apalodimas@linaro.org>,
	"Saeed Mahameed" <saeedm@mellanox.com>,
	"Alexander Duyck" <alexander.duyck@gmail.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	mgorman@techsingularity.net,
	"David S. Miller" <davem@davemloft.net>,
	"Tariq Toukan" <tariqt@mellanox.com>
Subject: Re: [net-next PATCH V3 1/3] mm: add dma_addr_t to struct page
Date: Tue, 28 Apr 2020 18:54:22 -0700	[thread overview]
Message-ID: <20200429015422.GQ29705@bombadil.infradead.org> (raw)
In-Reply-To: <20200429003843.rh2pasek7v5o3h63@box>

On Wed, Apr 29, 2020 at 03:38:43AM +0300, Kirill A. Shutemov wrote:
> On Wed, Feb 13, 2019 at 02:55:40AM +0100, Jesper Dangaard Brouer wrote:
> > The page_pool API is using page->private to store DMA addresses.
> > As pointed out by David Miller we can't use that on 32-bit architectures
> > with 64-bit DMA
> > +		struct {	/* page_pool used by netstack */
> > +			/**
> > +			 * @dma_addr: might require a 64-bit value even on
> > +			 * 32-bit architectures.
> > +			 */
> > +			dma_addr_t dma_addr;
> > +		};
> 
> [ I'm slow, but I've just noticed this change into struct page. ]
> 
> Is there a change that the dma_addr would have bit 0 set? If yes it may
> lead to false-positive PageTail() and really strange behaviour.

No.  It's the DMA address of the page, so it's going to be page aligned
and have the bottom 12 (or so) bits cleared.  It's not feasible for some
wacky IOMMU to use the bottom N bits for its own purposes because you can,
say, add three to the DMA address of the page and expect the device to
DMA to the third byte within the page.

Wacky IOMMUs use the top bits for storing "interesting" information.



  reply	other threads:[~2020-04-29  1:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-13  1:55 [net-next PATCH V3 0/3] Fix page_pool API and dma address storage Jesper Dangaard Brouer
2019-02-13  1:55 ` [net-next PATCH V3 1/3] mm: add dma_addr_t to struct page Jesper Dangaard Brouer
2020-04-29  0:38   ` Kirill A. Shutemov
2020-04-29  1:54     ` Matthew Wilcox [this message]
2019-02-13  1:55 ` [net-next PATCH V3 2/3] net: page_pool: don't use page->private to store dma_addr_t Jesper Dangaard Brouer
2019-02-13  1:55 ` [net-next PATCH V3 3/3] page_pool: use DMA_ATTR_SKIP_CPU_SYNC for DMA mappings Jesper Dangaard Brouer

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=20200429015422.GQ29705@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.duyck@gmail.com \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=ilias.apalodimas@linaro.org \
    --cc=kirill@shutemov.name \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    --cc=tariqt@mellanox.com \
    --cc=toke@toke.dk \
    /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).