Author: jhibbits
Date: Tue May 22 03:24:16 2018
New Revision: 334014
URL: https://svnweb.freebsd.org/changeset/base/334014
Log:
Add a comment explaining the need of a global temporary variable
cpu_xirr is used only as a temporary location for the OPAL call in
PIC_DISPATCH().
Requested by: nwhitehorn
Modified:
head/sys/powerpc/pseries/xics.c
Modified: head/sys/powerpc/pseries/xics.c
==============================================================================
--- head/sys/powerpc/pseries/xics.c Tue May 22 03:22:02 2018
(r334013)
+++ head/sys/powerpc/pseries/xics.c Tue May 22 03:24:16 2018
(r334014)
@@ -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
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"