aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/x86
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/x86')
-rw-r--r--Documentation/x86/00-INDEX4
-rw-r--r--Documentation/x86/boot.txt (renamed from Documentation/x86/i386/boot.txt)2
-rw-r--r--Documentation/x86/mtrr.txt305
-rw-r--r--Documentation/x86/pat.txt54
-rw-r--r--Documentation/x86/usb-legacy-support.txt (renamed from Documentation/x86/i386/usb-legacy-support.txt)0
-rw-r--r--Documentation/x86/x86_64/boot-options.txt4
-rw-r--r--Documentation/x86/zero-page.txt (renamed from Documentation/x86/i386/zero-page.txt)0
7 files changed, 355 insertions, 14 deletions
diff --git a/Documentation/x86/00-INDEX b/Documentation/x86/00-INDEX
new file mode 100644
index 000000000000..dbe3377754af
--- /dev/null
+++ b/Documentation/x86/00-INDEX
@@ -0,0 +1,4 @@
100-INDEX
2 - this file
3mtrr.txt
4 - how to use x86 Memory Type Range Registers to increase performance
diff --git a/Documentation/x86/i386/boot.txt b/Documentation/x86/boot.txt
index 147bfe511cdd..83c0033ee9e0 100644
--- a/Documentation/x86/i386/boot.txt
+++ b/Documentation/x86/boot.txt
@@ -308,7 +308,7 @@ Protocol: 2.00+
308 308
309Field name: start_sys 309Field name: start_sys
310Type: read 310Type: read
311Offset/size: 0x20c/4 311Offset/size: 0x20c/2
312Protocol: 2.00+ 312Protocol: 2.00+
313 313
314 The load low segment (0x1000). Obsolete. 314 The load low segment (0x1000). Obsolete.
diff --git a/Documentation/x86/mtrr.txt b/Documentation/x86/mtrr.txt
new file mode 100644
index 000000000000..cc071dc333c2
--- /dev/null
+++ b/Documentation/x86/mtrr.txt
@@ -0,0 +1,305 @@
1MTRR (Memory Type Range Register) control
23 Jun 1999
3Richard Gooch
4<rgooch@atnf.csiro.au>
5
6 On Intel P6 family processors (Pentium Pro, Pentium II and later)
7 the Memory Type Range Registers (MTRRs) may be used to control
8 processor access to memory ranges. This is most useful when you have
9 a video (VGA) card on a PCI or AGP bus. Enabling write-combining
10 allows bus write transfers to be combined into a larger transfer
11 before bursting over the PCI/AGP bus. This can increase performance
12 of image write operations 2.5 times or more.
13
14 The Cyrix 6x86, 6x86MX and M II processors have Address Range
15 Registers (ARRs) which provide a similar functionality to MTRRs. For
16 these, the ARRs are used to emulate the MTRRs.
17
18 The AMD K6-2 (stepping 8 and above) and K6-3 processors have two
19 MTRRs. These are supported. The AMD Athlon family provide 8 Intel
20 style MTRRs.
21
22 The Centaur C6 (WinChip) has 8 MCRs, allowing write-combining. These
23 are supported.
24
25 The VIA Cyrix III and VIA C3 CPUs offer 8 Intel style MTRRs.
26
27 The CONFIG_MTRR option creates a /proc/mtrr file which may be used
28 to manipulate your MTRRs. Typically the X server should use
29 this. This should have a reasonably generic interface so that
30 similar control registers on other processors can be easily
31 supported.
32
33
34There are two interfaces to /proc/mtrr: one is an ASCII interface
35which allows you to read and write. The other is an ioctl()
36interface. The ASCII interface is meant for administration. The
37ioctl() interface is meant for C programs (i.e. the X server). The
38interfaces are described below, with sample commands and C code.
39
40===============================================================================
41Reading MTRRs from the shell:
42
43% cat /proc/mtrr
44reg00: base=0x00000000 ( 0MB), size= 128MB: write-back, count=1
45reg01: base=0x08000000 ( 128MB), size= 64MB: write-back, count=1
46===============================================================================
47Creating MTRRs from the C-shell:
48# echo "base=0xf8000000 size=0x400000 type=write-combining" >! /proc/mtrr
49or if you use bash:
50# echo "base=0xf8000000 size=0x400000 type=write-combining" >| /proc/mtrr
51
52And the result thereof:
53% cat /proc/mtrr
54reg00: base=0x00000000 ( 0MB), size= 128MB: write-back, count=1
55reg01: base=0x08000000 ( 128MB), size= 64MB: write-back, count=1
56reg02: base=0xf8000000 (3968MB), size= 4MB: write-combining, count=1
57
58This is for video RAM at base address 0xf8000000 and size 4 megabytes. To
59find out your base address, you need to look at the output of your X
60server, which tells you where the linear framebuffer address is. A
61typical line that you may get is:
62
63(--) S3: PCI: 968 rev 0, Linear FB @ 0xf8000000
64
65Note that you should only use the value from the X server, as it may
66move the framebuffer base address, so the only value you can trust is
67that reported by the X server.
68
69To find out the size of your framebuffer (what, you don't actually
70know?), the following line will tell you:
71
72(--) S3: videoram: 4096k
73
74That's 4 megabytes, which is 0x400000 bytes (in hexadecimal).
75A patch is being written for XFree86 which will make this automatic:
76in other words the X server will manipulate /proc/mtrr using the
77ioctl() interface, so users won't have to do anything. If you use a
78commercial X server, lobby your vendor to add support for MTRRs.
79===============================================================================
80Creating overlapping MTRRs:
81
82%echo "base=0xfb000000 size=0x1000000 type=write-combining" >/proc/mtrr
83%echo "base=0xfb000000 size=0x1000 type=uncachable" >/proc/mtrr
84
85And the results: cat /proc/mtrr
86reg00: base=0x00000000 ( 0MB), size= 64MB: write-back, count=1
87reg01: base=0xfb000000 (4016MB), size= 16MB: write-combining, count=1
88reg02: base=0xfb000000 (4016MB), size= 4kB: uncachable, count=1
89
90Some cards (especially Voodoo Graphics boards) need this 4 kB area
91excluded from the beginning of the region because it is used for
92registers.
93
94NOTE: You can only create type=uncachable region, if the first
95region that you created is type=write-combining.
96===============================================================================
97Removing MTRRs from the C-shell:
98% echo "disable=2" >! /proc/mtrr
99or using bash:
100% echo "disable=2" >| /proc/mtrr
101===============================================================================
102Reading MTRRs from a C program using ioctl()'s:
103
104/* mtrr-show.c
105
106 Source file for mtrr-show (example program to show MTRRs using ioctl()'s)
107
108 Copyright (C) 1997-1998 Richard Gooch
109
110 This program is free software; you can redistribute it and/or modify
111 it under the terms of the GNU General Public License as published by
112 the Free Software Foundation; either version 2 of the License, or
113 (at your option) any later version.
114
115 This program is distributed in the hope that it will be useful,
116 but WITHOUT ANY WARRANTY; without even the implied warranty of
117 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
118 GNU General Public License for more details.
119
120 You should have received a copy of the GNU General Public License
121 along with this program; if not, write to the Free Software
122 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
123
124 Richard Gooch may be reached by email at rgooch@atnf.csiro.au
125 The postal address is:
126 Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.
127*/
128
129/*
130 This program will use an ioctl() on /proc/mtrr to show the current MTRR
131 settings. This is an alternative to reading /proc/mtrr.
132
133
134 Written by Richard Gooch 17-DEC-1997
135
136 Last updated by Richard Gooch 2-MAY-1998
137
138
139*/
140#include <stdio.h>
141#include <stdlib.h>
142#include <string.h>
143#include <sys/types.h>
144#include <sys/stat.h>
145#include <fcntl.h>
146#include <sys/ioctl.h>
147#include <errno.h>
148#include <asm/mtrr.h>
149
150#define TRUE 1
151#define FALSE 0
152#define ERRSTRING strerror (errno)
153
154static char *mtrr_strings[MTRR_NUM_TYPES] =
155{
156 "uncachable", /* 0 */
157 "write-combining", /* 1 */
158 "?", /* 2 */
159 "?", /* 3 */
160 "write-through", /* 4 */
161 "write-protect", /* 5 */
162 "write-back", /* 6 */
163};
164
165int main ()
166{
167 int fd;
168 struct mtrr_gentry gentry;
169
170 if ( ( fd = open ("/proc/mtrr", O_RDONLY, 0) ) == -1 )
171 {
172 if (errno == ENOENT)
173 {
174 fputs ("/proc/mtrr not found: not supported or you don't have a PPro?\n",
175 stderr);
176 exit (1);
177 }
178 fprintf (stderr, "Error opening /proc/mtrr\t%s\n", ERRSTRING);
179 exit (2);
180 }
181 for (gentry.regnum = 0; ioctl (fd, MTRRIOC_GET_ENTRY, &gentry) == 0;
182 ++gentry.regnum)
183 {
184 if (gentry.size < 1)
185 {
186 fprintf (stderr, "Register: %u disabled\n", gentry.regnum);
187 continue;
188 }
189 fprintf (stderr, "Register: %u base: 0x%lx size: 0x%lx type: %s\n",
190 gentry.regnum, gentry.base, gentry.size,
191 mtrr_strings[gentry.type]);
192 }
193 if (errno == EINVAL) exit (0);
194 fprintf (stderr, "Error doing ioctl(2) on /dev/mtrr\t%s\n", ERRSTRING);
195 exit (3);
196} /* End Function main */
197===============================================================================
198Creating MTRRs from a C programme using ioctl()'s:
199
200/* mtrr-add.c
201
202 Source file for mtrr-add (example programme to add an MTRRs using ioctl())
203
204 Copyright (C) 1997-1998 Richard Gooch
205
206 This program is free software; you can redistribute it and/or modify
207 it under the terms of the GNU General Public License as published by
208 the Free Software Foundation; either version 2 of the License, or
209 (at your option) any later version.
210
211 This program is distributed in the hope that it will be useful,
212 but WITHOUT ANY WARRANTY; without even the implied warranty of
213 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
214 GNU General Public License for more details.
215
216 You should have received a copy of the GNU General Public License
217 along with this program; if not, write to the Free Software
218 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
219
220 Richard Gooch may be reached by email at rgooch@atnf.csiro.au
221 The postal address is:
222 Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.
223*/
224
225/*
226 This programme will use an ioctl() on /proc/mtrr to add an entry. The first
227 available mtrr is used. This is an alternative to writing /proc/mtrr.
228
229
230 Written by Richard Gooch 17-DEC-1997
231
232 Last updated by Richard Gooch 2-MAY-1998
233
234
235*/
236#include <stdio.h>
237#include <string.h>
238#include <stdlib.h>
239#include <unistd.h>
240#include <sys/types.h>
241#include <sys/stat.h>
242#include <fcntl.h>
243#include <sys/ioctl.h>
244#include <errno.h>
245#include <asm/mtrr.h>
246
247#define TRUE 1
248#define FALSE 0
249#define ERRSTRING strerror (errno)
250
251static char *mtrr_strings[MTRR_NUM_TYPES] =
252{
253 "uncachable", /* 0 */
254 "write-combining", /* 1 */
255 "?", /* 2 */
256 "?", /* 3 */
257 "write-through", /* 4 */
258 "write-protect", /* 5 */
259 "write-back", /* 6 */
260};
261
262int main (int argc, char **argv)
263{
264 int fd;
265 struct mtrr_sentry sentry;
266
267 if (argc != 4)
268 {
269 fprintf (stderr, "Usage:\tmtrr-add base size type\n");
270 exit (1);
271 }
272 sentry.base = strtoul (argv[1], NULL, 0);
273 sentry.size = strtoul (argv[2], NULL, 0);
274 for (sentry.type = 0; sentry.type < MTRR_NUM_TYPES; ++sentry.type)
275 {
276 if (strcmp (argv[3], mtrr_strings[sentry.type]) == 0) break;
277 }
278 if (sentry.type >= MTRR_NUM_TYPES)
279 {
280 fprintf (stderr, "Illegal type: \"%s\"\n", argv[3]);
281 exit (2);
282 }
283 if ( ( fd = open ("/proc/mtrr", O_WRONLY, 0) ) == -1 )
284 {
285 if (errno == ENOENT)
286 {
287 fputs ("/proc/mtrr not found: not supported or you don't have a PPro?\n",
288 stderr);
289 exit (3);
290 }
291 fprintf (stderr, "Error opening /proc/mtrr\t%s\n", ERRSTRING);
292 exit (4);
293 }
294 if (ioctl (fd, MTRRIOC_ADD_ENTRY, &sentry) == -1)
295 {
296 fprintf (stderr, "Error doing ioctl(2) on /dev/mtrr\t%s\n", ERRSTRING);
297 exit (5);
298 }
299 fprintf (stderr, "Sleeping for 5 seconds so you can see the new entry\n");
300 sleep (5);
301 close (fd);
302 fputs ("I've just closed /proc/mtrr so now the new entry should be gone\n",
303 stderr);
304} /* End Function main */
305===============================================================================
diff --git a/Documentation/x86/pat.txt b/Documentation/x86/pat.txt
index 17965f927c15..c93ff5f4c0dd 100644
--- a/Documentation/x86/pat.txt
+++ b/Documentation/x86/pat.txt
@@ -14,6 +14,10 @@ PAT allows for different types of memory attributes. The most commonly used
14ones that will be supported at this time are Write-back, Uncached, 14ones that will be supported at this time are Write-back, Uncached,
15Write-combined and Uncached Minus. 15Write-combined and Uncached Minus.
16 16
17
18PAT APIs
19--------
20
17There are many different APIs in the kernel that allows setting of memory 21There are many different APIs in the kernel that allows setting of memory
18attributes at the page level. In order to avoid aliasing, these interfaces 22attributes at the page level. In order to avoid aliasing, these interfaces
19should be used thoughtfully. Below is a table of interfaces available, 23should be used thoughtfully. Below is a table of interfaces available,
@@ -26,38 +30,38 @@ address range to avoid any aliasing.
26API | RAM | ACPI,... | Reserved/Holes | 30API | RAM | ACPI,... | Reserved/Holes |
27-----------------------|----------|------------|------------------| 31-----------------------|----------|------------|------------------|
28 | | | | 32 | | | |
29ioremap | -- | UC | UC | 33ioremap | -- | UC- | UC- |
30 | | | | 34 | | | |
31ioremap_cache | -- | WB | WB | 35ioremap_cache | -- | WB | WB |
32 | | | | 36 | | | |
33ioremap_nocache | -- | UC | UC | 37ioremap_nocache | -- | UC- | UC- |
34 | | | | 38 | | | |
35ioremap_wc | -- | -- | WC | 39ioremap_wc | -- | -- | WC |
36 | | | | 40 | | | |
37set_memory_uc | UC | -- | -- | 41set_memory_uc | UC- | -- | -- |
38 set_memory_wb | | | | 42 set_memory_wb | | | |
39 | | | | 43 | | | |
40set_memory_wc | WC | -- | -- | 44set_memory_wc | WC | -- | -- |
41 set_memory_wb | | | | 45 set_memory_wb | | | |
42 | | | | 46 | | | |
43pci sysfs resource | -- | -- | UC | 47pci sysfs resource | -- | -- | UC- |
44 | | | | 48 | | | |
45pci sysfs resource_wc | -- | -- | WC | 49pci sysfs resource_wc | -- | -- | WC |
46 is IORESOURCE_PREFETCH| | | | 50 is IORESOURCE_PREFETCH| | | |
47 | | | | 51 | | | |
48pci proc | -- | -- | UC | 52pci proc | -- | -- | UC- |
49 !PCIIOC_WRITE_COMBINE | | | | 53 !PCIIOC_WRITE_COMBINE | | | |
50 | | | | 54 | | | |
51pci proc | -- | -- | WC | 55pci proc | -- | -- | WC |
52 PCIIOC_WRITE_COMBINE | | | | 56 PCIIOC_WRITE_COMBINE | | | |
53 | | | | 57 | | | |
54/dev/mem | -- | UC | UC | 58/dev/mem | -- | WB/WC/UC- | WB/WC/UC- |
55 read-write | | | | 59 read-write | | | |
56 | | | | 60 | | | |
57/dev/mem | -- | UC | UC | 61/dev/mem | -- | UC- | UC- |
58 mmap SYNC flag | | | | 62 mmap SYNC flag | | | |
59 | | | | 63 | | | |
60/dev/mem | -- | WB/WC/UC | WB/WC/UC | 64/dev/mem | -- | WB/WC/UC- | WB/WC/UC- |
61 mmap !SYNC flag | |(from exist-| (from exist- | 65 mmap !SYNC flag | |(from exist-| (from exist- |
62 and | | ing alias)| ing alias) | 66 and | | ing alias)| ing alias) |
63 any alias to this area| | | | 67 any alias to this area| | | |
@@ -68,7 +72,7 @@ pci proc | -- | -- | WC |
68 and | | | | 72 and | | | |
69 MTRR says WB | | | | 73 MTRR says WB | | | |
70 | | | | 74 | | | |
71/dev/mem | -- | -- | UC_MINUS | 75/dev/mem | -- | -- | UC- |
72 mmap !SYNC flag | | | | 76 mmap !SYNC flag | | | |
73 no alias to this area | | | | 77 no alias to this area | | | |
74 and | | | | 78 and | | | |
@@ -98,3 +102,35 @@ types.
98 102
99Drivers should use set_memory_[uc|wc] to set access type for RAM ranges. 103Drivers should use set_memory_[uc|wc] to set access type for RAM ranges.
100 104
105
106PAT debugging
107-------------
108
109With 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
113PAT memtype list:
114uncached-minus @ 0x7fadf000-0x7fae0000
115uncached-minus @ 0x7fb19000-0x7fb1a000
116uncached-minus @ 0x7fb1a000-0x7fb1b000
117uncached-minus @ 0x7fb1b000-0x7fb1c000
118uncached-minus @ 0x7fb1c000-0x7fb1d000
119uncached-minus @ 0x7fb1d000-0x7fb1e000
120uncached-minus @ 0x7fb1e000-0x7fb25000
121uncached-minus @ 0x7fb25000-0x7fb26000
122uncached-minus @ 0x7fb26000-0x7fb27000
123uncached-minus @ 0x7fb27000-0x7fb28000
124uncached-minus @ 0x7fb28000-0x7fb2e000
125uncached-minus @ 0x7fb2e000-0x7fb2f000
126uncached-minus @ 0x7fb2f000-0x7fb30000
127uncached-minus @ 0x7fb31000-0x7fb32000
128uncached-minus @ 0x80000000-0x90000000
129
130This list shows physical address ranges and various PAT settings used to
131access those physical address ranges.
132
133Another, more verbose way of getting PAT related debug messages is with
134"debugpat" boot parameter. With this parameter, various debug messages are
135printed to dmesg log.
136
diff --git a/Documentation/x86/i386/usb-legacy-support.txt b/Documentation/x86/usb-legacy-support.txt
index 1894cdfc69d9..1894cdfc69d9 100644
--- a/Documentation/x86/i386/usb-legacy-support.txt
+++ b/Documentation/x86/usb-legacy-support.txt
diff --git a/Documentation/x86/x86_64/boot-options.txt b/Documentation/x86/x86_64/boot-options.txt
index b0c7b6c4abda..72ffb5373ec7 100644
--- a/Documentation/x86/x86_64/boot-options.txt
+++ b/Documentation/x86/x86_64/boot-options.txt
@@ -54,10 +54,6 @@ APICs
54 apicmaintimer. Useful when your PIT timer is totally 54 apicmaintimer. Useful when your PIT timer is totally
55 broken. 55 broken.
56 56
57 disable_8254_timer / enable_8254_timer
58 Enable interrupt 0 timer routing over the 8254 in addition to over
59 the IO-APIC. The kernel tries to set a sensible default.
60
61Early Console 57Early Console
62 58
63 syntax: earlyprintk=vga 59 syntax: earlyprintk=vga
diff --git a/Documentation/x86/i386/zero-page.txt b/Documentation/x86/zero-page.txt
index 169ad423a3d1..169ad423a3d1 100644
--- a/Documentation/x86/i386/zero-page.txt
+++ b/Documentation/x86/zero-page.txt