Lines Matching +full:no +full:- +full:memory +full:- +full:wc
4 x86 Page Attribute Table (PAT) allows for setting the memory attribute at the
6 for setting of memory types over physical address ranges. However, PAT is
8 and also due to the fact that there are no hardware limitations on number of
10 not having memory type aliasing for the same physical memory with multiple
13 PAT allows for different types of memory attributes. The most commonly used
14 ones that will be supported at this time are Write-back, Uncached,
15 Write-combined, Write-through and Uncached Minus.
19 --------
21 There are many different APIs in the kernel that allows setting of memory
24 their intended usage and their memory attribute relationships. Internally,
29 -------------------------------------------------------------------
31 -----------------------|----------|------------|------------------|
33 ioremap | -- | UC- | UC- |
35 ioremap_cache | -- | WB | WB |
37 ioremap_uc | -- | UC | UC |
39 ioremap_nocache | -- | UC- | UC- |
41 ioremap_wc | -- | -- | WC |
43 ioremap_wt | -- | -- | WT |
45 set_memory_uc | UC- | -- | -- |
48 set_memory_wc | WC | -- | -- |
51 set_memory_wt | WT | -- | -- |
54 pci sysfs resource | -- | -- | UC- |
56 pci sysfs resource_wc | -- | -- | WC |
59 pci proc | -- | -- | UC- |
62 pci proc | -- | -- | WC |
65 /dev/mem | -- | WB/WC/UC- | WB/WC/UC- |
66 read-write | | | |
68 /dev/mem | -- | UC- | UC- |
71 /dev/mem | -- | WB/WC/UC- | WB/WC/UC- |
72 mmap !SYNC flag | |(from exist-| (from exist- |
76 /dev/mem | -- | WB | WB |
78 no alias to this area | | | |
82 /dev/mem | -- | -- | UC- |
84 no alias to this area | | | |
88 -------------------------------------------------------------------
91 -------------------------
104 In addition, step 2 internally tracks the region as UC or WC in memtype
105 list in order to ensure no conflicting mapping.
112 MTRR effects on PAT / non-PAT systems
113 -------------------------------------
115 The following table provides the effects of using write-combining MTRRs when
116 using ioremap*() calls on x86 for both non-PAT and PAT systems. Ideally
118 be a no-op on PAT enabled systems. The region over which a arch_phys_wc_add()
119 is made, should already have been ioremapped with WC attributes or PAT entries,
121 combine areas of IO memory desired to remain uncacheable with areas where
122 write-combining is desirable should consider use of ioremap_uc() followed by
123 set_memory_wc() to white-list effective write-combined areas. Such use is
124 nevertheless discouraged as the effective memory type is considered
126 with size-constrained regions where otherwise MTRR write-combining would
129 ----------------------------------------------------------------------
130 MTRR Non-PAT PAT Linux ioremap value Effective memory type
131 ----------------------------------------------------------------------
132 Non-PAT | PAT
137 WC 000 WB _PAGE_CACHE_MODE_WB WC | WC
138 WC 001 WC _PAGE_CACHE_MODE_WC WC* | WC
139 WC 010 UC- _PAGE_CACHE_MODE_UC_MINUS WC* | UC
140 WC 011 UC _PAGE_CACHE_MODE_UC UC | UC
141 ----------------------------------------------------------------------
147 -- in the above table mean "Not suggested usage for the API". Some of the --'s
151 For ioremap and pci access through /sys or /proc - The actual type returned
154 return uncached mapping in place of write-combine requested.
156 set_memory_[uc|wc|wt] and set_memory_wb should be used in pairs, where driver
157 will first make a region uc, wc or wt and switch it back to wb after use.
162 Drivers should use ioremap_[uc|wc] to access PCI BARs with [uc|wc] access
165 Drivers should use set_memory_[uc|wc|wt] to set access type for RAM ranges.
169 -------------
173 # mount -t debugfs debugfs /sys/kernel/debug
176 uncached-minus @ 0x7fadf000-0x7fae0000
177 uncached-minus @ 0x7fb19000-0x7fb1a000
178 uncached-minus @ 0x7fb1a000-0x7fb1b000
179 uncached-minus @ 0x7fb1b000-0x7fb1c000
180 uncached-minus @ 0x7fb1c000-0x7fb1d000
181 uncached-minus @ 0x7fb1d000-0x7fb1e000
182 uncached-minus @ 0x7fb1e000-0x7fb25000
183 uncached-minus @ 0x7fb25000-0x7fb26000
184 uncached-minus @ 0x7fb26000-0x7fb27000
185 uncached-minus @ 0x7fb27000-0x7fb28000
186 uncached-minus @ 0x7fb28000-0x7fb2e000
187 uncached-minus @ 0x7fb2e000-0x7fb2f000
188 uncached-minus @ 0x7fb2f000-0x7fb30000
189 uncached-minus @ 0x7fb31000-0x7fb32000
190 uncached-minus @ 0x80000000-0x90000000
200 ------------------
203 configurations. The PAT MSR must be updated by Linux in order to support WC
205 by the firmware. Note, Xen enables WC attribute in the PAT MSR for guests.
209 E E MTRR -> PAT init Enabled OS
210 E D MTRR -> PAT init Disabled -
211 D E MTRR -> PAT disable Disabled BIOS
212 D D MTRR -> PAT disable Disabled -
213 - np/E PAT -> PAT disable Disabled BIOS
214 - np/D PAT -> PAT disable Disabled -
215 E !P/E MTRR -> PAT init Disabled BIOS
216 D !P/E MTRR -> PAT disable Disabled BIOS
217 !M !P/E MTRR stub -> PAT disable Disabled BIOS
220 ------------------------------------------------