diff --git a/sys/i386/xen/mp_machdep.c b/sys/i386/xen/mp_machdep.c
index d6eb35b..ae5b5d4 100644
--- a/sys/i386/xen/mp_machdep.c
+++ b/sys/i386/xen/mp_machdep.c
@@ -783,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);
 }
 
