On Sat, Mar 29, 2008 at 11:51:38PM +0800, fang zheng wrote: > > What happens if execve("/bin/bash") is allowed to run on the host? > Sorry ,I don't know. Could you interpret it in detail?
If execve("/bin/bash") is allowed to run on the host, it means the UML user has a shell on the host, and has broken out of the UML. > The system call obviously must be annulled in the host kernel. > what is annulled is the sysem call of UML kernel or host kernel? The system calls of UML processes are annulled. > If guest OS is linux-2.6.18 and host OS is linux-2.6.22, what is annulled is > linux-2.6.22 > and what is run finally is linux-2.6.18,or on the contray? Sort of. If there were a difference between the behavior of a particular system call between 2.6.18 and 2.6.22, a process running it in a 2.6.18 UML would have it annulled in the (2.6.22) host and run in the (2.6.18) UML, so it would see the 2.6.18 behavior. > I want to know wherever in TT mode or SKAS mode,does tracing thread is > always running in the host kernel? The UML kernel must run on the host, so the ptracing is happening on the host. > In SKAS mode, /proc/mm makes UML kernel and UML user processes into > different address spaces. No, it makes it possible to create multiple host address spaces without a host process for each one. > What I want to know /proc/mm asigns the address space for UML user processes > or UML kernel? UML processes > Do many UML processes run on the /proc/mm? All of them. > In TT mode ,why UML kernel and UML processes run in the same space? Because that's the first way I thought of to implement UML. > and how to do to make TT mode > change to SKAS mode? because of /proc/mm? how does /proc/mm work? skas0 doesn't require /proc/mm. It uses a couple of UML kernel pages in each process address space in order to do the address space changes that skas3 does with /proc/mm. > while in user mode, processes have their system calls intercepted and > virtualized, in kernel mode, they are released from tracing and their system > calls run directly in the host kernel. This is true for tt mode. In skas mode, a UML process does nothing but run userspace code, so it is always ptraced. A separate process runs kernel code, and it is never ptraced. > what I want to know is since in kernel mode ,why the system calls run > directly in the host kernel? You want to see output on your screen. Since that's controlled by the host kernel, UML needs to make host system calls in order to put text there. UML needs to read data from a filesystem image on the host. That requires making system calls on the host. > Does the UML kernel share the same space with the host kernel? Share an address space? No. It's a process. > Since UML runs as a user process on the host OS, its UML kernel should run > in the host user space. > namely, the UML kernel runs in the host user space. If it is true,how a > system call runs in a user space? All that's needed is to return the correct results to the process. There's nothing magic about it. Jeff -- Work email - jdike at linux dot intel dot com ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ User-mode-linux-user mailing list User-mode-linux-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user