aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/enlighten.c
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2016-06-30 11:56:39 -0400
committerDavid Vrabel <david.vrabel@citrix.com>2016-07-25 08:33:40 -0400
commite15a8621935cac527b4e0ed4078d24c3e5ef73a6 (patch)
tree0a0e40f71d1f5154eec12a07a9979430aa5b5a71 /arch/x86/xen/enlighten.c
parentad5475f9faf5186b7f59de2c6481ee3e211f1ed7 (diff)
x86/xen: use xen_vcpu_id mapping when pointing vcpu_info to shared_info
shared_info page has space for 32 vcpu info slots for first 32 vCPUs but these are the first 32 vCPUs from Xen's perspective and we should map them accordingly with the newly introduced xen_vcpu_id mapping. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'arch/x86/xen/enlighten.c')
-rw-r--r--arch/x86/xen/enlighten.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 46f3399aee2c..5ca92e600a69 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -207,8 +207,9 @@ static void xen_vcpu_setup(int cpu)
207 if (per_cpu(xen_vcpu, cpu) == &per_cpu(xen_vcpu_info, cpu)) 207 if (per_cpu(xen_vcpu, cpu) == &per_cpu(xen_vcpu_info, cpu))
208 return; 208 return;
209 } 209 }
210 if (cpu < MAX_VIRT_CPUS) 210 if (xen_vcpu_nr(cpu) < MAX_VIRT_CPUS)
211 per_cpu(xen_vcpu,cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu]; 211 per_cpu(xen_vcpu, cpu) =
212 &HYPERVISOR_shared_info->vcpu_info[xen_vcpu_nr(cpu)];
212 213
213 if (!have_vcpu_info_placement) { 214 if (!have_vcpu_info_placement) {
214 if (cpu >= MAX_VIRT_CPUS) 215 if (cpu >= MAX_VIRT_CPUS)
@@ -1783,9 +1784,10 @@ void __ref xen_hvm_init_shared_info(void)
1783 * in that case multiple vcpus might be online. */ 1784 * in that case multiple vcpus might be online. */
1784 for_each_online_cpu(cpu) { 1785 for_each_online_cpu(cpu) {
1785 /* Leave it to be NULL. */ 1786 /* Leave it to be NULL. */
1786 if (cpu >= MAX_VIRT_CPUS) 1787 if (xen_vcpu_nr(cpu) >= MAX_VIRT_CPUS)
1787 continue; 1788 continue;
1788 per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu]; 1789 per_cpu(xen_vcpu, cpu) =
1790 &HYPERVISOR_shared_info->vcpu_info[xen_vcpu_nr(cpu)];
1789 } 1791 }
1790} 1792}
1791 1793