[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] any exit function in xen that is similar to exit_kernel?



On Thu, 2011-12-01 at 12:55 +0000, Baozeng wrote:
> 2011/12/1 George Dunlap <George.Dunlap@xxxxxxxxxxxxx>:
> > On Tue, Nov 29, 2011 at 2:22 PM, Baozeng <sploving1@xxxxxxxxx> wrote:
> >> Hello all,
> >> I added a hypercall "do_greet" that only prints "Hello world" to do a
> >> small experiment. After it prints the "hello world", I would it to
> >> exit from Xen and stop current process. For instance:
> >> the hypercall is like this:
> >> int do_greet(){
> >>   pirntk("Hello world\n");
> >>   /*then I would it exit from Xen and stop current process that called 
> >> it.*/
> >>   exit_?? //exit(0) does not work.
> >> }
> >>
> >> If a process at the application level calls this hypercall through
> >> privcmd file, I would like it kill this process after the hypercall
> >> prints "Hello world". Then how to do that?
> >
> > A process is a guest kernel-level construct.  Xen doesn't know
> > anything about processes; it only knows things about VMs.  You can
> > easily kill the guest by doing this:
> >  domain_crash(current->domain);
> >
> > If you want the process only to be killed, you have to have the guest
> > kernel do it.
> >
> Okay. I know. It need first return to the kernel address space. Then
> is there any function that can return the kernel address space from
> Xen after the hypercall? like this:
>  int do_greet(){
>     pirntk("Hello world\n");
>     /*then I would it exit from Xen to the kernel.*/
>     exit_??  // after that CS and EIP should pointer to the kernel
> address space.
>  }
> 
> if there doesnot exiest such function, how can I know which function
> switches kernel into  Xen to trigger such hypercall, so that I can
> return it by myself. Is it in the entry.S, when int $82 instruction
> happen, then the CS and EIP begin to switch point to Xen? thanks

This is a quite strange thing to want to do. Please can you explain your
end goal (i.e. what problem are you trying to solve with this)? Perhaps
there is a better way.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.