aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorMukesh Rathor <mukesh.rathor@oracle.com>2010-07-19 13:25:08 -0400
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-08-04 17:47:30 -0400
commitc06ee78d73fd24e8d8a65f16380f6a0551107e1b (patch)
treeec5b936b4c1661cff9fd3b5ad8463e86d176a734 /arch/x86
parent8a22b9996b001c88f2bfb54c6de6a05fc39e177a (diff)
xen: support large numbers of CPUs with vcpu info placement
When vcpu info placement is supported, we're not limited to MAX_VIRT_CPUS vcpus. However, if it isn't supported, then ignore any excess vcpus. Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/xen/enlighten.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index fef034a04c24..90a3e8026767 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -97,6 +97,14 @@ struct shared_info *HYPERVISOR_shared_info = (void *)&xen_dummy_shared_info;
97 */ 97 */
98static int have_vcpu_info_placement = 1; 98static int have_vcpu_info_placement = 1;
99 99
100static void clamp_max_cpus(void)
101{
102#ifdef CONFIG_SMP
103 if (setup_max_cpus > MAX_VIRT_CPUS)
104 setup_max_cpus = MAX_VIRT_CPUS;
105#endif
106}
107
100static void xen_vcpu_setup(int cpu) 108static void xen_vcpu_setup(int cpu)
101{ 109{
102 struct vcpu_register_vcpu_info info; 110 struct vcpu_register_vcpu_info info;
@@ -104,13 +112,17 @@ static void xen_vcpu_setup(int cpu)
104 struct vcpu_info *vcpup; 112 struct vcpu_info *vcpup;
105 113
106 BUG_ON(HYPERVISOR_shared_info == &xen_dummy_shared_info); 114 BUG_ON(HYPERVISOR_shared_info == &xen_dummy_shared_info);
107 per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu];
108 115
109 if (!have_vcpu_info_placement) 116 if (cpu < MAX_VIRT_CPUS)
110 return; /* already tested, not available */ 117 per_cpu(xen_vcpu,cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu];
111 118
112 vcpup = &per_cpu(xen_vcpu_info, cpu); 119 if (!have_vcpu_info_placement) {
120 if (cpu >= MAX_VIRT_CPUS)
121 clamp_max_cpus();
122 return;
123 }
113 124
125 vcpup = &per_cpu(xen_vcpu_info, cpu);
114 info.mfn = arbitrary_virt_to_mfn(vcpup); 126 info.mfn = arbitrary_virt_to_mfn(vcpup);
115 info.offset = offset_in_page(vcpup); 127 info.offset = offset_in_page(vcpup);
116 128
@@ -125,6 +137,7 @@ static void xen_vcpu_setup(int cpu)
125 if (err) { 137 if (err) {
126 printk(KERN_DEBUG "register_vcpu_info failed: err=%d\n", err); 138 printk(KERN_DEBUG "register_vcpu_info failed: err=%d\n", err);
127 have_vcpu_info_placement = 0; 139 have_vcpu_info_placement = 0;
140 clamp_max_cpus();
128 } else { 141 } else {
129 /* This cpu is using the registered vcpu info, even if 142 /* This cpu is using the registered vcpu info, even if
130 later ones fail to. */ 143 later ones fail to. */