xen-unstable broken due to CONFIG_SMP problem

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

xen-unstable broken due to CONFIG_SMP problem

Dan Magenheimer
A recent change to xen-unstable (cset 8567) changed
vcpu_set_affinity in xen/common/schedule.c to use
cpu_online_mask.  On Xen/ia64 with !CONFIG_SMP, this
variable is not declared so compiling Xen fails.
The attached patch works around the problem but if
vcpu_set_affinity is ever called on Xen/ia64 (with
CONFIG_SMP off), bad things will probably happen.

Since this patch is really a hack, I thought I would
solicit better patches first.  In particular, there
are several hacks to compile !CONFIG_SMP on Xen/ia64...
see config.h and note that most of smpboot.c is #ifdef
CONFIG_SMP (but probably need not be).  Or, since
Xen/x86 always is compiled with CONFIG_SMP, it might
be best to fix CONFIG_SMP (flush_tlb_mask(), possibly
other fixes) and also always compile Xen/ia64 with
CONFIG_SMP.

Any comments?  Any volunteers?

Thanks,
Dan

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

smpboot.patch (542 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: xen-unstable broken due to CONFIG_SMP problem

Keir Fraser

On 12 Jan 2006, at 20:48, Magenheimer, Dan (HP Labs Fort Collins) wrote:

> Since this patch is really a hack, I thought I would
> solicit better patches first.  In particular, there
> are several hacks to compile !CONFIG_SMP on Xen/ia64...
> see config.h and note that most of smpboot.c is #ifdef
> CONFIG_SMP (but probably need not be).  Or, since
> Xen/x86 always is compiled with CONFIG_SMP, it might
> be best to fix CONFIG_SMP (flush_tlb_mask(), possibly
> other fixes) and also always compile Xen/ia64 with
> CONFIG_SMP.
>
> Any comments?  Any volunteers?

In this case the best and simplest fix will simply be to define
cpu_online_map as:
cpumask_t cpu_online_map = CPU_MASK_CPU0.

Or, if you want to share the definition with SMP builds  then declare
cpu_online_map unconditionally with no initialiser and then sometime
during boot make sure you do cpu_online_map =
cpumask_of_cpu(boot_cpu_id);

  -- Keir


_______________________________________________
Xen-ia64-devel mailing list
[hidden email]
http://lists.xensource.com/xen-ia64-devel
Reply | Threaded
Open this post in threaded view
|

Re: xen-unstable broken due to CONFIG_SMP problem

Simon Horman
Keir Fraser <[hidden email]> wrote:

>
> On 12 Jan 2006, at 20:48, Magenheimer, Dan (HP Labs Fort Collins) wrote:
>
>> Since this patch is really a hack, I thought I would
>> solicit better patches first.  In particular, there
>> are several hacks to compile !CONFIG_SMP on Xen/ia64...
>> see config.h and note that most of smpboot.c is #ifdef
>> CONFIG_SMP (but probably need not be).  Or, since
>> Xen/x86 always is compiled with CONFIG_SMP, it might
>> be best to fix CONFIG_SMP (flush_tlb_mask(), possibly
>> other fixes) and also always compile Xen/ia64 with
>> CONFIG_SMP.
>>
>> Any comments?  Any volunteers?
>
> In this case the best and simplest fix will simply be to define
> cpu_online_map as:
> cpumask_t cpu_online_map = CPU_MASK_CPU0.
>
> Or, if you want to share the definition with SMP builds  then declare
> cpu_online_map unconditionally with no initialiser and then sometime
> during boot make sure you do cpu_online_map =
> cpumask_of_cpu(boot_cpu_id);

While sharing the declaration seems desirable, I think
in this case its easier just to duplicate it in smpboot.c.
Here is a patch that is based on Dan's.

--
Horms

Make cpu_online_map = CPU_MASK_CPU0 for UP

Signed-Off-By: Horms <[hidden email]>

diff -r 8c7770e5d673 -r cafcd1d56ce8 xen/arch/ia64/linux-xen/smpboot.c
--- a/xen/arch/ia64/linux-xen/smpboot.c Fri Jan 13 04:31:22 2006
+++ b/xen/arch/ia64/linux-xen/smpboot.c Fri Jan 13 04:34:23 2006
@@ -64,9 +64,8 @@
 #ifdef XEN
 #include <asm/hw_irq.h>
 int ht_per_core = 1;
-#endif
-
-#ifdef CONFIG_SMP /* ifdef XEN */
+
+#ifdef CONFIG_SMP
 
 //#define SMP_DEBUG 0
 #define SMP_DEBUG 1
@@ -915,4 +914,8 @@
  mt_info[index].proc_fixed_addr = info.log2_la;
  }
 }
-#endif /* CONFIG_SMP ifdef XEN */
+#else /*  !CONFIG_SMP */
+cpumask_t cpu_online_map = CPU_MASK_CPU0;
+EXPORT_SYMBOL(cpu_online_map);
+#endif /* CONFIG_SMP */
+#endif /* XEN */




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