Skip to contentSkip to conversation

linux: Fix current_vcpu_info for UP case

PATCH New Jan Beulich 1 participant 1 message Feb 23, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux: Fix current_vcpu_info for UP case

Under !CONFIG_SMP, smp.h is not always included and hence smp_processor_id() not always visible.

include/asm-i386/mach-xen/asm/hypervisor.h +4 -0
Index: head-2007-02-08/include/asm-i386/mach-xen/asm/hypervisor.h
===================================================================
@@ -57,7 +57,11 @@
 extern shared_info_t *HYPERVISOR_shared_info;
 
 #define vcpu_info(cpu) (HYPERVISOR_shared_info->vcpu_info + (cpu))
+#ifdef CONFIG_SMP
 #define current_vcpu_info() vcpu_info(smp_processor_id())
+#else
+#define current_vcpu_info() vcpu_info(0)
+#endif
 
 #ifdef CONFIG_X86_32
 extern unsigned long hypervisor_virt_start;