From: Jason Gunthorpe <jgg@ziepe.ca>
To: Alan Mikhak <alan.mikhak@sifive.com>
Cc: linux-kernel@vger.kernel.org, martin.petersen@oracle.com,
alexios.zavras@intel.com, ming.lei@redhat.com,
gregkh@linuxfoundation.org, tglx@linutronix.de,
christophe.leroy@c-s.fr, Palmer Dabbelt <palmer@sifive.com>,
Paul Walmsley <paul.walmsley@sifive.com>
Subject: Re: [PATCH] scatterlist: Validate page before calling PageSlab()
Date: Tue, 1 Oct 2019 14:43:58 -0300 [thread overview]
Message-ID: <20191001174358.GG22532@ziepe.ca> (raw)
In-Reply-To: <CABEDWGyDh6t2t9UXpw=tu1f6Sz=3YTMH6mG05cSTz74zyR9H+A@mail.gmail.com>
On Tue, Oct 01, 2019 at 10:26:38AM -0700, Alan Mikhak wrote:
> > > Cost of adding page structs to a large PCI I/O address range can be
> > > quite substantial. Allowing PCI I/O pages without page structs may be
> > > desirable. Perhaps it is worth considering this cost.
> >
> > This is generally agreed, but nobody has figured out a solution.
> >
> > > Scatterlist has no problem doing its memcpy() from pages without a
> > > page struct that were obtained from ioremap(). It is only at
> >
> > Calling memcpy on pointers from ioremap is very much not allowed. Code
> > has to use the iomem safe memcpy.
>
> Is it in the realm of possible to add support for such PCI I/O pages
> to scatterlist? Perhaps some solution is possible by adding a new
> function, say sg_set_iomem_page(), and a new SG_MITER_IOMEM flag that
> tells scatterlist to use iomem safe memcpy functions when the page is
> not backed by page struct because it was obtained from ioremap(). This
> flag can also be used at sg_miter_stop() to not call PageSlab() or
> flush_kernel_dcache_page().
People have tried many different things so far, it is more comple than
just the copy functions as there is also sg_page to worry about.
> If supporting PCI I/O pages is not possible, would it be possible to
> check for invalid page pointers in sg_set_page() and communicate the
> requirement for a page struct backing in its description?
Clarifying the comments seems reasonable to me.
Jason
next prev parent reply other threads:[~2019-10-01 17:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-30 23:22 Alan Mikhak
2019-10-01 12:16 ` Jason Gunthorpe
2019-10-01 17:09 ` Alan Mikhak
2019-10-01 17:12 ` Jason Gunthorpe
2019-10-01 17:26 ` Alan Mikhak
2019-10-01 17:43 ` Jason Gunthorpe [this message]
2019-10-01 17:46 ` Alan Mikhak
2019-10-07 6:12 ` Christoph Hellwig
2019-10-07 6:13 ` Christoph Hellwig
2019-10-07 16:44 ` Alan Mikhak
2019-10-07 21:13 ` Alan Mikhak
2019-10-15 9:55 ` Christoph Hellwig
2019-10-15 16:12 ` Logan Gunthorpe
2019-10-15 19:02 ` Alan Mikhak
2019-10-15 17:40 ` Alan Mikhak
2019-10-15 17:45 ` Logan Gunthorpe
2019-10-15 18:11 ` Alan Mikhak
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=20191001174358.GG22532@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=alan.mikhak@sifive.com \
--cc=alexios.zavras@intel.com \
--cc=christophe.leroy@c-s.fr \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ming.lei@redhat.com \
--cc=palmer@sifive.com \
--cc=paul.walmsley@sifive.com \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®