linux-um archives
 help / color / mirror / Atom feed
From: Renzo Davoli <renzo@cs.unibo.it>
To: Am??rico Wang <xiyou.wangcong@gmail.com>
Cc: linux-kernel@vger.kernel.org, Jeff Dike <jdike@addtoit.com>,
	user-mode-linux-devel@lists.sourceforge.net,
	mtk.manpages@gmail.com, Roland McGrath <roland@redhat.com>
Subject: Re: [PATCH 0/2] ptrace_vm: ptrace for syscall emulation virtual machines
Date: Sat, 25 Apr 2009 11:19:28 +0200	[thread overview]
Message-ID: <20090425091928.GB18153@cs.unibo.it> (raw)
In-Reply-To: <20090417081823.GA31897@hack>

On Fri, Apr 17, 2009 at 04:18:23PM +0800, Am??rico Wang wrote:
> On Tue, Apr 14, 2009 at 12:36:03AM +0800, Am�rico Wang wrote:
> >Anyway, I will test your patch tomorrow, and will send you more
> >feedbacks soon.
> 
> Sorry for the delay.
Me, too!

UML on UML stopped working long time ago, I wrote a note on it
on March 8. See:
http://article.gmane.org/gmane.linux.uml.devel/12085
Here I am having the same behavior with and without my patches, thus
(in my opinion) the bug is not related with the new tags.

It seems that there are some problems on the virtual memory
when UML runs UML.
With older kernels (<2.6.28.2) the error is:
Eeek! page_mapcount(page) went negative! (-1)
the error is still there now but the message I get is different:

BUG: Bad page map in process linux.umlv2  pte:00164045 pmd:07b5e1e1
page:08905c80 flags:00000400 count:-2 mapcount:-4 mapping:(null) index:0
addr:00100000 vm_flags:00060055 anon_vma:(null) mapping:(null) index:100
vma->vm_ops->fault: special_mapping_fault+0x0/0x47
0fc01d64:  [<081a9c5a>] dump_stack+0x1c/0x20
0fc01d7c:  [<080a233f>] print_bad_pte+0x16d/0x17d
0fc01dac:  [<080a2c20>] unmap_vmas+0x273/0x46f
0fc01e04:  [<080a5c69>] unmap_region+0x82/0xfe
0fc01e3c:  [<080a68b1>] do_munmap+0x1f6/0x245
0fc01e6c:  [<080a7118>] mmap_region+0xc4/0x3fd
0fc01eb8:  [<080a765b>] do_mmap_pgoff+0x20a/0x253
0fc01ef0:  [<08059b2f>] sys_mmap2+0x60/0x8e
0fc01f28:  [<0805b0df>] handle_syscall+0x7f/0x9c
0fc01f78:  [<0806a27a>] userspace+0x2d0/0x377
0fc01fe0:  [<08058e38>] fork_handler+0x53/0x5b
0fc01ffc:  [<00000000>] 0x0
(and then many others)
It seems that the page table of the UML process inside UML gets garbled:
I think that neither "count" should never reach -2 nor "mapcount" -4. 

The numbers of count and mapcount decrease at each faulty UML execution
(the following are outputs of tests without my patch)
$ ./linux ....
0> page:08905d00 flags:00000400 count:1 mapcount:-1 mapping:(null) index:0
$ ./linux ....
1> page:08905d00 flags:00000400 count:0 mapcount:-2 mapping:(null) index:0
2> page:08905d00 flags:00000400 count:-1 mapcount:-3 mapping:(null) index:0
3> page:08905d00 flags:00000400 count:-2 mapcount:-4 mapping:(null) index:0

It seems that a page gets released twice.

I have successfully tested my paches in various configurations:
- patched-kernel running patched-UML
- patched-kernel running unpatched-UML
- patched-kernel running umview
- patched-UML running umview
- UML on UML fails in the same way with and without the patch.
I am currently running the patched kernel on my laptop.

In my spare time (does it exist? ;-) I'll try to track the UML bug
(hoping that Jeff can do it before me, Jeff are you online? ;-)

renzo

  reply	other threads:[~2009-04-25  9:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090204080236.GA17452@cs.unibo.it>
2009-03-10 21:44 ` [PATCH 0/2] ptrace_vm: ptrace for syscall emulation virtual machines Renzo Davoli
2009-03-13  7:42   ` Américo Wang
2009-03-16  7:45   ` Américo Wang
2009-03-24 23:47     ` Renzo Davoli
2009-03-29 16:32       ` [uml-devel] " Américo Wang
2009-04-04 10:17         ` Renzo Davoli
2009-04-07 17:36           ` Américo Wang
2009-04-08 12:18             ` Renzo Davoli
2009-04-13 16:36               ` Américo Wang
2009-04-17  8:18                 ` Américo Wang
2009-04-25  9:19                   ` Renzo Davoli [this message]
2009-04-30  8:27                     ` Américo Wang
2009-05-18  9:45                       ` [uml-devel] " Amerigo Wang

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=20090425091928.GB18153@cs.unibo.it \
    --to=renzo@cs.unibo.it \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=roland@redhat.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    --cc=xiyou.wangcong@gmail.com \
    /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