[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [IA64] MAX_VIRT_CPUS and NR_CPUS



# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID 8e0b9f31cf3f8bc8a4646a1eb42596e0e9b0a880
# Parent  71e0c2ed44478fddb4773fa347ceab365292e004
[IA64] MAX_VIRT_CPUS and NR_CPUS

Increase MAX_VIRT_CPUS and NR_CPUS to 64.
Check maxcpus < MAX_VIRT_CPUS.
Check size of shared_info (<= PAGE_SIZE).

Signed-off-by: Tristan Gingold <tristan.gingold@xxxxxxxx>

diff -r 71e0c2ed4447 -r 8e0b9f31cf3f xen/arch/ia64/asm-offsets.c
--- a/xen/arch/ia64/asm-offsets.c       Fri Apr 07 11:35:29 2006 -0600
+++ b/xen/arch/ia64/asm-offsets.c       Fri Apr 07 11:40:33 2006 -0600
@@ -30,6 +30,7 @@ void foo(void)
        DEFINE(IA64_SWITCH_STACK_SIZE, sizeof (struct switch_stack));
        DEFINE(IA64_CPU_SIZE, sizeof (struct cpuinfo_ia64));
        DEFINE(UNW_FRAME_INFO_SIZE, sizeof (struct unw_frame_info));
+       DEFINE(SHARED_INFO_SIZE, sizeof (struct shared_info));
 
        BLANK();
 #ifdef   VTI_DEBUG
diff -r 71e0c2ed4447 -r 8e0b9f31cf3f xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c      Fri Apr 07 11:35:29 2006 -0600
+++ b/xen/arch/ia64/xen/xensetup.c      Fri Apr 07 11:40:33 2006 -0600
@@ -24,6 +24,12 @@
 #include <asm/vmx.h>
 #include <linux/efi.h>
 
+/* Be sure the struct shared_info fits on a page because it is mapped in
+   domain. */
+#if SHARED_INFO_SIZE > PAGE_SIZE
+ #error "struct shared_info does not not fit in PAGE_SIZE"
+#endif
+
 unsigned long xenheap_phys_end;
 
 char saved_command_line[COMMAND_LINE_SIZE];
@@ -321,7 +327,13 @@ printk("About to call timer_init()\n");
         //boot_cpu_data.x86_num_cores = 1;
     }
 
+    /* A vcpu is created for the idle domain on every physical cpu.
+       Limit the number of cpus to the maximum number of vcpus.  */
+    if (max_cpus > MAX_VIRT_CPUS)
+        max_cpus = MAX_VIRT_CPUS;
+
     smp_prepare_cpus(max_cpus);
+
     /* We aren't hotplug-capable yet. */
     for_each_cpu ( i )
         cpu_set(i, cpu_present_map);
diff -r 71e0c2ed4447 -r 8e0b9f31cf3f xen/include/asm-ia64/config.h
--- a/xen/include/asm-ia64/config.h     Fri Apr 07 11:35:29 2006 -0600
+++ b/xen/include/asm-ia64/config.h     Fri Apr 07 11:40:33 2006 -0600
@@ -25,17 +25,12 @@
 
 #ifdef CONFIG_XEN_SMP
 #define CONFIG_SMP 1
-#define NR_CPUS 8
-#define CONFIG_NR_CPUS 8
+#define NR_CPUS 64
 #else
 #undef CONFIG_SMP
 #define NR_CPUS 1
-#define CONFIG_NR_CPUS 1
-#endif
-//#define NR_CPUS 16
-//#define CONFIG_NR_CPUS 16
-//leave SMP for a later time
-//#undef CONFIG_SMP
+#endif
+#define CONFIG_NR_CPUS NR_CPUS
 
 #define supervisor_mode_kernel (0)
 
@@ -121,9 +116,6 @@ extern char _end[]; /* standard ELF symb
 #define CMPXCHG_BUGCHECK_DECL
 
 // from include/asm-ia64/smp.h
-#ifdef CONFIG_SMP
-//#warning "Lots of things to fix to enable CONFIG_SMP!"
-#endif
 #define        get_cpu()       smp_processor_id()
 #define put_cpu()      do {} while(0)
 
@@ -284,13 +276,6 @@ extern int ht_per_core;
 #endif /* __ASSEMBLY__ */
 #endif /* __XEN_IA64_CONFIG_H__ */
 
-// needed for include/xen/smp.h
-//#ifdef CONFIG_SMP
-//#define raw_smp_processor_id()       current->processor
-//#else
-//#define raw_smp_processor_id()       0
-//#endif
-
 #ifndef __ASSEMBLY__
 #include <linux/linkage.h>
 #define FORCE_CRASH()  asm("break.m 0;;");
diff -r 71e0c2ed4447 -r 8e0b9f31cf3f xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h    Fri Apr 07 11:35:29 2006 -0600
+++ b/xen/include/public/arch-ia64.h    Fri Apr 07 11:40:33 2006 -0600
@@ -31,7 +31,7 @@ DEFINE_GUEST_HANDLE(void);
 
 /* Maximum number of virtual CPUs in multi-processor guests. */
 /* WARNING: before changing this, check that shared_info fits on a page */
-#define MAX_VIRT_CPUS 4
+#define MAX_VIRT_CPUS 64
 
 #ifndef __ASSEMBLY__
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.