From: "D. Bahi" <dbahi@enterasys.com>
To: Jeff Dike <jdike@addtoit.com>
Cc: Nicholas Nethercote <njn25@cam.ac.uk>,
user-mode-linux-devel@lists.sourceforge.net,
valgrind-users@lists.sourceforge.net
Subject: Re: [Valgrind-users] Re: [uml-devel] Re: UML and valgrind
Date: Tue, 03 Aug 2004 16:12:51 -0400 [thread overview]
Message-ID: <410FF1C3.9060509@enterasys.com> (raw)
In-Reply-To: <200408031931.i73JVkvv003367@ccure.user-mode-linux.org>
[-- Attachment #1: Type: text/plain, Size: 2999 bytes --]
trying to find a way to wedge the old patch into
the new code... i don't think it applies anymore.
alright, i don't read assembly (head hung low) but
valgrind 2.1.2/coregrind/vg_syscall.S has something
that makes me ask why i'm getting the 'clone() not
supported message'
does this need some kind of tie-in code in vg_syscalls.c?
.globl VG_(clone)
VG_(clone):
#define FSZ (4+4+4) /* frame size = retaddr+ebx+edi */
push %ebx
push %edi
/* set up child stack with function and arg */
movl 4+FSZ(%esp), %ecx /* child stack */
movl 12+FSZ(%esp), %ebx /* fn arg */
movl 0+FSZ(%esp), %eax /* fn */
lea -8(%ecx), %ecx /* make space on stack */
movl %ebx, 4(%ecx) /* fn arg */
movl %eax, 0(%ecx) /* fn */
/* get other args to clone */
movl 8+FSZ(%esp), %ebx /* flags */
movl 20+FSZ(%esp), %edx /* parent tid * */
movl 16+FSZ(%esp), %edi /* child tid * */
movl $__NR_clone, %eax
int $0x80
testl %eax, %eax
jnz 1f
/* CHILD - call thread function */
popl %eax
call *%eax
/* exit with result */
movl %eax, %ebx
movl $__NR_exit, %eax
int $0x80
/* Hm, exit returned */
ud2
1: /* PARENT or ERROR */
pop %edi
pop %ebx
ret
Jeff Dike wrote:
> dbahi@enterasys.com said:
>
>>ugh, so close - it bails - stopped by clone() !?!!?? :
>
>
> OK, there were a bunch of problems that were fixed when me, Jeremy, and Julian
> were working on this. The clone one seems to have not made it. I've lost the
> patches I had, but I dug this out of a piece of email. It applies to
> coregrind/vg_syscalls.c:
>
>
>>@@ -39,6 +40,10 @@
>> # code which copies from baseBlock before the call, into
>> # m_state_static, and back afterwards.
>>
>>+.section .data
>>+save_ip:
>>+ .long 0
>>+
>> VG_(do_syscall):
>> # Save all the int registers of the real machines state on the
>> # simulators stack.
>>@@ -80,10 +85,27 @@
>> movl VG_(m_state_static)+48, %esi
>> movl VG_(m_state_static)+52, %edi
>>
>>+ cmpl $__NR_clone, %eax
>>+ jne not_clone
>>+
>>+ pushl %eax
>>+ movl VG_(m_state_static)+60, %eax
>>+ movl %eax, save_ip
>>+ popl %eax
>>+
>>+ int $0x80
>>+
>>+ cmpl $0, %eax
>>+ jne parent_finish
>>+
>>+ jmp *save_ip
>>+
>>+not_clone:
>> # esp now refers to the simulatees stack
>> # Do the actual system call
>> int $0x80
>
>
> It handles the clone by calling clone itself, creating a new valgrind thread
> which will go on grinding the new UML thread.
>
> Also, I saw this:
>
>
>> valgrind: the `impossible' happened:
>> Unhandled REPE case
>
>
> If you see this, check that you have
> http://www.goop.org/~jeremy/valgrind/76-repe-scas.patch
> and apply if not.
>
> Jeff
>
--
There are two kinds of people in this world: Those that enter a room and
turn the television set on, and those that enter a room and turn the
television set off. -- Raymond Shaw, The Manchurian Candidate (1962).
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 187 bytes --]
next prev parent reply other threads:[~2004-08-03 20:13 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-08 4:13 [uml-devel] UML and valgrind Bahi, David
2004-08-03 2:47 ` [uml-devel] " D. Bahi
2004-08-03 5:17 ` Jeff Dike
2004-08-03 9:31 ` [Valgrind-users] " Nicholas Nethercote
2004-08-03 14:50 ` Jeff Dike
2004-08-03 14:31 ` Nicholas Nethercote
2004-08-03 17:50 ` Jeff Dike
2004-08-03 17:33 ` D. Bahi
2004-08-03 19:31 ` Jeff Dike
2004-08-03 20:12 ` D. Bahi [this message]
2004-08-04 7:47 ` Tom Hughes
2004-08-03 22:04 ` Nicholas Nethercote
2004-08-04 7:52 ` Tom Hughes
2004-08-04 15:10 ` Jeff Dike
2004-08-04 15:35 ` Jeff Dike
2004-08-04 14:58 ` Tom Hughes
2004-08-04 18:00 ` Jeff Dike
2004-08-04 17:57 ` Tom Hughes
2004-08-04 21:02 ` Jeff Dike
2004-08-05 9:28 ` Nicholas Nethercote
2004-08-05 13:15 ` D. Bahi
2004-08-05 15:24 ` Jeff Dike
2004-08-03 19:40 ` Jeff Dike
2004-08-04 1:09 ` Nuno Silva
2004-08-04 2:47 ` D. Bahi
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=410FF1C3.9060509@enterasys.com \
--to=dbahi@enterasys.com \
--cc=jdike@addtoit.com \
--cc=njn25@cam.ac.uk \
--cc=user-mode-linux-devel@lists.sourceforge.net \
--cc=valgrind-users@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.