aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/pseries
diff options
context:
space:
mode:
authorJustin Hibbits <jhibbits@FreeBSD.org>2018-05-22 03:24:16 +0000
committerJustin Hibbits <jhibbits@FreeBSD.org>2018-05-22 03:24:16 +0000
commit5272c9bd07e0678a51c0b895866446805579c3af (patch)
tree357c32ef4391304a24b6d631c28d3db0d4f74e0c /sys/powerpc/pseries
parent9c6ba29de1012609493a3ba0b3afdbb110f1790e (diff)
Notes
Diffstat (limited to 'sys/powerpc/pseries')
-rw-r--r--sys/powerpc/pseries/xics.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/powerpc/pseries/xics.c b/sys/powerpc/pseries/xics.c
index 558220824b9a3..802f0e8e4b6a8 100644
--- a/sys/powerpc/pseries/xics.c
+++ b/sys/powerpc/pseries/xics.c
@@ -140,6 +140,15 @@ static driver_t xics_driver = {
};
#ifdef POWERNV
+/* We can only pass physical addresses into OPAL. Kernel stacks are in the KVA,
+ * not in the direct map, so we need to somehow extract the physical address.
+ * However, pmap_kextract() takes locks, which is forbidden in a critical region
+ * (which PMAP_DISPATCH() operates in). The kernel is mapped into the Direct
+ * Map (0xc000....), and the CPU implicitly drops the top two bits when doing
+ * real address by nature that the bus width is smaller than 64-bits. Placing
+ * cpu_xirr into the DMAP lets us take advantage of this and avoids the
+ * pmap_kextract() that would otherwise be needed if using the stack variable.
+ */
static uint32_t cpu_xirr[MAXCPU];
#endif