diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-18 11:25:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-18 11:25:51 -0400 |
commit | 9e9abecfc0ff3a9ad2ead954b37bbfcb863c775e (patch) | |
tree | 0c3ffda953b82750638a06507591ad587b565ff2 /Documentation/x86/pat.txt | |
parent | d7bb545d86825e635cab33a1dd81ca0ad7b92887 (diff) | |
parent | 77ad386e596c6b0930cc2e09e3cce485e3ee7f72 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86: (613 commits)
x86: standalone trampoline code
x86: move suspend wakeup code to C
x86: coding style fixes to arch/x86/kernel/acpi/sleep.c
x86: setup_trampoline() - fix section mismatch warning
x86: section mismatch fixes, #1
x86: fix paranoia about using BIOS quickboot mechanism.
x86: print out buggy mptable
x86: use cpu_online()
x86: use cpumask_of_cpu()
x86: remove unnecessary tmp local variable
x86: remove unnecessary memset()
x86: use ioapic_read_entry() and ioapic_write_entry()
x86: avoid redundant loop in io_apic_level_ack_pending()
x86: remove superfluous initialisation in boot code.
x86: merge mpparse_{32,64}.c
x86: unify mp_register_gsi
x86: unify mp_config_acpi_legacy_irqs
x86: unify mp_register_ioapic
x86: unify uniq_io_apic_id
x86: unify smp_scan_config
...
Diffstat (limited to 'Documentation/x86/pat.txt')
-rw-r--r-- | Documentation/x86/pat.txt | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/Documentation/x86/pat.txt b/Documentation/x86/pat.txt new file mode 100644 index 000000000000..17965f927c15 --- /dev/null +++ b/Documentation/x86/pat.txt | |||
@@ -0,0 +1,100 @@ | |||
1 | |||
2 | PAT (Page Attribute Table) | ||
3 | |||
4 | x86 Page Attribute Table (PAT) allows for setting the memory attribute at the | ||
5 | page level granularity. PAT is complementary to the MTRR settings which allows | ||
6 | for setting of memory types over physical address ranges. However, PAT is | ||
7 | more flexible than MTRR due to its capability to set attributes at page level | ||
8 | and also due to the fact that there are no hardware limitations on number of | ||
9 | such attribute settings allowed. Added flexibility comes with guidelines for | ||
10 | not having memory type aliasing for the same physical memory with multiple | ||
11 | virtual addresses. | ||
12 | |||
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 and Uncached Minus. | ||
16 | |||
17 | There are many different APIs in the kernel that allows setting of memory | ||
18 | attributes at the page level. In order to avoid aliasing, these interfaces | ||
19 | should be used thoughtfully. Below is a table of interfaces available, | ||
20 | their intended usage and their memory attribute relationships. Internally, | ||
21 | these APIs use a reserve_memtype()/free_memtype() interface on the physical | ||
22 | address range to avoid any aliasing. | ||
23 | |||
24 | |||
25 | ------------------------------------------------------------------- | ||
26 | API | RAM | ACPI,... | Reserved/Holes | | ||
27 | -----------------------|----------|------------|------------------| | ||
28 | | | | | | ||
29 | ioremap | -- | UC | UC | | ||
30 | | | | | | ||
31 | ioremap_cache | -- | WB | WB | | ||
32 | | | | | | ||
33 | ioremap_nocache | -- | UC | UC | | ||
34 | | | | | | ||
35 | ioremap_wc | -- | -- | WC | | ||
36 | | | | | | ||
37 | set_memory_uc | UC | -- | -- | | ||
38 | set_memory_wb | | | | | ||
39 | | | | | | ||
40 | set_memory_wc | WC | -- | -- | | ||
41 | set_memory_wb | | | | | ||
42 | | | | | | ||
43 | pci sysfs resource | -- | -- | UC | | ||
44 | | | | | | ||
45 | pci sysfs resource_wc | -- | -- | WC | | ||
46 | is IORESOURCE_PREFETCH| | | | | ||
47 | | | | | | ||
48 | pci proc | -- | -- | UC | | ||
49 | !PCIIOC_WRITE_COMBINE | | | | | ||
50 | | | | | | ||
51 | pci proc | -- | -- | WC | | ||
52 | PCIIOC_WRITE_COMBINE | | | | | ||
53 | | | | | | ||
54 | /dev/mem | -- | UC | UC | | ||
55 | read-write | | | | | ||
56 | | | | | | ||
57 | /dev/mem | -- | UC | UC | | ||
58 | mmap SYNC flag | | | | | ||
59 | | | | | | ||
60 | /dev/mem | -- | WB/WC/UC | WB/WC/UC | | ||
61 | mmap !SYNC flag | |(from exist-| (from exist- | | ||
62 | and | | ing alias)| ing alias) | | ||
63 | any alias to this area| | | | | ||
64 | | | | | | ||
65 | /dev/mem | -- | WB | WB | | ||
66 | mmap !SYNC flag | | | | | ||
67 | no alias to this area | | | | | ||
68 | and | | | | | ||
69 | MTRR says WB | | | | | ||
70 | | | | | | ||
71 | /dev/mem | -- | -- | UC_MINUS | | ||
72 | mmap !SYNC flag | | | | | ||
73 | no alias to this area | | | | | ||
74 | and | | | | | ||
75 | MTRR says !WB | | | | | ||
76 | | | | | | ||
77 | ------------------------------------------------------------------- | ||
78 | |||
79 | Notes: | ||
80 | |||
81 | -- in the above table mean "Not suggested usage for the API". Some of the --'s | ||
82 | are strictly enforced by the kernel. Some others are not really enforced | ||
83 | today, but may be enforced in future. | ||
84 | |||
85 | For ioremap and pci access through /sys or /proc - The actual type returned | ||
86 | can be more restrictive, in case of any existing aliasing for that address. | ||
87 | For example: If there is an existing uncached mapping, a new ioremap_wc can | ||
88 | return uncached mapping in place of write-combine requested. | ||
89 | |||
90 | set_memory_[uc|wc] and set_memory_wb should be used in pairs, where driver will | ||
91 | first make a region uc or wc and switch it back to wb after use. | ||
92 | |||
93 | Over time writes to /proc/mtrr will be deprecated in favor of using PAT based | ||
94 | interfaces. Users writing to /proc/mtrr are suggested to use above interfaces. | ||
95 | |||
96 | Drivers should use ioremap_[uc|wc] to access PCI BARs with [uc|wc] access | ||
97 | types. | ||
98 | |||
99 | Drivers should use set_memory_[uc|wc] to set access type for RAM ranges. | ||
100 | |||