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

[Xen-devel] Which ways does the event handler be called in the event_cha

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Which ways does the event handler be called in the event_channel mechanism?
From: "p z" <zpengxen@xxxxxxxxx>
Date: Sat, 17 Jan 2009 14:10:39 +0800
Delivery-date: Fri, 16 Jan 2009 22:11:06 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=Ob7lMukBUk063jXP2dZrRW/raRD3ZqxHOBGui8ke+sY=; b=QmCH8mYPUsQC7/CepLb/MUW9bYSr8FnUPxJ34y7bWT/fiJd+pUbTZQGksbaL2iaDZV DXkaHnj2fe9SApQyAwsV7FidCn4QykYzTHZN483gz76cJ92WzWoPe5A1G4a1J2vwT7IW Gal1S3DqBKBHfHNGXmVPec9IgF2qVpO1r3qgY=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=TQzuPR/puvPc1usctCtHFzPUSim883xLI3a1fz23oeP949iF1hdDHvnWwLL7K2EbyE 2Suy+FZGKEbBSs29tMn5PNmisQ8YTRIaxLZHln2WvONet7lra791RHWfDagw3y7j8KfW JUqx6q6Jtkp0pw6oDk/esbt3Zjy/4W+XsY8UM=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
mini-os/arch/x86/setup.c
hi,everybody

void arch_init(start_info_t *si)
{     ......
      HYPERVISOR_set_callbacks(
             __KERNEL_CS, (unsigned long)hypervisor_callback,
            __KERNEL_CS, (unsigned long)failsafe_callback);
      ......
}

the function HYPERVISOR_set_callbacks() is implemented by do_set_callbacks

*/xen-3.3.0 /xen/arch/x86/x86_32/traps.c*
long do_set_callbacks(unsigned long event_selector,
                      unsigned long event_address,
                      unsigned long failsafe_selector,
                      unsigned long failsafe_address)
{
    struct callback_register event = {
        .type = CALLBACKTYPE_event,
        .address = { event_selector, event_address },
    };
    register_guest_callback(&event);
}

*xen/arch/x86/x86_32/traps.c*
static long register_guest_callback(struct callback_register *reg)
{
    long ret = 0;
    struct vcpu *v = current;
    case CALLBACKTYPE_event:
        v->arch.guest_context.event_callback_cs   = reg->address.cs;     /*registered*/
        v->arch.guest_context.event_callback_eip = reg->address.eip;      /*registered*/
        break;
......
}

Through the above  function call link, the event callback function hypervisor_callback() is registered to xen,but I have three questions:

1) In which  points do v->arch.guest_context.event_callback_cs:v->arch.guest_context.event_callback_eip  be used (or called)?

2) Hypervisor_callback is implemented in the guest kerenl & it eventually call the event handlers implemented by the guest kernel,but how does the  functions in guest kernel context be called in the xen context,more exactly where and how does the function call stack be constructed please?

3) After a event is sent to a guest ,the guest kernel can detect the event and call the corresponding event handler by reading the shared info, in which the mini-os really do, but why does the mini-os still register the event channel callback function ? It seems there are two ways in which the event handler is called ,is it right? If it is right ,why xen give the two ways? 
By the way,what does the 'upcall mechanism' means? Does it means the event handler is called by xen  through calling the registered "v->arch.guest_context.event_callback_cs:v->arch.guest_context.event_callback_eip" pointer directly please?


Thanks!
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] Which ways does the event handler be called in the event_channel mechanism?, p z <=