]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC: r196769, r196771, r211424, r215703, r215754
authorjkim <jkim@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 26 Nov 2010 21:16:21 +0000 (21:16 +0000)
committerjkim <jkim@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 26 Nov 2010 21:16:21 +0000 (21:16 +0000)
commitb552d20b6044acf9f1129b421214c566c8268a67
treeeb6e9dafa90ee876360f6328905e1834a721300f
parentd9ce5cb4ce8595d6d04fc54e67163acbb37893c8
MFC: r196769, r196771, r211424, r215703, r215754

- Disable caches and flush caches/TLBs when we update PAT as we do for MTRR.
Flushing TLBs is required to ensure cache coherency according to the AMD64
architecture manual.  Flushing caches is only required when changing from a
cacheable memory type (WB, WP or WT) to an uncacheable type (WC, UC or UC-).
Since this function is only used once per processor during startup, there is
no need to take any shortcuts.
- Leave PAT indices 0-3 at the default of WB, WT, UC-, and UC.  Program 5 as
WP (from default WT) and 6 as WC (from default UC-).  Leave 4 and 7 at the
default of WB and UC.  This is to avoid transition from a cacheable memory
type to an uncacheable type to minimize possible cache incoherency.  Since
we perform flushing caches and TLBs now, this change may not be necessary
any more but we do not want to take any chances.
- Improve pmap_cache_bits() with an array to map PAT memory type to index.
This array is initialized early from pmap_init_pat(), so that we do not need
to handle special cases in the function any more.  Now this function is
identical on both amd64 and i386.

git-svn-id: svn://svn.freebsd.org/base/stable/8@215896 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/amd64/amd64/pmap.c
sys/i386/i386/pmap.c