All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuas <ku4s@users.sourceforge.net>
To: user-mode-linux-devel@lists.sourceforge.net
Cc: BlaisorBlade <blaisorblade_spam@yahoo.it>
Subject: Re: [uml-devel] System Call Mechanism
Date: Fri, 27 Feb 2004 21:29:01 -0500	[thread overview]
Message-ID: <403FFCED.7060201@users.sourceforge.net> (raw)
In-Reply-To: <200402251652.52680.blaisorblade_spam@yahoo.it>

Hi Blaisor,

Thanks for the response and info. I am still confused in how the system 
call arrive at process.c->userspace(). I guess the proposal in the 
presentation 
(http://user-mode-linux.sourceforge.net/slides/ols2002/img21.html), it 
said the next implementation would be to convert trap call to signal has 
never been implemented.

I checked in SKAS and TT mode, the idtr value is the same as the host 
machine and I can see from where you pointed, SKAS and TT has the same 
trap handler for system_call. But I don't really understand ptrace 
control, I am not totally sure how the system call is being intercepted 
and sent back to uml ends up in process.c->userspace(). Does every time 
interrupt is called, it will be caught by the host kernel ptrace and for 
system call (int 0x80) will be redirected back to the UML process. How 
does the information about the process that's requesting system call, 
syscall#, and arguments being passed to the UML Kernel. I understand 
since SKAS mode has collection of Virtual Address Spaces. Correct me if 
I'm wrong, will PTRACE_SWITCH_MM first change to the UML kernel process 
Address Space. But in SKAS mode, the UML kernel is also in the host 
address space (>0xc0000000), during this state we are already in the 
kernel space. So which child memory that PTRACE_SWITCH_MM switches when 
the system call? I am assuming the active Virtual Memory that's being 
replaced in UML process is the current uml process that generate the 
system call.


Kuas


BlaisorBlade wrote:

>>I seems to me the new or current implementation of system call involves
>>conversion from interupt 80 at the host OS into signals back in UML
>>kernel. Is this the same mechanism for the current TT and SKAS? Or  TT
>>mode still using ptrace thread tracing mechanism to intercept the system
>>call?
>>    
>>
>
>SKAS mode, the more modern one, still uses the same interception mechanism as 
>TT: i.e. ptraces the child, intercepts the syscall, nullifies it (i.e. the 
>host kernel receives a getpid syscall) and goes on. Look at these files:
>
>arch/um/kernel/skas/process.c: handle_trap () and userspace().
>arch/um/kernel/skas/syscall_*.c
>
>Only difference is that in SKAS mode you have one single child process being 
>ptraced, on the host; it runs the virtual processes code, and does syscall 
>with int 0x80 which are intercepted. To do a context switch, UML uses setjmp 
>and longjmp to switch the stack state and PTRACE_SWITCH_MM (implemented on 
>the host inside arch/i386/kernel/ptrace.c, read the skas patch) to switch the 
>virtual mappings of the child at once. More details about memory handling at 
>request, since you asked for one exact thing and maybe are not interested in 
>this.
>
>  
>




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  reply	other threads:[~2004-02-28  2:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-19 21:30 [uml-devel] System Call Mechanism kuas
2004-02-25 15:52 ` BlaisorBlade
2004-02-28  2:29   ` Kuas [this message]
2004-02-29 12:26     ` BlaisorBlade

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=403FFCED.7060201@users.sourceforge.net \
    --to=ku4s@users.sourceforge.net \
    --cc=blaisorblade_spam@yahoo.it \
    --cc=user-mode-linux-devel@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.