From: Vegard Nossum <vegard.nossum@gmail.com>
To: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] kmemcheck: add hooks for page- and sg-dma-mappings
Date: Sat, 21 Feb 2009 18:13:42 +0100 [thread overview]
Message-ID: <19f34abd0902210913qe0539ebgf74c9b5e0b577786@mail.gmail.com> (raw)
In-Reply-To: <49A02A61.6060909@cs.helsinki.fi>
2009/2/21 Pekka Enberg <penberg@cs.helsinki.fi>:
> Vegard Nossum wrote:
>>
>> This is needed for page allocator support to prevent false positives
>> when accessing pages which are dma-mapped.
>>
>> Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
>> ---
>> arch/x86/include/asm/dma-mapping.h | 6 ++++++
>> 1 files changed, 6 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/x86/include/asm/dma-mapping.h
>> b/arch/x86/include/asm/dma-mapping.h
>> index 830bb0e..713a002 100644
>> --- a/arch/x86/include/asm/dma-mapping.h
>> +++ b/arch/x86/include/asm/dma-mapping.h
>> @@ -117,7 +117,12 @@ dma_map_sg(struct device *hwdev, struct scatterlist
>> *sg,
>> {
>> struct dma_mapping_ops *ops = get_dma_ops(hwdev);
>> + struct scatterlist *s;
>> + int i;
>> +
>> BUG_ON(!valid_dma_direction(direction));
>> + for_each_sg(sg, s, nents, i)
>> + kmemcheck_mark_initialized(sg_virt(s), s->length);
>> return ops->map_sg(hwdev, sg, nents, direction);
>> }
>> @@ -215,6 +220,7 @@ static inline dma_addr_t dma_map_page(struct device
>> *dev, struct page *page,
>> struct dma_mapping_ops *ops = get_dma_ops(dev);
>> BUG_ON(!valid_dma_direction(direction));
>> + kmemcheck_mark_initialized(page_address(page) + offset, size);
>> return ops->map_single(dev, page_to_phys(page) + offset,
>> size, direction);
>> }
>
> What's with the new BUG_ON() calls here?
>
What new BUG_ON calls? Do you need glasses?
Vegard
--
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
-- E. W. Dijkstra, EWD1036
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-02-21 17:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-21 13:36 Vegard Nossum
2009-02-21 13:36 ` [PATCH] kmemcheck: disable fast string operations on P4 CPUs Vegard Nossum
2009-02-21 16:21 ` Pekka Enberg
2009-02-22 3:13 ` H. Peter Anvin
2009-02-22 10:51 ` Vegard Nossum
2009-02-21 13:36 ` [PATCH] kmemcheck: rip out REP instruction emulation Vegard Nossum
2009-02-21 16:21 ` Pekka Enberg
2009-02-21 13:36 ` [PATCH] kmemcheck: add hooks for page- and sg-dma-mappings Vegard Nossum
2009-02-21 16:22 ` Pekka Enberg
2009-02-21 17:13 ` Vegard Nossum [this message]
2009-02-21 17:15 ` Pekka Enberg
2009-02-21 13:36 ` [PATCH] kmemcheck: add hooks for the page allocator Vegard Nossum
2009-02-21 15:23 ` Ingo Molnar
2009-02-21 16:34 ` Pekka Enberg
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=19f34abd0902210913qe0539ebgf74c9b5e0b577786@mail.gmail.com \
--to=vegard.nossum@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@elte.hu \
--cc=penberg@cs.helsinki.fi \
/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