Jeff Dike | 1 Jan 03:00 2008

Re: running UserModeLinux under Valgrind(memcheck)

On Thu, Dec 27, 2007 at 10:38:21AM -0800, John Reiser wrote:
> Patches have been developed which enable UserModeLinux for i686 to
> run under the memcheck tool of Valgrind on i686.  Thus it is possible
> to check dynamically the memory accesses made by a running Linux kernel
> against memcheck's model of allowed behavior.  This work was supported
> by Google Inc.
> 
> The goods:

Nice!

Did you find anything needing fixing besides the ubd and random
drivers reading uninitialized stuff and the random bytes that UML uses
to communicate with itself being uninitialized?

I did a quick scan of the UML patch, and didn't see any unexpected
fixes there.

> On the UML side, there is a significant technical issue: the semantics
> of kmalloc+kfree do not match the semantics of malloc+free.  The kernel
> slab allocator caches and re-issues identified objects, which accumulate
> state and retain it throughout execution, including from kfree to kmalloc.
> In contrast, a region that is passed to free() loses both its contents
> and its identity.  Also, size is an important parameter to malloc,
> but is implicit to kmalloc.  The initial patches finesse these issues
> (for instance: by supplying the size as trailing parameter to kmalloc,
> and by noticing that SLAB_POISON ==> free()), but there will be
> significant discussion and work in resolving the differences.

Any problem with supporting these sorts of allocation models in
(Continue reading)

WANG Cong | 1 Jan 08:18 2008
Picon

[Patch 1/8] UML: Remove 'TOPDIR' from Makefiles


TOPDIR is obsolete, use objtree instead.
This patch removes TOPDIR from all UML Makefiles.

Cc: Jeff Dike <jdike <at> addtoit.com>
Cc: Sam Ravnborg <sam <at> ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong <at> gmail.com>

---

diff --git a/arch/um/Makefile b/arch/um/Makefile
index ba6813a..57491af 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
 <at>  <at>  -158,7 +158,7  <at>  <at>  ifneq ($(KBUILD_SRC),)
 	$(Q)mkdir -p $(objtree)/include/asm-um
 	$(Q)ln -fsn $(srctree)/include/asm-um/$(basename $(notdir $ <at> ))-$(SUBARCH)$(suffix $ <at> ) $ <at> 
 else
-	$(Q)cd $(TOPDIR)/$(dir $ <at> ) ; \
+	$(Q)cd $(objtree)/$(dir $ <at> ) ; \
 	ln -sf $(basename $(notdir $ <at> ))-$(SUBARCH)$(suffix $ <at> ) $(notdir $ <at> )
 endif

 <at>  <at>  -168,7 +168,7  <at>  <at>  ifneq ($(KBUILD_SRC),)
 	$(Q)mkdir -p $(objtree)/include/asm-um
 	$(Q)ln -fsn $(srctree)/include/asm-$(HEADER_ARCH) include/asm-um/arch
 else
-	$(Q)cd $(TOPDIR)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch
+	$(Q)cd $(objtree)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch
 endif
(Continue reading)

Sam Ravnborg | 1 Jan 11:33 2008

Re: [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles

On Tue, Jan 01, 2008 at 03:18:46PM +0800, WANG Cong wrote:
> 
> TOPDIR is obsolete, use objtree instead.
> This patch removes TOPDIR from all UML Makefiles.
> 

I do not feel confident with these changes.
In some places I had expected to see srctree and not objtree.
I would like to see this tested before applying it.

Building a ppc toolchain now to test it...

	Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Sam Ravnborg | 1 Jan 11:49 2008

Re: [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles

On Tue, Jan 01, 2008 at 11:33:42AM +0100, Sam Ravnborg wrote:
> On Tue, Jan 01, 2008 at 03:18:46PM +0800, WANG Cong wrote:
> > 
> > TOPDIR is obsolete, use objtree instead.
> > This patch removes TOPDIR from all UML Makefiles.
> > 
> 
> I do not feel confident with these changes.
> In some places I had expected to see srctree and not objtree.
> I would like to see this tested before applying it.
> 
> Building a ppc toolchain now to test it...

It seems that building a ppc based um kernel is not supported
in mainline.
Kconfig.ppc is missing and when creating it um build fails
in sys-ppc/ due to user-offset.c is missing.

As most of your patch touches ppc specific code I suggest
to just replace TOPDIR with srctree all over (no semantic change)
and the the um people can figure out the ppc stuff when they get to it.

	Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WANG Cong | 1 Jan 14:01 2008
Picon

(Try #2) [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles

On Tue, Jan 01, 2008 at 11:49:42AM +0100, Sam Ravnborg wrote:
>On Tue, Jan 01, 2008 at 11:33:42AM +0100, Sam Ravnborg wrote:
>> On Tue, Jan 01, 2008 at 03:18:46PM +0800, WANG Cong wrote:
>> > 
>> > TOPDIR is obsolete, use objtree instead.
>> > This patch removes TOPDIR from all UML Makefiles.
>> > 
>> 
>> I do not feel confident with these changes.
>> In some places I had expected to see srctree and not objtree.
>> I would like to see this tested before applying it.
>> 
>> Building a ppc toolchain now to test it...
>
>It seems that building a ppc based um kernel is not supported
>in mainline.
>Kconfig.ppc is missing and when creating it um build fails
>in sys-ppc/ due to user-offset.c is missing.
>
>As most of your patch touches ppc specific code I suggest
>to just replace TOPDIR with srctree all over (no semantic change)
>and the the um people can figure out the ppc stuff when they get to it.

You're right. I use srctree instead. And tested with:

$ make O=../foobar/ ARCH=um linux

It works fine. Thanks for your points!

-------->
(Continue reading)

John Reiser | 1 Jan 22:24 2008

Re: running UserModeLinux under Valgrind(memcheck)

The web page  http://bitwagon.com/valgrind+uml/index.html
now exists with news, history, commentary, scripts, links
on getting User Mode Linux for i686 to run under memcheck on i686.

A standalone patch  http://bitwagon.com/valgrind+uml/mc_main-asap.patch
to valgrind-3.3.0 implements "--complain-asap=yes" independently of
the other changes.  See  http://bitwagon.com/glibc-audit/glibc-audit.html
about getting a "quiet" glibc.

--

-- 
John Reiser, jreiser <at> BitWagon.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/
Jeff Dike | 2 Jan 16:02 2008

Re: (Try #2) [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles

On Tue, Jan 01, 2008 at 09:01:25PM +0800, WANG Cong wrote:
> TOPDIR is obsolete, use srctree instead.
> This patch removes TOPDIR from all UML Makefiles.

Thanks, I'll send this to Andrew.

				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/
Jeff Dike | 2 Jan 16:28 2008

Re: running UserModeLinux under Valgrind(memcheck)

On Tue, Jan 01, 2008 at 01:24:49PM -0800, John Reiser wrote:
> The web page  http://bitwagon.com/valgrind+uml/index.html
> now exists with news, history, commentary, scripts, links
> on getting User Mode Linux for i686 to run under memcheck on i686.

You refer to kmalloc and kfree as keeping object state intact between
kfree and kmalloc, thus not being semantically the same as malloc and
free.  However, this is true of kmem_cache_alloc and kmem_cache_free,
not kmalloc and kfree.

Object contents are destroyed between kfree and kmalloc.

As far as kmem_cache_alloc and kmem_cache_free are concerned, would it
work to say that they are like malloc and free, except that if there's
a constructor, it is always called before kmem_cache_alloc returns?

				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/
Jeff Dike | 2 Jan 16:37 2008

Re: __attribute_used__ error on 2.6.23.9

On Wed, Dec 26, 2007 at 06:30:34PM -0800, Todd Jackson wrote:
> That patch didn't work...I'm still seeing the same error with the patch 
> applied.

Can you make aio.i and send it to me?

				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/
Jeff Dike | 2 Jan 17:13 2008

Re: PATCH - .spec file repair

On Thu, Dec 06, 2007 at 09:07:36PM -0500, Bill Schwanitz wrote:
> I wanted to install the uml tools as an rpm on my cent5 box and the .spec
> file was not quite functional.
> 
> Attached is a diff against the 20070815 release.

Thanks, I dropped that into my tree.

				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/

Gmane