summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroyger <royger@FreeBSD.org>2014-03-11 10:26:16 +0000
committerroyger <royger@FreeBSD.org>2014-03-11 10:26:16 +0000
commit419270d8a7d84feadecd76977c54cdd6dc938194 (patch)
tree74b49c4b94fdcf1b0802b81eaf63347749509c23
parent66d3470d387d182c6520811cc7c33f4eae55d96b (diff)
downloadFreeBSD-src-419270d8a7d84feadecd76977c54cdd6dc938194.zip
FreeBSD-src-419270d8a7d84feadecd76977c54cdd6dc938194.tar.gz
xen: add hook for AP bootstrap memory reservation
This hook will only be implemented for bare metal, Xen doesn't require any bootstrap code since APs are started in long mode with paging enabled. Approved by: gibbs Sponsored by: Citrix Systems R&D amd64/amd64/machdep.c: - Set mp_bootaddress hook for bare metal. x86/include/init.h: - Define mp_bootaddress in init_ops.
-rw-r--r--sys/amd64/amd64/machdep.c15
-rw-r--r--sys/x86/include/init.h1
2 files changed, 12 insertions, 4 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 857d7e9..d2780fe 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -178,6 +178,9 @@ struct init_ops init_ops = {
.early_clock_source_init = i8254_init,
.early_delay = i8254_delay,
.parse_memmap = native_parse_memmap,
+#ifdef SMP
+ .mp_bootaddress = mp_bootaddress,
+#endif
};
/*
@@ -1490,10 +1493,14 @@ getmemsize(caddr_t kmdp, u_int64_t first)
if (basemem == 0)
panic("BIOS smap did not include a basemem segment!");
-#ifdef SMP
- /* make hole for AP bootstrap code */
- physmap[1] = mp_bootaddress(physmap[1] / 1024);
-#endif
+ /*
+ * Make hole for "AP -> long mode" bootstrap code. The
+ * mp_bootaddress vector is only available when the kernel
+ * is configured to support APs and APs for the system start
+ * in 32bit mode (e.g. SMP bare metal).
+ */
+ if (init_ops.mp_bootaddress)
+ physmap[1] = init_ops.mp_bootaddress(physmap[1] / 1024);
/*
* Maxmem isn't the "maximum memory", it's one larger than the
diff --git a/sys/x86/include/init.h b/sys/x86/include/init.h
index 562e582..edc8418 100644
--- a/sys/x86/include/init.h
+++ b/sys/x86/include/init.h
@@ -39,6 +39,7 @@ struct init_ops {
void (*early_clock_source_init)(void);
void (*early_delay)(int);
void (*parse_memmap)(caddr_t, vm_paddr_t *, int *);
+ u_int (*mp_bootaddress)(u_int);
};
extern struct init_ops init_ops;
OpenPOWER on IntegriCloud