From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Xu, Dongxiao" <dongxiao.xu@intel.com>
Cc: Jan Beulich <JBeulich@suse.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH] xen/swiotlb: Exchange to contiguous memory for map_sg hook
Date: Mon, 7 Jan 2013 10:55:03 -0500 [thread overview]
Message-ID: <20130107155503.GH3219@phenom.dumpdata.com> (raw)
In-Reply-To: <40776A41FC278F40B59438AD47D147A90FED9A52@SHSMSX102.ccr.corp.intel.com>
On Mon, Jan 07, 2013 at 07:17:33AM +0000, Xu, Dongxiao wrote:
> > -----Original Message-----
> > From: Jan Beulich [mailto:JBeulich@suse.com]
> > Sent: Thursday, December 20, 2012 4:56 PM
> > To: Xu, Dongxiao
> > Cc: xen-devel@lists.xen.org; Konrad Rzeszutek Wilk;
> > linux-kernel@vger.kernel.org
> > Subject: RE: [Xen-devel] [PATCH] xen/swiotlb: Exchange to contiguous memory
> > for map_sg hook
> >
> > >>> On 20.12.12 at 02:23, "Xu, Dongxiao" <dongxiao.xu@intel.com> wrote:
> > > Sorry, maybe I am still not describing this issue clearly.
> >
> > No, at least I understood you the way you re-describe below.
> >
> > > Take the libata case as an example, the static DMA buffer locates
> > > (dev->link->ap->sector_buf , here we use Data Structure B in the graph) in
> > > the following structure:
> > >
> > > -------------------------------------Page boundary
> > > <Data Structure A>
> > > <Data Structure B>
> > > -------------------------------------Page boundary
> > > <Data Structure B (cross page)>
> > > <Data Structure C>
> > > -------------------------------------Page boundary
> > >
> > > Where Structure B is our DMA target.
> > >
> > > For Data Structure B, we didn't care about the simultaneous access, either
> > > lock or sync function will take care of it.
> > > What we are not sure is "read/write of A and C from other processor". As we
> > > will have memory copy for the pages, and at the same time, other CPU may
> > > access A/C.
> >
> > The question is whether what libata does here is valid in the first
> > place - fill an SG list entry with something that crosses a page
> > boundary and is not a compound page.
>
> Sorry for the late response about this thread.
>
> To make sure I understand you correctly, so do you mean the correct fix should be applied to libata driver, and make sure it DMA from/to correct place (for example, some memory allocated by DMA API), but not such certain field in a static structure?
Or with baremetal swiotlb if the user booted with 'swiotlb=force'.
>
> If we fix it in device driver side, then we may not need to modify the xen-swiotlb part.
>
Correct. This is a bug in the device driver where it checks the contents of its buffer
_before_ doing an DMA unmap or DMA sync.
next prev parent reply other threads:[~2013-01-07 15:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-06 13:08 [PATCH] xen/swiotlb: Exchange to contiguous memory for map_sg hook Dongxiao Xu
2012-12-06 13:37 ` [Xen-devel] " Jan Beulich
2012-12-07 14:11 ` Konrad Rzeszutek Wilk
2012-12-07 14:08 ` Konrad Rzeszutek Wilk
2012-12-11 6:39 ` Xu, Dongxiao
2012-12-11 17:06 ` Konrad Rzeszutek Wilk
2012-12-12 1:03 ` Xu, Dongxiao
2012-12-12 9:38 ` [Xen-devel] " Jan Beulich
2012-12-19 20:09 ` Konrad Rzeszutek Wilk
2012-12-20 1:23 ` Xu, Dongxiao
2012-12-20 8:56 ` Jan Beulich
2013-01-07 7:17 ` Xu, Dongxiao
2013-01-07 8:46 ` Jan Beulich
2013-01-07 15:55 ` Konrad Rzeszutek Wilk [this message]
2012-12-13 16:34 ` Konrad Rzeszutek Wilk
-- strict thread matches above, loose matches on Subject: below --
2012-12-11 6:27 [Xen-devel] " Xu, Dongxiao
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=20130107155503.GH3219@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=JBeulich@suse.com \
--cc=dongxiao.xu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).