summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/mp_machdep.c
diff options
context:
space:
mode:
authorroyger <royger@FreeBSD.org>2014-03-11 10:27:57 +0000
committerroyger <royger@FreeBSD.org>2014-03-11 10:27:57 +0000
commit446e208ee2930dfe281158c48b8376365820cab9 (patch)
tree304558b63ac3bbc1d43d45c1ae1433a290ddc2cc /sys/amd64/amd64/mp_machdep.c
parentb9559720d5e98dec119505471ec9840fc1b3a64b (diff)
downloadFreeBSD-src-446e208ee2930dfe281158c48b8376365820cab9.zip
FreeBSD-src-446e208ee2930dfe281158c48b8376365820cab9.tar.gz
xen: add a hook to perform AP startup
AP startup on PVH follows the PV method, so we need to add a hook in order to diverge from bare metal. Approved by: gibbs Sponsored by: Citrix Systems R&D amd64/amd64/machdep.c: - Add hook for start_all_aps on native (using native_start_all_aps defined in mp_machdep). amd64/amd64/mp_machdep.c: - Make some variables global because they will also be used by the Xen PVH AP startup code. - Use the start_all_aps hook to start APs. - Rename start_all_aps to native_start_all_aps. amd64/include/smp.h: - Add declaration for native_start_all_aps. x86/include/init.h: - Declare start_all_aps hook in init_ops. x86/xen/pv.c: - Pick external declarations from mp_machdep. - Introduce Xen PV code to start APs on PVH. - Set start_all_aps init hook to use the Xen PVH implementation.
Diffstat (limited to 'sys/amd64/amd64/mp_machdep.c')
-rw-r--r--sys/amd64/amd64/mp_machdep.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index 9f03e4c..80b4e12 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$");
#include <machine/specialreg.h>
#include <machine/tss.h>
#include <machine/cpu.h>
+#include <x86/init.h>
#define WARMBOOT_TARGET 0
#define WARMBOOT_OFF (KERNBASE + 0x0467)
@@ -90,7 +91,7 @@ extern struct pcpu __pcpu[];
/* AP uses this during bootstrap. Do not staticize. */
char *bootSTK;
-static int bootAP;
+int bootAP;
/* Free these after use */
void *bootstacks[MAXCPU];
@@ -139,7 +140,7 @@ extern int pmap_pcid_enabled;
static volatile cpuset_t ipi_nmi_pending;
/* used to hold the AP's until we are ready to release them */
-static struct mtx ap_boot_mtx;
+struct mtx ap_boot_mtx;
/* Set to 1 once we're ready to let the APs out of the pen. */
static volatile int aps_ready = 0;
@@ -166,7 +167,6 @@ static int cpu_cores; /* cores per package */
static void assign_cpu_ids(void);
static void set_interrupt_apic_ids(void);
-static int start_all_aps(void);
static int start_ap(int apic_id);
static void release_aps(void *dummy);
@@ -570,7 +570,7 @@ cpu_mp_start(void)
assign_cpu_ids();
/* Start each Application Processor */
- start_all_aps();
+ init_ops.start_all_aps();
set_interrupt_apic_ids();
}
@@ -909,8 +909,8 @@ assign_cpu_ids(void)
/*
* start each AP in our list
*/
-static int
-start_all_aps(void)
+int
+native_start_all_aps(void)
{
vm_offset_t va = boot_address + KERNBASE;
u_int64_t *pt4, *pt3, *pt2;
OpenPOWER on IntegriCloud