From: Jeff Dike <jdike@addtoit.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: valgrind-developers@lists.sourceforge.net,
John Reiser <jreiser@BitWagon.com>,
user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] running UserModeLinux under Valgrind(memcheck)
Date: Fri, 4 Jan 2008 11:37:11 -0500 [thread overview]
Message-ID: <20080104163711.GA5743@c2.user-mode-linux.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0801031706000.27528@anakin>
On Thu, Jan 03, 2008 at 05:08:23PM +0100, Geert Uytterhoeven wrote:
> I think he means how to handle the following from include/linux/gfp.h in
> valgrind:
>
> struct page *alloc_pages(gfp_t gfp_mask, unsigned int order);
> unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order);
>
> void __free_pages(struct page *page, unsigned int order);
> void free_pages(unsigned long addr, unsigned int order);
Oh yeah, good point.
The unsigned long ones are easy - they are addresses disguised as
numbers.
You have to tell valgrind somehow that the object size is
(1 << order) * PAGE_SIZE
About the struct page ones - I see two possibilities.
1 - You communicate to valgrind somehow that there is a mapping
between the page struct and the virtual address it represents. There
is a is no page_to_virt (although there is a virt_to_page), but one
would be easy to add. For UML, it amounts to
uml_physmem + (page - mem_map) * PAGE_SIZE
2 - You can insist that UML defines WANT_PAGE_VIRTUAL which, if I'm
reading the code correctly, will set page->virtual to the address
represented by the page. Valgrind then somehow has to know how to
reach into the page struct and get the address.
Jeff
--
Work email - jdike at linux dot intel dot com
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
prev parent reply other threads:[~2008-01-04 16:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-27 18:38 [uml-devel] running UserModeLinux under Valgrind(memcheck) John Reiser
2007-12-27 19:55 ` [uml-devel] [Valgrind-developers] " Michael Abshoff
2008-01-01 2:00 ` [uml-devel] " Jeff Dike
2008-01-01 21:24 ` John Reiser
2008-01-02 15:28 ` Jeff Dike
2008-01-02 22:42 ` John Reiser
2008-01-03 5:18 ` Jeff Dike
2008-01-03 16:08 ` Geert Uytterhoeven
2008-01-04 16:37 ` Jeff Dike [this message]
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=20080104163711.GA5743@c2.user-mode-linux.org \
--to=jdike@addtoit.com \
--cc=geert@linux-m68k.org \
--cc=jreiser@BitWagon.com \
--cc=user-mode-linux-devel@lists.sourceforge.net \
--cc=valgrind-developers@lists.sourceforge.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.