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
This commit is contained in:
Justin Hibbits 2018-05-22 03:24:16 +00:00
parent 9c6ba29de1
commit 5272c9bd07
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334014

View File

@ -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