* dma-debug: check_for_stack background?
@ 2009-06-14 18:56 Stefan Richter
2009-06-14 21:20 ` Ben Dooks
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Richter @ 2009-06-14 18:56 UTC (permalink / raw)
To: linux-kernel; +Cc: Joerg Roedel
Hi,
it took a while but I finally noticed that the DMA debug facility warns
about mappings of on-stack memory. What's the problem with that? Are
there architectures which don't support such mappings, or is it a
question of caution not to DMA-map the stack?
--
Stefan Richter
-=====-==--= -==- -===-
http://arcgraph.de/sr/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: dma-debug: check_for_stack background?
2009-06-14 18:56 dma-debug: check_for_stack background? Stefan Richter
@ 2009-06-14 21:20 ` Ben Dooks
2009-06-14 21:43 ` Stefan Richter
0 siblings, 1 reply; 7+ messages in thread
From: Ben Dooks @ 2009-06-14 21:20 UTC (permalink / raw)
To: Stefan Richter; +Cc: linux-kernel, Joerg Roedel
On Sun, Jun 14, 2009 at 08:56:29PM +0200, Stefan Richter wrote:
> Hi,
>
> it took a while but I finally noticed that the DMA debug facility warns
> about mappings of on-stack memory. What's the problem with that? Are
> there architectures which don't support such mappings, or is it a
> question of caution not to DMA-map the stack?
I'm not sure if it is possible on all architectures, however the
DMA mapping documentation prohibts the use of stack memory.
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: dma-debug: check_for_stack background?
2009-06-14 21:20 ` Ben Dooks
@ 2009-06-14 21:43 ` Stefan Richter
2009-06-15 8:13 ` Joerg Roedel
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Richter @ 2009-06-14 21:43 UTC (permalink / raw)
To: Ben Dooks; +Cc: linux-kernel, Joerg Roedel
Ben Dooks wrote:
> On Sun, Jun 14, 2009 at 08:56:29PM +0200, Stefan Richter wrote:
>> the DMA debug facility warns
>> about mappings of on-stack memory. What's the problem with that?
...
> I'm not sure if it is possible on all architectures, however the
> DMA mapping documentation prohibts the use of stack memory.
Ah, it has all been documented in plain sight for ages. Thanks for the
pointer.
--
Stefan Richter
-=====-==--= -==- -===-
http://arcgraph.de/sr/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: dma-debug: check_for_stack background?
2009-06-14 21:43 ` Stefan Richter
@ 2009-06-15 8:13 ` Joerg Roedel
2009-06-16 6:16 ` FUJITA Tomonori
0 siblings, 1 reply; 7+ messages in thread
From: Joerg Roedel @ 2009-06-15 8:13 UTC (permalink / raw)
To: Stefan Richter; +Cc: Ben Dooks, linux-kernel
On Sun, Jun 14, 2009 at 11:43:42PM +0200, Stefan Richter wrote:
> Ben Dooks wrote:
>> On Sun, Jun 14, 2009 at 08:56:29PM +0200, Stefan Richter wrote:
>>> the DMA debug facility warns about mappings of on-stack memory.
>>> What's the problem with that?
> ...
>> I'm not sure if it is possible on all architectures, however the
>> DMA mapping documentation prohibts the use of stack memory.
>
> Ah, it has all been documented in plain sight for ages. Thanks for the
> pointer.
Problem is that the stack might go away or could be otherwise reused
while the DMA is in-flight. This could cause really hard to debug
problems.
Joerg
--
| Advanced Micro Devices GmbH
Operating | Karl-Hammerschmidt-Str. 34, 85609 Dornach bei München
System |
Research | Geschäftsführer: Thomas M. McCoy, Giuliano Meroni
Center | Sitz: Dornach, Gemeinde Aschheim, Landkreis München
| Registergericht München, HRB Nr. 43632
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: dma-debug: check_for_stack background?
2009-06-15 8:13 ` Joerg Roedel
@ 2009-06-16 6:16 ` FUJITA Tomonori
2009-06-16 6:41 ` Ming Lei
2009-06-16 8:14 ` Joerg Roedel
0 siblings, 2 replies; 7+ messages in thread
From: FUJITA Tomonori @ 2009-06-16 6:16 UTC (permalink / raw)
To: joerg.roedel; +Cc: stefanr, ben-linux, linux-kernel
On Mon, 15 Jun 2009 10:13:55 +0200
Joerg Roedel <joerg.roedel@amd.com> wrote:
> On Sun, Jun 14, 2009 at 11:43:42PM +0200, Stefan Richter wrote:
> > Ben Dooks wrote:
> >> On Sun, Jun 14, 2009 at 08:56:29PM +0200, Stefan Richter wrote:
> >>> the DMA debug facility warns about mappings of on-stack memory.
> >>> What's the problem with that?
> > ...
> >> I'm not sure if it is possible on all architectures, however the
> >> DMA mapping documentation prohibts the use of stack memory.
> >
> > Ah, it has all been documented in plain sight for ages. Thanks for the
> > pointer.
>
> Problem is that the stack might go away or could be otherwise reused
> while the DMA is in-flight. This could cause really hard to debug
> problems.
Not true. Even if you use the stack buffer for DMA synchronously, it
doesn't work (we had the bad code like starting dma and waiting for
the completion).
On some architectures, we can't use the stack buffer for DMA. That's
why the DMA mapping documentation prohibits the use of stack memory
for DMA.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: dma-debug: check_for_stack background?
2009-06-16 6:16 ` FUJITA Tomonori
@ 2009-06-16 6:41 ` Ming Lei
2009-06-16 8:14 ` Joerg Roedel
1 sibling, 0 replies; 7+ messages in thread
From: Ming Lei @ 2009-06-16 6:41 UTC (permalink / raw)
To: FUJITA Tomonori; +Cc: joerg.roedel, stefanr, ben-linux, linux-kernel
2009/6/16 FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>:
> On Mon, 15 Jun 2009 10:13:55 +0200
> Joerg Roedel <joerg.roedel@amd.com> wrote:
>
>> On Sun, Jun 14, 2009 at 11:43:42PM +0200, Stefan Richter wrote:
>> > Ben Dooks wrote:
>> >> On Sun, Jun 14, 2009 at 08:56:29PM +0200, Stefan Richter wrote:
>> >>> the DMA debug facility warns about mappings of on-stack memory.
>> >>> What's the problem with that?
>> > ...
>> >> I'm not sure if it is possible on all architectures, however the
>> >> DMA mapping documentation prohibts the use of stack memory.
>> >
>> > Ah, it has all been documented in plain sight for ages. Thanks for the
>> > pointer.
>>
>> Problem is that the stack might go away or could be otherwise reused
>> while the DMA is in-flight. This could cause really hard to debug
>> problems.
>
> Not true. Even if you use the stack buffer for DMA synchronously, it
> doesn't work (we had the bad code like starting dma and waiting for
> the completion).
Yes, there is cache alignement problem for stack buffer also.
>
> On some architectures, we can't use the stack buffer for DMA. That's
> why the DMA mapping documentation prohibits the use of stack memory
> for DMA.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
Lei Ming
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: dma-debug: check_for_stack background?
2009-06-16 6:16 ` FUJITA Tomonori
2009-06-16 6:41 ` Ming Lei
@ 2009-06-16 8:14 ` Joerg Roedel
1 sibling, 0 replies; 7+ messages in thread
From: Joerg Roedel @ 2009-06-16 8:14 UTC (permalink / raw)
To: FUJITA Tomonori; +Cc: stefanr, ben-linux, linux-kernel
On Tue, Jun 16, 2009 at 03:16:37PM +0900, FUJITA Tomonori wrote:
> On Mon, 15 Jun 2009 10:13:55 +0200
> Joerg Roedel <joerg.roedel@amd.com> wrote:
>
> > On Sun, Jun 14, 2009 at 11:43:42PM +0200, Stefan Richter wrote:
> > > Ben Dooks wrote:
> > >> On Sun, Jun 14, 2009 at 08:56:29PM +0200, Stefan Richter wrote:
> > >>> the DMA debug facility warns about mappings of on-stack memory.
> > >>> What's the problem with that?
> > > ...
> > >> I'm not sure if it is possible on all architectures, however the
> > >> DMA mapping documentation prohibts the use of stack memory.
> > >
> > > Ah, it has all been documented in plain sight for ages. Thanks for the
> > > pointer.
> >
> > Problem is that the stack might go away or could be otherwise reused
> > while the DMA is in-flight. This could cause really hard to debug
> > problems.
>
> Not true. Even if you use the stack buffer for DMA synchronously, it
> doesn't work (we had the bad code like starting dma and waiting for
> the completion).
I've not written that this is the only problem. I know that there may be
others like the one you experienced. But what I wrote could also happen
and is a problem :)
Joerg
--
| Advanced Micro Devices GmbH
Operating | Karl-Hammerschmidt-Str. 34, 85609 Dornach bei München
System |
Research | Geschäftsführer: Thomas M. McCoy, Giuliano Meroni
Center | Sitz: Dornach, Gemeinde Aschheim, Landkreis München
| Registergericht München, HRB Nr. 43632
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-06-16 8:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-14 18:56 dma-debug: check_for_stack background? Stefan Richter
2009-06-14 21:20 ` Ben Dooks
2009-06-14 21:43 ` Stefan Richter
2009-06-15 8:13 ` Joerg Roedel
2009-06-16 6:16 ` FUJITA Tomonori
2009-06-16 6:41 ` Ming Lei
2009-06-16 8:14 ` Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox