Skip to content

Commit 59dfc3f

Browse files
venkatesh.pallipadi@intel.comIngo Molnar
authored andcommitted
x86: PAT documentation updates with debug info
Documentation update for PAT. Reflect the latest API details. Also, adds details about ways to get more info in order to debug PAT. Signed-off-by: Venkatesh Pallipadi <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent 470fba7 commit 59dfc3f

File tree

1 file changed

+45
-9
lines changed

1 file changed

+45
-9
lines changed

Documentation/x86/pat.txt

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ PAT allows for different types of memory attributes. The most commonly used
1414
ones that will be supported at this time are Write-back, Uncached,
1515
Write-combined and Uncached Minus.
1616

17+
18+
PAT APIs
19+
--------
20+
1721
There are many different APIs in the kernel that allows setting of memory
1822
attributes at the page level. In order to avoid aliasing, these interfaces
1923
should be used thoughtfully. Below is a table of interfaces available,
@@ -26,38 +30,38 @@ address range to avoid any aliasing.
2630
API | RAM | ACPI,... | Reserved/Holes |
2731
-----------------------|----------|------------|------------------|
2832
| | | |
29-
ioremap | -- | UC | UC |
33+
ioremap | -- | UC- | UC- |
3034
| | | |
3135
ioremap_cache | -- | WB | WB |
3236
| | | |
33-
ioremap_nocache | -- | UC | UC |
37+
ioremap_nocache | -- | UC- | UC- |
3438
| | | |
3539
ioremap_wc | -- | -- | WC |
3640
| | | |
37-
set_memory_uc | UC | -- | -- |
41+
set_memory_uc | UC- | -- | -- |
3842
set_memory_wb | | | |
3943
| | | |
4044
set_memory_wc | WC | -- | -- |
4145
set_memory_wb | | | |
4246
| | | |
43-
pci sysfs resource | -- | -- | UC |
47+
pci sysfs resource | -- | -- | UC- |
4448
| | | |
4549
pci sysfs resource_wc | -- | -- | WC |
4650
is IORESOURCE_PREFETCH| | | |
4751
| | | |
48-
pci proc | -- | -- | UC |
52+
pci proc | -- | -- | UC- |
4953
!PCIIOC_WRITE_COMBINE | | | |
5054
| | | |
5155
pci proc | -- | -- | WC |
5256
PCIIOC_WRITE_COMBINE | | | |
5357
| | | |
54-
/dev/mem | -- | UC | UC |
58+
/dev/mem | -- | WB/WC/UC- | WB/WC/UC- |
5559
read-write | | | |
5660
| | | |
57-
/dev/mem | -- | UC | UC |
61+
/dev/mem | -- | UC- | UC- |
5862
mmap SYNC flag | | | |
5963
| | | |
60-
/dev/mem | -- | WB/WC/UC | WB/WC/UC |
64+
/dev/mem | -- | WB/WC/UC- | WB/WC/UC- |
6165
mmap !SYNC flag | |(from exist-| (from exist- |
6266
and | | ing alias)| ing alias) |
6367
any alias to this area| | | |
@@ -68,7 +72,7 @@ pci proc | -- | -- | WC |
6872
and | | | |
6973
MTRR says WB | | | |
7074
| | | |
71-
/dev/mem | -- | -- | UC_MINUS |
75+
/dev/mem | -- | -- | UC- |
7276
mmap !SYNC flag | | | |
7377
no alias to this area | | | |
7478
and | | | |
@@ -98,3 +102,35 @@ types.
98102

99103
Drivers should use set_memory_[uc|wc] to set access type for RAM ranges.
100104

105+
106+
PAT debugging
107+
-------------
108+
109+
With CONFIG_DEBUG_FS enabled, PAT memtype list can be examined by
110+
111+
# mount -t debugfs debugfs /sys/kernel/debug
112+
# cat /sys/kernel/debug/x86/pat_memtype_list
113+
PAT memtype list:
114+
uncached-minus @ 0x7fadf000-0x7fae0000
115+
uncached-minus @ 0x7fb19000-0x7fb1a000
116+
uncached-minus @ 0x7fb1a000-0x7fb1b000
117+
uncached-minus @ 0x7fb1b000-0x7fb1c000
118+
uncached-minus @ 0x7fb1c000-0x7fb1d000
119+
uncached-minus @ 0x7fb1d000-0x7fb1e000
120+
uncached-minus @ 0x7fb1e000-0x7fb25000
121+
uncached-minus @ 0x7fb25000-0x7fb26000
122+
uncached-minus @ 0x7fb26000-0x7fb27000
123+
uncached-minus @ 0x7fb27000-0x7fb28000
124+
uncached-minus @ 0x7fb28000-0x7fb2e000
125+
uncached-minus @ 0x7fb2e000-0x7fb2f000
126+
uncached-minus @ 0x7fb2f000-0x7fb30000
127+
uncached-minus @ 0x7fb31000-0x7fb32000
128+
uncached-minus @ 0x80000000-0x90000000
129+
130+
This list shows physical address ranges and various PAT settings used to
131+
access those physical address ranges.
132+
133+
Another, more verbose way of getting PAT related debug messages is with
134+
"debugpat" boot parameter. With this parameter, various debug messages are
135+
printed to dmesg log.
136+

0 commit comments

Comments
 (0)