Date: Tue, 22 May 2018 03:24:17 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334014 - head/sys/powerpc/pseries Message-ID: <201805220324.w4M3OHVq000101@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805220324.w4M3OHVq000101>