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-ia64-devel

[Xen-ia64-devel] [patch] don't dereference xen_start_info when running o

To: Alex Williamson <alex.williamson@xxxxxx>, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [patch] don't dereference xen_start_info when running on raw hardware
From: Jes Sorensen <jes@xxxxxxx>
Date: Tue, 19 Dec 2006 17:57:51 +0100
Delivery-date: Tue, 19 Dec 2006 08:57:46 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.4 (X11/20060527)
Hi,

On ia64 we don't create a xen_start_info when running on raw hardware
so the pointer is NULL. Doesn't work very well with the original
implementation of is_initial_xendomain() :-)

Cheers,
Jes
# HG changeset patch
# User jes@xxxxxxxxxxxxxxxx
# Date 1166546932 -3600
# Node ID 9411fcd9abdeb59fa5a2b3c3f54e1d0432d616c4
# Parent  aabb5fba6a2e12beec379f24fe9ddd656d09c98f
Check we are running under Xen before trying to dereference
xen_start_info! xen_start_info is NULL on ia64 if running raw
hardware.

Signed-off-by: Jes Sorensen <jes@xxxxxxx>

diff -r aabb5fba6a2e -r 9411fcd9abde 
linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h        Tue Dec 19 
12:36:12 2006 +0100
+++ b/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h        Tue Dec 19 
17:48:52 2006 +0100
@@ -215,7 +215,15 @@ asmlinkage int xprintk(const char *fmt, 
 #endif /* CONFIG_XEN || CONFIG_VMX_GUEST */
 
 #ifdef CONFIG_XEN_PRIVILEGED_GUEST
-#define is_initial_xendomain() (xen_start_info->flags & SIF_INITDOMAIN)
+#define is_initial_xendomain()                                         \
+({                                                                     \
+       int retval;                                                     \
+       if (is_running_on_xen())                                        \
+               retval = xen_start_info->flags & SIF_INITDOMAIN;        \
+       else                                                            \
+               retval = 0;                                             \
+       retval;                                                         \
+})
 #else
 #define is_initial_xendomain() 0
 #endif
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>