summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>2013-09-20 04:35:09 +0000
committergibbs <gibbs@FreeBSD.org>2013-09-20 04:35:09 +0000
commit45812e0f976ce4fd4915dda57316808d8bb5f23e (patch)
tree464afd087da87322178b01e15a85136653941af8 /sys/i386
parent88a4d0f31a9eb87f44806242b097f545ae385c34 (diff)
downloadFreeBSD-src-45812e0f976ce4fd4915dda57316808d8bb5f23e.zip
FreeBSD-src-45812e0f976ce4fd4915dda57316808d8bb5f23e.tar.gz
sys/i386/xen/mp_machdep.c:
sys/i386/xen/mptable.c: Set PCPU apic_id and acpi_id fields in a fasion compatible with both UP and SMP configurations. Suggested by: jhb Submitted by: Roger Pau Monné Sponsored by: Citrix Systems R&D Reviewed by: gibbs Approved by: re (blanket Xen) MFC after: 2 weeks
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/xen/mp_machdep.c10
-rw-r--r--sys/i386/xen/mptable.c2
2 files changed, 9 insertions, 3 deletions
diff --git a/sys/i386/xen/mp_machdep.c b/sys/i386/xen/mp_machdep.c
index be17b64..ae5b5d4 100644
--- a/sys/i386/xen/mp_machdep.c
+++ b/sys/i386/xen/mp_machdep.c
@@ -251,9 +251,6 @@ cpu_add(u_int apic_id, char boot_cpu)
if (bootverbose)
printf("SMP: Added CPU %d (%s)\n", apic_id, boot_cpu ? "BSP" :
"AP");
-
- /* Set the ACPI id (it is needed by VCPU operations) */
- pcpu_find(apic_id)->pc_acpi_id = apic_id;
}
void
@@ -786,6 +783,13 @@ start_all_aps(void)
dpcpu_init((void *)kmem_malloc(kernel_arena, DPCPU_SIZE,
M_WAITOK | M_ZERO), bootAP);
pc->pc_apic_id = cpu_apic_ids[bootAP];
+ /*
+ * The i386 PV port uses the apic_id as vCPU id, but the
+ * PVHVM port needs to use the acpi_id, so set it for PV
+ * also in order to work with shared devices between PV
+ * and PVHVM.
+ */
+ pc->pc_acpi_id = cpu_apic_ids[bootAP];
pc->pc_prvspace = pc;
pc->pc_curthread = 0;
diff --git a/sys/i386/xen/mptable.c b/sys/i386/xen/mptable.c
index 74cb9ab..29d3b33 100644
--- a/sys/i386/xen/mptable.c
+++ b/sys/i386/xen/mptable.c
@@ -87,6 +87,8 @@ static int
mptable_setup_local(void)
{
+ PCPU_SET(apic_id, 0);
+ PCPU_SET(acpi_id, 0);
return (0);
}
OpenPOWER on IntegriCloud