Mailing List Archive

traps and call back mechanism in XEN
Hello,

I am trying to figure out how the trap and callback mechanism works
between a guest OS and XEN. When a guest OS starts up, it uses the
HYPERVISOR_set_trap_table() to register a set of traps with XEN.
For example, it registers the trap that will handle a divide_error or
page_fault exception.

Now when XEN gets an exception, XEN executes the do_trap() function that
is found in xen/arch/x86/traps.c.
do_trap() retrieves the current domain's trap information that was registered
with HYPERVISOR_set_trap_table() and fills in a structure called
"guest_trap_bounce". From that point on, I don't quite follow how the guest OS
comes into play to handle the exception. Could someone please give me some
directions.

Thank You
Richard


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xen-devel
Re: traps and call back mechanism in XEN [ In reply to ]
> Hello,
>
> I am trying to figure out how the trap and callback mechanism works
> between a guest OS and XEN. When a guest OS starts up, it uses the
> HYPERVISOR_set_trap_table() to register a set of traps with XEN.
> For example, it registers the trap that will handle a divide_error or
> page_fault exception.
>
> Now when XEN gets an exception, XEN executes the do_trap() function that
> is found in xen/arch/x86/traps.c.
> do_trap() retrieves the current domain's trap information that was registered
> with HYPERVISOR_set_trap_table() and fills in a structure called
> "guest_trap_bounce". From that point on, I don't quite follow how the guest OS
> comes into play to handle the exception. Could someone please give me some
> directions.

The guest_trap_counce is interpreted in arch/x86/x86_32/entry.S and
used to create a stack frame on the ring-1 (guest OS) stack.

-- Keir


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xen-devel