All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Kernel memory allocation debugging with Qemu
@ 2008-02-08 17:52 Blue Swirl
  2008-02-08 18:55 ` Paul Brook
  0 siblings, 1 reply; 4+ messages in thread
From: Blue Swirl @ 2008-02-08 17:52 UTC (permalink / raw)
  To: qemu-devel

On KernelTrap there is a story about Linux kernel memory allocation
debugging patch that allows detection of reads from uninitialized
memory (http://kerneltrap.org/Linux/Debugging_With_kmemcheck).

The patch takes a half of the memory and slows down the system. I
think Qemu could be used instead. A channel (IO/MMIO) is created
between the memory allocator in target kernel and Qemu running in the
host. Memory allocator tells the allocated area to Qemu using the
channel. Qemu changes the physical memory mapping for the area to
special memory that will report any reads before writes back to
allocator. Writes change the memory back to standard RAM. The
performance would be comparable to Qemu in general and host kernel +
Qemu only take a few MB of the memory. The system would be directly
usable for other OSes as well.

Similar debugging tool could be used in user space too (instrumenting
libc malloc/free), but that's probably reinventing Valgrind or other
malloc checkers.

The special memory could also report unaligned accesses even on target
where this is normally not detected but not so efficient.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-02-08 21:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-08 17:52 [Qemu-devel] Kernel memory allocation debugging with Qemu Blue Swirl
2008-02-08 18:55 ` Paul Brook
2008-02-08 19:13   ` Blue Swirl
2008-02-08 21:47     ` Paul Brook

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.