WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] How does hypervisor handle the hypercalls from guest OSe

To: "K.C. Chiu" <B8844014@xxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] How does hypervisor handle the hypercalls from guest OSes?
From: Steven Hand <Steven.Hand@xxxxxxxxxxxx>
Date: Mon, 10 May 2004 15:16:35 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 10 May 2004 15:18:56 +0100
Envelope-to: steven.hand@xxxxxxxxxxxx
In-reply-to: Your message of "Mon, 10 May 2004 21:55:40 +0800." <001f01c43696$7f6d2470$367519a3@linuxnxhc0axvc>
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
> I'm trying to encapsulate some operations into "hypercall" and pass
> the hypercall into hypervisor.
>
> But I cannot find out how the hypervisor to deal with hypercalls
> from guest OSes.

Hypercalls go from ring 1 (xenolinux kernel) to ring 0; they are
invoked by using "int $0x82".

You can see the "top half" (guest side) of the hypercall interface by
looking at the file

   xenolinux-2.4.2x-sparse/include/asm-xen/hypervisor.h 

which includes a bunch of inline C functions like: 

static inline int HYPERVISOR_mmu_update(mmu_update_t *req, int count)
{
    int ret;
    __asm__ __volatile__ (
        TRAP_INSTR
        : "=a" (ret) : "0" (__HYPERVISOR_mmu_update),
        "b" (req), "c" (count) : "memory" );

    return ret;
}



You can see the "bottom half" (xen side) of the hypercall interface 
by looking at the files 

   xen/include/hypervisor-ifs/hypervisor-if.h 
   xen/arch/i386/entry.S 

; the former includes definitions of all the numbers used for the 
various hypercalls while latter handles the int $0x82 and decides
which actual hypercall to invoke (by using hypervisor_call_table; 
see the end of entry.S). 


> I find a function "do_dom0_op" in xeno-1.2.bk/xen/common/dom0_ops.c.
> 
> It looks like the function which would deal with hypercalls .

No; a dom0_op is just one of the hypercalls; it is the general method
used for control software (running in domain 0) to invoke various 
operations within Xen. 

Depending on what you're actually trying to do, adding a new dom0_op 
rather than a new hypercall might be the right thing to do though. 

> and I try to modify the code in do_dom0_op to handle my new
> hypercall, but I failed.

Yes. 


> can someone tell me how does hypervisor handle the hypercalls from
> guest OSes?

Hopefully the above description is of some use. 

cheers, 

S.


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel