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-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Use set_callbacks hypercall if callback_op is not available.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 22 Apr 2006 11:02:12 +0000
Delivery-date: Sat, 22 Apr 2006 04:05:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Use set_callbacks hypercall if callback_op is not available., Xen patchbot -unstable <=