summaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2016-06-30 17:56:38 +0200
committerDavid Vrabel <david.vrabel@citrix.com>2016-07-25 13:32:34 +0100
commitad5475f9faf5186b7f59de2c6481ee3e211f1ed7 (patch)
treedc9c373319bc1f1927ce10d8937292c17af217ed /drivers/xen
parent88e957d6e47f1232ad15b21e54a44f1147ea8c1b (diff)
downloadlinux-stable-ad5475f9faf5186b7f59de2c6481ee3e211f1ed7.tar.gz
linux-stable-ad5475f9faf5186b7f59de2c6481ee3e211f1ed7.tar.bz2
linux-stable-ad5475f9faf5186b7f59de2c6481ee3e211f1ed7.zip
x86/xen: use xen_vcpu_id mapping for HYPERVISOR_vcpu_op
HYPERVISOR_vcpu_op() passes Linux's idea of vCPU id as a parameter while Xen's idea is expected. In some cases these ideas diverge so we need to do remapping. Convert all callers of HYPERVISOR_vcpu_op() to use xen_vcpu_nr(). Leave xen_fill_possible_map() and xen_filter_cpu_maps() intact as they're only being called by PV guests before perpu areas are initialized. While the issue could be solved by switching to early_percpu for xen_vcpu_id I think it's not worth it: PV guests will probably never get to the point where their idea of vCPU id diverges from Xen's. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/events/events_base.c3
-rw-r--r--drivers/xen/time.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 71d49a95f8c0..8fb7cbf33fc9 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -1211,7 +1211,8 @@ void xen_send_IPI_one(unsigned int cpu, enum ipi_vector vector)
#ifdef CONFIG_X86
if (unlikely(vector == XEN_NMI_VECTOR)) {
- int rc = HYPERVISOR_vcpu_op(VCPUOP_send_nmi, cpu, NULL);
+ int rc = HYPERVISOR_vcpu_op(VCPUOP_send_nmi, xen_vcpu_nr(cpu),
+ NULL);
if (rc < 0)
printk(KERN_WARNING "Sending nmi to CPU%d failed (rc:%d)\n", cpu, rc);
return;
diff --git a/drivers/xen/time.c b/drivers/xen/time.c
index a7fe35b58341..48c3f6983067 100644
--- a/drivers/xen/time.c
+++ b/drivers/xen/time.c
@@ -95,7 +95,7 @@ void xen_setup_runstate_info(int cpu)
area.addr.v = &per_cpu(xen_runstate, cpu);
if (HYPERVISOR_vcpu_op(VCPUOP_register_runstate_memory_area,
- cpu, &area))
+ xen_vcpu_nr(cpu), &area))
BUG();
}