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

[Xen-changelog] Use set_callbacks hypercall if callback_op is not available.



# HG changeset patch
# User Ian.Campbell@xxxxxxxxxxxxx
# Node ID 93cffd2ea6a96b86b9c508f1cb1b86aaaa2e3575
# Parent  65894fff3649f58851fa59f38a66ab06e1244ba6
Use set_callbacks hypercall if callback_op is not available.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxxxxx>

diff -r 65894fff3649 -r 93cffd2ea6a9 
linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h
--- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h  Fri Apr 
21 14:03:07 2006 +0100
+++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h  Fri Apr 
21 17:18:53 2006 +0100
@@ -24,6 +24,7 @@ extern void nmi(void);
 
 static void __init machine_specific_arch_setup(void)
 {
+       int ret;
        struct xen_platform_parameters pp;
        struct callback_register event = {
                .type = CALLBACKTYPE_event,
@@ -42,8 +43,14 @@ static void __init machine_specific_arch
                memset(empty_zero_page, 0, sizeof(empty_zero_page));
        }
 
-       HYPERVISOR_callback_op(CALLBACKOP_register, &event);
-       HYPERVISOR_callback_op(CALLBACKOP_register, &failsafe);
+       ret = HYPERVISOR_callback_op(CALLBACKOP_register, &event);
+       if (ret == 0)
+               ret = HYPERVISOR_callback_op(CALLBACKOP_register, &failsafe);
+       if (ret == -ENOSYS)
+               ret = HYPERVISOR_set_callbacks(
+                       event.address.cs, event.address.eip,
+                       failsafe.address.cs, failsafe.address.eip);
+       BUG_ON(ret);
 
        cb.handler_address = (unsigned long)&nmi;
        HYPERVISOR_nmi_op(XENNMI_register_callback, &cb);
diff -r 65894fff3649 -r 93cffd2ea6a9 
linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h
--- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h        
Fri Apr 21 14:03:07 2006 +0100
+++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h        
Fri Apr 21 17:18:53 2006 +0100
@@ -14,6 +14,7 @@ extern void nmi(void);
 
 static void __init machine_specific_arch_setup(void)
 {
+       int ret;
        struct callback_register event = {
                .type = CALLBACKTYPE_event,
                .address = (unsigned long) hypervisor_callback,
@@ -30,9 +31,17 @@ static void __init machine_specific_arch
        struct xennmi_callback cb;
 #endif
 
-       HYPERVISOR_callback_op(CALLBACKOP_register, &event);
-       HYPERVISOR_callback_op(CALLBACKOP_register, &failsafe);
-       HYPERVISOR_callback_op(CALLBACKOP_register, &syscall);
+       ret = HYPERVISOR_callback_op(CALLBACKOP_register, &event);
+       if (ret == 0)
+               ret = HYPERVISOR_callback_op(CALLBACKOP_register, &failsafe);
+       if (ret == 0)
+               ret = HYPERVISOR_callback_op(CALLBACKOP_register, &syscall);
+       if (ret == -ENOSYS)
+               ret = HYPERVISOR_set_callbacks(
+                       event.address,
+                       failsafe.address,
+                       syscall.address);
+       BUG_ON(ret);
 
 #ifdef CONFIG_X86_LOCAL_APIC
        cb.handler_address = (unsigned long)&nmi;

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


 


Rackspace

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