Skip to contentSkip to conversation

PATCH: fix some transparent virtualization issues

PATCH Tristan Gingold 1 participant 1 message Jun 21, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

small patch to fix some issues wrt transparent virtualization.

Tested by booting on ia64 bare box and under xen.

Tristan.

# HG changeset patch
# User gingold@virtu10
# Node ID 2458be180782060cc805bc2f5e3ff165391d50ee # Parent 8314141cfe543d0e83b15a6eca9569df4b82a0b2 Transparent virtualization fixes.

linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c +2 -2
diff -r 8314141cfe54 -r 2458be180782 linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
@@ -464,10 +464,10 @@ static int __init balloon_init(void)
 	unsigned long pfn;
 	struct page *page;
 
-	IPRINTK("Initialising balloon driver.\n");
-
 	if (!is_running_on_xen())
 		return -ENODEV;
+
+	IPRINTK("Initialising balloon driver.\n");
 
 	current_pages = min(xen_start_info->nr_pages, max_pfn);
 	totalram_pages = current_pages;
linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c +3 -0
diff -r 8314141cfe54 -r 2458be180782 linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c
@@ -109,6 +109,9 @@ static int __init setup_vcpu_hotplug_eve
 	static struct notifier_block xsn_cpu = {
 		.notifier_call = setup_cpu_watcher };
 
+	if (!is_running_on_xen())
+		return -ENODEV;
+
 	register_cpu_notifier(&hotplug_cpu);
 	register_xenstore_notifier(&xsn_cpu);
 
linux-2.6-xen-sparse/drivers/xen/core/evtchn.c +5 -1
diff -r 8314141cfe54 -r 2458be180782 linux-2.6-xen-sparse/drivers/xen/core/evtchn.c
@@ -666,7 +666,11 @@ int irq_ignore_unhandled(unsigned int ir
 int irq_ignore_unhandled(unsigned int irq)
 {
 	struct physdev_irq_status_query irq_status = { .irq = irq };
-	(void)HYPERVISOR_physdev_op(PHYSDEVOP_irq_status_query, &irq_status);
+
+	if (!is_running_on_xen())
+		return 0;
+
+	(void)HYPERVISOR_physdev_op(PHYSDEVOP_irq_status_query,&irq_status);
 	return !!(irq_status.flags & XENIRQSTAT_shared);
 }
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel