aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan.Campbell@xensource.com <Ian.Campbell@xensource.com>2006-03-31 11:04:42 +0100
committerIan.Campbell@xensource.com <Ian.Campbell@xensource.com>2006-03-31 11:04:42 +0100
commit5a5d245c8c59a28503353f57d7b2201b507bf99e (patch)
tree9e7e11d3b689bb8f6175c0e28700a2c74f6ff7d8
parent6601a234d1928515b300f9be15f4c3f6c98043fa (diff)
downloadxen-5a5d245c8c59a28503353f57d7b2201b507bf99e.tar.gz
xen-5a5d245c8c59a28503353f57d7b2201b507bf99e.tar.bz2
xen-5a5d245c8c59a28503353f57d7b2201b507bf99e.zip
Disable xen bus and grant tables when supervisor_mode_kernel is enabled.
Neither of these features are useful/available in this mode since only a single domain is supported. Do not attempt to initialise xen bus when supervisor_mode_kernel is enabled. Do not BUG_ON() failure to setup grant tables, future versions of supervisor_mode_kernel may return -ENOSYS here. Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/core/gnttab.c8
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c8
2 files changed, 14 insertions, 2 deletions
diff --git a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c
index 1049934008..fa12e701d4 100644
--- a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c
+++ b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c
@@ -395,7 +395,10 @@ gnttab_resume(void)
setup.frame_list = frames;
rc = HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1);
- BUG_ON(rc || setup.status);
+ if (rc < 0)
+ return rc;
+
+ BUG_ON(setup.status);
#ifndef __ia64__
if (shared == NULL) {
@@ -436,7 +439,8 @@ gnttab_init(void)
if (xen_init() < 0)
return -ENODEV;
- BUG_ON(gnttab_resume());
+ if (gnttab_resume() < 0)
+ return -ENODEV;
for (i = NR_RESERVED_ENTRIES; i < NR_GRANT_ENTRIES; i++)
gnttab_list[i] = i + 1;
diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
index d3f37e636d..935ec0a5eb 100644
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
@@ -998,6 +998,14 @@ static int __init xenbus_probe_init(void)
device_register(&xenbus_backend.dev);
/*
+ * The supervisor_mode_kernel feature only allows a single
+ * domain so there is no need to initialise event channels
+ * etc.
+ */
+ if (xen_feature(XENFEAT_supervisor_mode_kernel))
+ return -ENODEV;
+
+ /*
* Domain0 doesn't have a store_evtchn or store_mfn yet.
*/
dom0 = (xen_start_info->store_evtchn == 0);