From: Leonard Crestez <leonard.crestez@nxp.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
Greg KH <gregkh@linuxfoundation.org>
Cc: <stable@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<julien.grall@arm.com>, <jgross@suse.com>,
<boris.ostrovsky@oracle.com>
Subject: Re: [BACKPORT] swiotlb-xen: implement xen_swiotlb_dma_mmap callback
Date: Wed, 20 Sep 2017 13:18:35 +0300 [thread overview]
Message-ID: <1505902715.29684.34.camel@nxp.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1709181053590.9439@sstabellini-ThinkPad-X260>
On Mon, 2017-09-18 at 11:08 -0700, Stefano Stabellini wrote:
On Fri, 15 Sep 2017, Greg KH wrote:
> On Thu, Sep 14, 2017 at 04:23:05PM -0700, Stefano Stabellini wrote:
> > Hi all,
> >
> > We are getting reports from Xen on ARM users about DMA issues. The
> > problem is that the commit below
> > (7e91c7df29b5e196de3dc6f086c8937973bd0b88) is necessary to support mmap
> > on Xen on ARM. It is self-contained and doesn't affect anything outside
> > of Xen on ARM, so I think is a good candidate for backporting. It went
> > upstream in 4.11.
>
> But it's a new feature, right? How does that fit the stable kernel
> rules?
It implements a previously unimplemented function (mmap), although it
calls the generic functions to do it. Yes, I agree with you that it
can be classified as a new feature. If that is against the stable kernel
rules, then please discard this request.
FYI the reason why it didn't raise a flag in my mind is that users
reported something like "unhandled alignment fault (11) at
0xffffa6048080, esr 0x92000061", which really looks more like a bug.
I am the one who reported this, on the #xenarm IRC channel.
Not implementing mmap in dma_map_ops means that dma_common_mmap is
called by dma_map_attrs as a fallback. The end result is not something
like -ENOSYS but what seem to be corrupt mappings.
However I agree that backporting might be excessive. I ran into this by
experimenting with using a GPU from dom0. It seems reasonable to get
kernel crashes if you try this kind of stuff.
This patch results in calling __swiotlb_mmap instead of
dma_common_mmap. I don't know the implementation details of the DMA api
but the interesting difference between these paths seems to be the way
pfn is fetched (from dma_addr instead of the kernel virt addr).
--
Regards,
Leonard
next prev parent reply other threads:[~2017-09-20 10:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-14 23:23 [BACKPORT] swiotlb-xen: implement xen_swiotlb_dma_mmap callback Stefano Stabellini
2017-09-16 1:23 ` Greg KH
2017-09-18 18:08 ` Stefano Stabellini
2017-09-18 18:55 ` Boris Ostrovsky
2017-09-19 21:55 ` Stefano Stabellini
2017-09-20 10:18 ` Leonard Crestez [this message]
2017-09-21 0:36 ` Stefano Stabellini
2017-09-22 12:15 ` Juergen Gross
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=1505902715.29684.34.camel@nxp.com \
--to=leonard.crestez@nxp.com \
--cc=boris.ostrovsky@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=jgross@suse.com \
--cc=julien.grall@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sstabellini@kernel.org \
--cc=stable@vger.kernel.org \
/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