summaryrefslogtreecommitdiffstats
path: root/Documentation/x86/pat.txt
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@suse.com>2015-05-26 04:28:12 -0400
committerIngo Molnar <mingo@kernel.org>2015-05-27 08:40:59 -0400
commit2f9e897353fcb99effd6eff22f7b464f8e2a659a (patch)
tree28d3fcab455dabc05a4bd26001e75e0d9481127f /Documentation/x86/pat.txt
parent9e76561f6a8a1a1c4f3152a3fb403ef9d6cfc2ff (diff)
x86/mm/mtrr, pat: Document Write Combining MTRR type effects on PAT / non-PAT pages
As part of the effort to phase out MTRR use document write-combining MTRR effects on pages with different non-PAT page attributes flags and different PAT entry values. Extend arch_phys_wc_add() documentation to clarify power of two sizes / boundary requirements as we phase out mtrr_add() use. Lastly hint towards ioremap_uc() for corner cases on device drivers working with devices with mixed regions where MTRR size requirements would otherwise not enable write-combining effective memory types. Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Antonino Daplas <adaplas@gmail.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Dave Airlie <airlied@redhat.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Davidlohr Bueso <dbueso@suse.de> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Juergen Gross <jgross@suse.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Suresh Siddha <sbsiddha@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Ville Syrjälä <syrjala@sci.fi> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: linux-fbdev@vger.kernel.org Link: http://lkml.kernel.org/r/1430343851-967-3-git-send-email-mcgrof@do-not-panic.com Link: http://lkml.kernel.org/r/1432628901-18044-10-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'Documentation/x86/pat.txt')
-rw-r--r--Documentation/x86/pat.txt35
1 files changed, 34 insertions, 1 deletions
diff --git a/Documentation/x86/pat.txt b/Documentation/x86/pat.txt
index cf08c9fff3cd..521bd8adc3b8 100644
--- a/Documentation/x86/pat.txt
+++ b/Documentation/x86/pat.txt
@@ -34,6 +34,8 @@ ioremap | -- | UC- | UC- |
34 | | | | 34 | | | |
35ioremap_cache | -- | WB | WB | 35ioremap_cache | -- | WB | WB |
36 | | | | 36 | | | |
37ioremap_uc | -- | UC | UC |
38 | | | |
37ioremap_nocache | -- | UC- | UC- | 39ioremap_nocache | -- | UC- | UC- |
38 | | | | 40 | | | |
39ioremap_wc | -- | -- | WC | 41ioremap_wc | -- | -- | WC |
@@ -102,7 +104,38 @@ wants to export a RAM region, it has to do set_memory_uc() or set_memory_wc()
102as step 0 above and also track the usage of those pages and use set_memory_wb() 104as step 0 above and also track the usage of those pages and use set_memory_wb()
103before the page is freed to free pool. 105before the page is freed to free pool.
104 106
105 107MTRR effects on PAT / non-PAT systems
108-------------------------------------
109
110The following table provides the effects of using write-combining MTRRs when
111using ioremap*() calls on x86 for both non-PAT and PAT systems. Ideally
112mtrr_add() usage will be phased out in favor of arch_phys_wc_add() which will
113be a no-op on PAT enabled systems. The region over which a arch_phys_wc_add()
114is made, should already have been ioremapped with WC attributes or PAT entries,
115this can be done by using ioremap_wc() / set_memory_wc(). Devices which
116combine areas of IO memory desired to remain uncacheable with areas where
117write-combining is desirable should consider use of ioremap_uc() followed by
118set_memory_wc() to white-list effective write-combined areas. Such use is
119nevertheless discouraged as the effective memory type is considered
120implementation defined, yet this strategy can be used as last resort on devices
121with size-constrained regions where otherwise MTRR write-combining would
122otherwise not be effective.
123
124----------------------------------------------------------------------
125MTRR Non-PAT PAT Linux ioremap value Effective memory type
126----------------------------------------------------------------------
127 Non-PAT | PAT
128 PAT
129 |PCD
130 ||PWT
131 |||
132WC 000 WB _PAGE_CACHE_MODE_WB WC | WC
133WC 001 WC _PAGE_CACHE_MODE_WC WC* | WC
134WC 010 UC- _PAGE_CACHE_MODE_UC_MINUS WC* | UC
135WC 011 UC _PAGE_CACHE_MODE_UC UC | UC
136----------------------------------------------------------------------
137
138(*) denotes implementation defined and is discouraged
106 139
107Notes: 140Notes:
108 141