aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-04-03 17:33:42 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-03 17:33:42 -0400
commit3bb5da3837cc1aa17736b05139c9a22c3794851a (patch)
treec92d5684a866542b1cb20641607ac1643ce03a47 /Documentation
parent7feb49c82a74bc7c091b8ab2a3f96baa33d08ece (diff)
parent9597362d354f8655ece324b01d0c640a0e99c077 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/SubmittingPatches2
-rw-r--r--Documentation/fb/cmap_xfbdev.txt53
-rw-r--r--Documentation/fb/metronomefb.txt38
-rw-r--r--Documentation/feature-removal-schedule.txt10
-rw-r--r--Documentation/hw_random.txt59
-rw-r--r--Documentation/i386/IO-APIC.txt2
-rw-r--r--Documentation/ide/ide.txt21
-rw-r--r--Documentation/input/notifier.txt52
-rw-r--r--Documentation/kernel-parameters.txt11
-rw-r--r--Documentation/lguest/lguest.c70
-rw-r--r--Documentation/lguest/lguest.txt19
-rw-r--r--Documentation/mca.txt17
-rw-r--r--Documentation/nmi_watchdog.txt3
-rw-r--r--Documentation/unaligned-memory-access.txt4
14 files changed, 252 insertions, 109 deletions
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 08a1ed1cb5d8..47a539c7642d 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -512,7 +512,7 @@ They provide type safety, have no length limitations, no formatting
512limitations, and under gcc they are as cheap as macros. 512limitations, and under gcc they are as cheap as macros.
513 513
514Macros should only be used for cases where a static inline is clearly 514Macros should only be used for cases where a static inline is clearly
515suboptimal [there a few, isolated cases of this in fast paths], 515suboptimal [there are a few, isolated cases of this in fast paths],
516or where it is impossible to use a static inline function [such as 516or where it is impossible to use a static inline function [such as
517string-izing]. 517string-izing].
518 518
diff --git a/Documentation/fb/cmap_xfbdev.txt b/Documentation/fb/cmap_xfbdev.txt
new file mode 100644
index 000000000000..55e1f0a3d2b4
--- /dev/null
+++ b/Documentation/fb/cmap_xfbdev.txt
@@ -0,0 +1,53 @@
1Understanding fbdev's cmap
2--------------------------
3
4These notes explain how X's dix layer uses fbdev's cmap structures.
5
6*. example of relevant structures in fbdev as used for a 3-bit grayscale cmap
7struct fb_var_screeninfo {
8 .bits_per_pixel = 8,
9 .grayscale = 1,
10 .red = { 4, 3, 0 },
11 .green = { 0, 0, 0 },
12 .blue = { 0, 0, 0 },
13}
14struct fb_fix_screeninfo {
15 .visual = FB_VISUAL_STATIC_PSEUDOCOLOR,
16}
17for (i = 0; i < 8; i++)
18 info->cmap.red[i] = (((2*i)+1)*(0xFFFF))/16;
19memcpy(info->cmap.green, info->cmap.red, sizeof(u16)*8);
20memcpy(info->cmap.blue, info->cmap.red, sizeof(u16)*8);
21
22*. X11 apps do something like the following when trying to use grayscale.
23for (i=0; i < 8; i++) {
24 char colorspec[64];
25 memset(colorspec,0,64);
26 sprintf(colorspec, "rgb:%x/%x/%x", i*36,i*36,i*36);
27 if (!XParseColor(outputDisplay, testColormap, colorspec, &wantedColor))
28 printf("Can't get color %s\n",colorspec);
29 XAllocColor(outputDisplay, testColormap, &wantedColor);
30 grays[i] = wantedColor;
31}
32There's also named equivalents like gray1..x provided you have an rgb.txt.
33
34Somewhere in X's callchain, this results in a call to X code that handles the
35colormap. For example, Xfbdev hits the following:
36
37xc-011010/programs/Xserver/dix/colormap.c:
38
39FindBestPixel(pentFirst, size, prgb, channel)
40
41dr = (long) pent->co.local.red - prgb->red;
42dg = (long) pent->co.local.green - prgb->green;
43db = (long) pent->co.local.blue - prgb->blue;
44sq = dr * dr;
45UnsignedToBigNum (sq, &sum);
46BigNumAdd (&sum, &temp, &sum);
47
48co.local.red are entries that were brought in through FBIOGETCMAP which come
49directly from the info->cmap.red that was listed above. The prgb is the rgb
50that the app wants to match to. The above code is doing what looks like a least
51squares matching function. That's why the cmap entries can't be set to the left
52hand side boundaries of a color range.
53
diff --git a/Documentation/fb/metronomefb.txt b/Documentation/fb/metronomefb.txt
new file mode 100644
index 000000000000..b9a2e7b7e838
--- /dev/null
+++ b/Documentation/fb/metronomefb.txt
@@ -0,0 +1,38 @@
1 Metronomefb
2 -----------
3Maintained by Jaya Kumar <jayakumar.lkml.gmail.com>
4Last revised: Nov 20, 2007
5
6Metronomefb is a driver for the Metronome display controller. The controller
7is from E-Ink Corporation. It is intended to be used to drive the E-Ink
8Vizplex display media. E-Ink hosts some details of this controller and the
9display media here http://www.e-ink.com/products/matrix/metronome.html .
10
11Metronome is interfaced to the host CPU through the AMLCD interface. The
12host CPU generates the control information and the image in a framebuffer
13which is then delivered to the AMLCD interface by a host specific method.
14Currently, that's implemented for the PXA's LCDC controller. The display and
15error status are each pulled through individual GPIOs.
16
17Metronomefb was written for the PXA255/gumstix/lyre combination and
18therefore currently has board set specific code in it. If other boards based on
19other architectures are available, then the host specific code can be separated
20and abstracted out.
21
22Metronomefb requires waveform information which is delivered via the AMLCD
23interface to the metronome controller. The waveform information is expected to
24be delivered from userspace via the firmware class interface. The waveform file
25can be compressed as long as your udev or hotplug script is aware of the need
26to uncompress it before delivering it. metronomefb will ask for waveform.wbf
27which would typically go into /lib/firmware/waveform.wbf depending on your
28udev/hotplug setup. I have only tested with a single waveform file which was
29originally labeled 23P01201_60_WT0107_MTC. I do not know what it stands for.
30Caution should be exercised when manipulating the waveform as there may be
31a possibility that it could have some permanent effects on the display media.
32I neither have access to nor know exactly what the waveform does in terms of
33the physical media.
34
35Metronomefb uses the deferred IO interface so that it can provide a memory
36mappable frame buffer. It has been tested with tinyx (Xfbdev). It is known
37to work at this time with xeyes, xclock, xloadimage, xpdf.
38
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 1d171fe5fcdc..ee3cc8b8c84e 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -172,16 +172,6 @@ Who: Len Brown <len.brown@intel.com>
172 172
173--------------------------- 173---------------------------
174 174
175What: ide-tape driver
176When: July 2008
177Files: drivers/ide/ide-tape.c
178Why: This driver might not have any users anymore and maintaining it for no
179 reason is an effort no one wants to make.
180Who: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>, Borislav Petkov
181 <petkovbb@googlemail.com>
182
183---------------------------
184
185What: libata spindown skipping and warning 175What: libata spindown skipping and warning
186When: Dec 2008 176When: Dec 2008
187Why: Some halt(8) implementations synchronize caches for and spin 177Why: Some halt(8) implementations synchronize caches for and spin
diff --git a/Documentation/hw_random.txt b/Documentation/hw_random.txt
index bb58c36b5845..690f52550c80 100644
--- a/Documentation/hw_random.txt
+++ b/Documentation/hw_random.txt
@@ -1,33 +1,26 @@
1 Hardware driver for Intel/AMD/VIA Random Number Generators (RNG)
2 Copyright 2000,2001 Jeff Garzik <jgarzik@pobox.com>
3 Copyright 2000,2001 Philipp Rumpf <prumpf@mandrakesoft.com>
4
5Introduction: 1Introduction:
6 2
7 The hw_random device driver is software that makes use of a 3 The hw_random framework is software that makes use of a
8 special hardware feature on your CPU or motherboard, 4 special hardware feature on your CPU or motherboard,
9 a Random Number Generator (RNG). 5 a Random Number Generator (RNG). The software has two parts:
6 a core providing the /dev/hw_random character device and its
7 sysfs support, plus a hardware-specific driver that plugs
8 into that core.
10 9
11 In order to make effective use of this device driver, you 10 To make the most effective use of these mechanisms, you
12 should download the support software as well. Download the 11 should download the support software as well. Download the
13 latest version of the "rng-tools" package from the 12 latest version of the "rng-tools" package from the
14 hw_random driver's official Web site: 13 hw_random driver's official Web site:
15 14
16 http://sourceforge.net/projects/gkernel/ 15 http://sourceforge.net/projects/gkernel/
17 16
18About the Intel RNG hardware, from the firmware hub datasheet: 17 Those tools use /dev/hw_random to fill the kernel entropy pool,
19 18 which is used internally and exported by the /dev/urandom and
20 The Firmware Hub integrates a Random Number Generator (RNG) 19 /dev/random special files.
21 using thermal noise generated from inherently random quantum
22 mechanical properties of silicon. When not generating new random
23 bits the RNG circuitry will enter a low power state. Intel will
24 provide a binary software driver to give third party software
25 access to our RNG for use as a security feature. At this time,
26 the RNG is only to be used with a system in an OS-present state.
27 20
28Theory of operation: 21Theory of operation:
29 22
30 Character driver. Using the standard open() 23 CHARACTER DEVICE. Using the standard open()
31 and read() system calls, you can read random data from 24 and read() system calls, you can read random data from
32 the hardware RNG device. This data is NOT CHECKED by any 25 the hardware RNG device. This data is NOT CHECKED by any
33 fitness tests, and could potentially be bogus (if the 26 fitness tests, and could potentially be bogus (if the
@@ -36,9 +29,37 @@ Theory of operation:
36 a security-conscious person would run fitness tests on the 29 a security-conscious person would run fitness tests on the
37 data before assuming it is truly random. 30 data before assuming it is truly random.
38 31
39 /dev/hwrandom is char device major 10, minor 183. 32 The rng-tools package uses such tests in "rngd", and lets you
33 run them by hand with a "rngtest" utility.
34
35 /dev/hw_random is char device major 10, minor 183.
36
37 CLASS DEVICE. There is a /sys/class/misc/hw_random node with
38 two unique attributes, "rng_available" and "rng_current". The
39 "rng_available" attribute lists the hardware-specific drivers
40 available, while "rng_current" lists the one which is currently
41 connected to /dev/hw_random. If your system has more than one
42 RNG available, you may change the one used by writing a name from
43 the list in "rng_available" into "rng_current".
44
45==========================================================================
46
47 Hardware driver for Intel/AMD/VIA Random Number Generators (RNG)
48 Copyright 2000,2001 Jeff Garzik <jgarzik@pobox.com>
49 Copyright 2000,2001 Philipp Rumpf <prumpf@mandrakesoft.com>
50
51
52About the Intel RNG hardware, from the firmware hub datasheet:
53
54 The Firmware Hub integrates a Random Number Generator (RNG)
55 using thermal noise generated from inherently random quantum
56 mechanical properties of silicon. When not generating new random
57 bits the RNG circuitry will enter a low power state. Intel will
58 provide a binary software driver to give third party software
59 access to our RNG for use as a security feature. At this time,
60 the RNG is only to be used with a system in an OS-present state.
40 61
41Driver notes: 62Intel RNG Driver notes:
42 63
43 * FIXME: support poll(2) 64 * FIXME: support poll(2)
44 65
diff --git a/Documentation/i386/IO-APIC.txt b/Documentation/i386/IO-APIC.txt
index f95166645d29..30b4c714fbe1 100644
--- a/Documentation/i386/IO-APIC.txt
+++ b/Documentation/i386/IO-APIC.txt
@@ -70,7 +70,7 @@ Every PCI card emits a PCI IRQ, which can be INTA, INTB, INTC or INTD:
70 70
71These INTA-D PCI IRQs are always 'local to the card', their real meaning 71These INTA-D PCI IRQs are always 'local to the card', their real meaning
72depends on which slot they are in. If you look at the daisy chaining diagram, 72depends on which slot they are in. If you look at the daisy chaining diagram,
73a card in slot4, issuing INTA IRQ, it will end up as a signal on PIRQ2 of 73a card in slot4, issuing INTA IRQ, it will end up as a signal on PIRQ4 of
74the PCI chipset. Most cards issue INTA, this creates optimal distribution 74the PCI chipset. Most cards issue INTA, this creates optimal distribution
75between the PIRQ lines. (distributing IRQ sources properly is not a 75between the PIRQ lines. (distributing IRQ sources properly is not a
76necessity, PCI IRQs can be shared at will, but it's a good for performance 76necessity, PCI IRQs can be shared at will, but it's a good for performance
diff --git a/Documentation/ide/ide.txt b/Documentation/ide/ide.txt
index e3b3425328b6..818676aad45a 100644
--- a/Documentation/ide/ide.txt
+++ b/Documentation/ide/ide.txt
@@ -105,7 +105,7 @@ Drives are normally found by auto-probing and/or examining the CMOS/BIOS data.
105For really weird situations, the apparent (fdisk) geometry can also be specified 105For really weird situations, the apparent (fdisk) geometry can also be specified
106on the kernel "command line" using LILO. The format of such lines is: 106on the kernel "command line" using LILO. The format of such lines is:
107 107
108 hdx=cyls,heads,sects,wpcom,irq 108 hdx=cyls,heads,sects
109or hdx=cdrom 109or hdx=cdrom
110 110
111where hdx can be any of hda through hdh, Three values are required 111where hdx can be any of hda through hdh, Three values are required
@@ -214,9 +214,9 @@ driver using the "options=" keyword to insmod, while replacing any ',' with
214Summary of ide driver parameters for kernel command line 214Summary of ide driver parameters for kernel command line
215-------------------------------------------------------- 215--------------------------------------------------------
216 216
217 "hdx=" is recognized for all "x" from "a" to "h", such as "hdc". 217 "hdx=" is recognized for all "x" from "a" to "u", such as "hdc".
218 218
219 "idex=" is recognized for all "x" from "0" to "3", such as "ide1". 219 "idex=" is recognized for all "x" from "0" to "9", such as "ide1".
220 220
221 "hdx=noprobe" : drive may be present, but do not probe for it 221 "hdx=noprobe" : drive may be present, but do not probe for it
222 222
@@ -228,13 +228,6 @@ Summary of ide driver parameters for kernel command line
228 228
229 "hdx=cyl,head,sect" : disk drive is present, with specified geometry 229 "hdx=cyl,head,sect" : disk drive is present, with specified geometry
230 230
231 "hdx=remap" : remap access of sector 0 to sector 1 (for EZDrive)
232
233 "hdx=remap63" : remap the drive: add 63 to all sector numbers
234 (for DM OnTrack)
235
236 "idex=noautotune" : driver will NOT attempt to tune interface speed
237
238 "hdx=autotune" : driver will attempt to tune interface speed 231 "hdx=autotune" : driver will attempt to tune interface speed
239 to the fastest PIO mode supported, 232 to the fastest PIO mode supported,
240 if possible for this drive only. 233 if possible for this drive only.
@@ -244,10 +237,6 @@ Summary of ide driver parameters for kernel command line
244 237
245 "hdx=nodma" : disallow DMA 238 "hdx=nodma" : disallow DMA
246 239
247 "hdx=scsi" : the return of the ide-scsi flag, this is useful for
248 allowing ide-floppy, ide-tape, and ide-cdrom|writers
249 to use ide-scsi emulation on a device specific option.
250
251 "idebus=xx" : inform IDE driver of VESA/PCI bus speed in MHz, 240 "idebus=xx" : inform IDE driver of VESA/PCI bus speed in MHz,
252 where "xx" is between 20 and 66 inclusive, 241 where "xx" is between 20 and 66 inclusive,
253 used when tuning chipset PIO modes. 242 used when tuning chipset PIO modes.
@@ -282,10 +271,6 @@ Summary of ide driver parameters for kernel command line
282 271
283 "ide=reverse" : formerly called to pci sub-system, but now local. 272 "ide=reverse" : formerly called to pci sub-system, but now local.
284 273
285The following are valid ONLY on ide0, which usually corresponds
286to the first ATA interface found on the particular host, and the defaults for
287the base,ctl ports must not be altered.
288
289 "ide=doubler" : probe/support IDE doublers on Amiga 274 "ide=doubler" : probe/support IDE doublers on Amiga
290 275
291There may be more options than shown -- use the source, Luke! 276There may be more options than shown -- use the source, Luke!
diff --git a/Documentation/input/notifier.txt b/Documentation/input/notifier.txt
new file mode 100644
index 000000000000..95172ca6f3d2
--- /dev/null
+++ b/Documentation/input/notifier.txt
@@ -0,0 +1,52 @@
1Keyboard notifier
2
3One can use register_keyboard_notifier to get called back on keyboard
4events (see kbd_keycode() function for details). The passed structure is
5keyboard_notifier_param:
6
7- 'vc' always provide the VC for which the keyboard event applies;
8- 'down' is 1 for a key press event, 0 for a key release;
9- 'shift' is the current modifier state, mask bit indexes are KG_*;
10- 'value' depends on the type of event.
11
12- KBD_KEYCODE events are always sent before other events, value is the keycode.
13- KBD_UNBOUND_KEYCODE events are sent if the keycode is not bound to a keysym.
14 value is the keycode.
15- KBD_UNICODE events are sent if the keycode -> keysym translation produced a
16 unicode character. value is the unicode value.
17- KBD_KEYSYM events are sent if the keycode -> keysym translation produced a
18 non-unicode character. value is the keysym.
19- KBD_POST_KEYSYM events are sent after the treatment of non-unicode keysyms.
20 That permits one to inspect the resulting LEDs for instance.
21
22For each kind of event but the last, the callback may return NOTIFY_STOP in
23order to "eat" the event: the notify loop is stopped and the keyboard event is
24dropped.
25
26In a rough C snippet, we have:
27
28kbd_keycode(keycode) {
29 ...
30 params.value = keycode;
31 if (notifier_call_chain(KBD_KEYCODE,&params) == NOTIFY_STOP)
32 || !bound) {
33 notifier_call_chain(KBD_UNBOUND_KEYCODE,&params);
34 return;
35 }
36
37 if (unicode) {
38 param.value = unicode;
39 if (notifier_call_chain(KBD_UNICODE,&params) == NOTIFY_STOP)
40 return;
41 emit unicode;
42 return;
43 }
44
45 params.value = keysym;
46 if (notifier_call_chain(KBD_KEYSYM,&params) == NOTIFY_STOP)
47 return;
48 apply keysym;
49 notifier_call_chain(KBD_POST_KEYSYM,&params);
50}
51
52NOTE: This notifier is usually called from interrupt context.
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 622f7849edb9..4cd1a5da80a4 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -170,11 +170,6 @@ and is between 256 and 4096 characters. It is defined in the file
170 acpi_irq_isa= [HW,ACPI] If irq_balance, mark listed IRQs used by ISA 170 acpi_irq_isa= [HW,ACPI] If irq_balance, mark listed IRQs used by ISA
171 Format: <irq>,<irq>... 171 Format: <irq>,<irq>...
172 172
173 acpi_new_pts_ordering [HW,ACPI]
174 Enforce the ACPI 2.0 ordering of the _PTS control
175 method wrt putting devices into low power states
176 default: pre ACPI 2.0 ordering of _PTS
177
178 acpi_no_auto_ssdt [HW,ACPI] Disable automatic loading of SSDT 173 acpi_no_auto_ssdt [HW,ACPI] Disable automatic loading of SSDT
179 174
180 acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS 175 acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS
@@ -732,6 +727,8 @@ and is between 256 and 4096 characters. It is defined in the file
732 (Don't attempt to blink the leds) 727 (Don't attempt to blink the leds)
733 i8042.noaux [HW] Don't check for auxiliary (== mouse) port 728 i8042.noaux [HW] Don't check for auxiliary (== mouse) port
734 i8042.nokbd [HW] Don't check/create keyboard port 729 i8042.nokbd [HW] Don't check/create keyboard port
730 i8042.noloop [HW] Disable the AUX Loopback command while probing
731 for the AUX port
735 i8042.nomux [HW] Don't check presence of an active multiplexing 732 i8042.nomux [HW] Don't check presence of an active multiplexing
736 controller 733 controller
737 i8042.nopnp [HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX 734 i8042.nopnp [HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX
@@ -1128,6 +1125,10 @@ and is between 256 and 4096 characters. It is defined in the file
1128 memmap=nn[KMG]$ss[KMG] 1125 memmap=nn[KMG]$ss[KMG]
1129 [KNL,ACPI] Mark specific memory as reserved. 1126 [KNL,ACPI] Mark specific memory as reserved.
1130 Region of memory to be used, from ss to ss+nn. 1127 Region of memory to be used, from ss to ss+nn.
1128 Example: Exclude memory from 0x18690000-0x1869ffff
1129 memmap=64K$0x18690000
1130 or
1131 memmap=0x10000$0x18690000
1131 1132
1132 meye.*= [HW] Set MotionEye Camera parameters 1133 meye.*= [HW] Set MotionEye Camera parameters
1133 See Documentation/video4linux/meye.txt. 1134 See Documentation/video4linux/meye.txt.
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c
index bec5a32e4095..4c1fc65a8b3d 100644
--- a/Documentation/lguest/lguest.c
+++ b/Documentation/lguest/lguest.c
@@ -1,7 +1,7 @@
1/*P:100 This is the Launcher code, a simple program which lays out the 1/*P:100 This is the Launcher code, a simple program which lays out the
2 * "physical" memory for the new Guest by mapping the kernel image and the 2 * "physical" memory for the new Guest by mapping the kernel image and
3 * virtual devices, then reads repeatedly from /dev/lguest to run the Guest. 3 * the virtual devices, then opens /dev/lguest to tell the kernel
4:*/ 4 * about the Guest and control it. :*/
5#define _LARGEFILE64_SOURCE 5#define _LARGEFILE64_SOURCE
6#define _GNU_SOURCE 6#define _GNU_SOURCE
7#include <stdio.h> 7#include <stdio.h>
@@ -43,7 +43,7 @@
43#include "linux/virtio_console.h" 43#include "linux/virtio_console.h"
44#include "linux/virtio_ring.h" 44#include "linux/virtio_ring.h"
45#include "asm-x86/bootparam.h" 45#include "asm-x86/bootparam.h"
46/*L:110 We can ignore the 38 include files we need for this program, but I do 46/*L:110 We can ignore the 39 include files we need for this program, but I do
47 * want to draw attention to the use of kernel-style types. 47 * want to draw attention to the use of kernel-style types.
48 * 48 *
49 * As Linus said, "C is a Spartan language, and so should your naming be." I 49 * As Linus said, "C is a Spartan language, and so should your naming be." I
@@ -320,7 +320,7 @@ static unsigned long map_elf(int elf_fd, const Elf32_Ehdr *ehdr)
320 err(1, "Reading program headers"); 320 err(1, "Reading program headers");
321 321
322 /* Try all the headers: there are usually only three. A read-only one, 322 /* Try all the headers: there are usually only three. A read-only one,
323 * a read-write one, and a "note" section which isn't loadable. */ 323 * a read-write one, and a "note" section which we don't load. */
324 for (i = 0; i < ehdr->e_phnum; i++) { 324 for (i = 0; i < ehdr->e_phnum; i++) {
325 /* If this isn't a loadable segment, we ignore it */ 325 /* If this isn't a loadable segment, we ignore it */
326 if (phdr[i].p_type != PT_LOAD) 326 if (phdr[i].p_type != PT_LOAD)
@@ -387,7 +387,7 @@ static unsigned long load_kernel(int fd)
387 if (memcmp(hdr.e_ident, ELFMAG, SELFMAG) == 0) 387 if (memcmp(hdr.e_ident, ELFMAG, SELFMAG) == 0)
388 return map_elf(fd, &hdr); 388 return map_elf(fd, &hdr);
389 389
390 /* Otherwise we assume it's a bzImage, and try to unpack it */ 390 /* Otherwise we assume it's a bzImage, and try to load it. */
391 return load_bzimage(fd); 391 return load_bzimage(fd);
392} 392}
393 393
@@ -433,12 +433,12 @@ static unsigned long load_initrd(const char *name, unsigned long mem)
433 return len; 433 return len;
434} 434}
435 435
436/* Once we know how much memory we have, we can construct simple linear page 436/* Once we know how much memory we have we can construct simple linear page
437 * tables which set virtual == physical which will get the Guest far enough 437 * tables which set virtual == physical which will get the Guest far enough
438 * into the boot to create its own. 438 * into the boot to create its own.
439 * 439 *
440 * We lay them out of the way, just below the initrd (which is why we need to 440 * We lay them out of the way, just below the initrd (which is why we need to
441 * know its size). */ 441 * know its size here). */
442static unsigned long setup_pagetables(unsigned long mem, 442static unsigned long setup_pagetables(unsigned long mem,
443 unsigned long initrd_size) 443 unsigned long initrd_size)
444{ 444{
@@ -850,7 +850,8 @@ static void handle_console_output(int fd, struct virtqueue *vq)
850 * 850 *
851 * Handling output for network is also simple: we get all the output buffers 851 * Handling output for network is also simple: we get all the output buffers
852 * and write them (ignoring the first element) to this device's file descriptor 852 * and write them (ignoring the first element) to this device's file descriptor
853 * (stdout). */ 853 * (/dev/net/tun).
854 */
854static void handle_net_output(int fd, struct virtqueue *vq) 855static void handle_net_output(int fd, struct virtqueue *vq)
855{ 856{
856 unsigned int head, out, in; 857 unsigned int head, out, in;
@@ -924,7 +925,7 @@ static void enable_fd(int fd, struct virtqueue *vq)
924 write(waker_fd, &vq->dev->fd, sizeof(vq->dev->fd)); 925 write(waker_fd, &vq->dev->fd, sizeof(vq->dev->fd));
925} 926}
926 927
927/* Resetting a device is fairly easy. */ 928/* When the Guest asks us to reset a device, it's is fairly easy. */
928static void reset_device(struct device *dev) 929static void reset_device(struct device *dev)
929{ 930{
930 struct virtqueue *vq; 931 struct virtqueue *vq;
@@ -1003,8 +1004,8 @@ static void handle_input(int fd)
1003 if (select(devices.max_infd+1, &fds, NULL, NULL, &poll) == 0) 1004 if (select(devices.max_infd+1, &fds, NULL, NULL, &poll) == 0)
1004 break; 1005 break;
1005 1006
1006 /* Otherwise, call the device(s) which have readable 1007 /* Otherwise, call the device(s) which have readable file
1007 * file descriptors and a method of handling them. */ 1008 * descriptors and a method of handling them. */
1008 for (i = devices.dev; i; i = i->next) { 1009 for (i = devices.dev; i; i = i->next) {
1009 if (i->handle_input && FD_ISSET(i->fd, &fds)) { 1010 if (i->handle_input && FD_ISSET(i->fd, &fds)) {
1010 int dev_fd; 1011 int dev_fd;
@@ -1015,8 +1016,7 @@ static void handle_input(int fd)
1015 * should no longer service it. Networking and 1016 * should no longer service it. Networking and
1016 * console do this when there's no input 1017 * console do this when there's no input
1017 * buffers to deliver into. Console also uses 1018 * buffers to deliver into. Console also uses
1018 * it when it discovers that stdin is 1019 * it when it discovers that stdin is closed. */
1019 * closed. */
1020 FD_CLR(i->fd, &devices.infds); 1020 FD_CLR(i->fd, &devices.infds);
1021 /* Tell waker to ignore it too, by sending a 1021 /* Tell waker to ignore it too, by sending a
1022 * negative fd number (-1, since 0 is a valid 1022 * negative fd number (-1, since 0 is a valid
@@ -1033,7 +1033,8 @@ static void handle_input(int fd)
1033 * 1033 *
1034 * All devices need a descriptor so the Guest knows it exists, and a "struct 1034 * All devices need a descriptor so the Guest knows it exists, and a "struct
1035 * device" so the Launcher can keep track of it. We have common helper 1035 * device" so the Launcher can keep track of it. We have common helper
1036 * routines to allocate and manage them. */ 1036 * routines to allocate and manage them.
1037 */
1037 1038
1038/* The layout of the device page is a "struct lguest_device_desc" followed by a 1039/* The layout of the device page is a "struct lguest_device_desc" followed by a
1039 * number of virtqueue descriptors, then two sets of feature bits, then an 1040 * number of virtqueue descriptors, then two sets of feature bits, then an
@@ -1078,7 +1079,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
1078 struct virtqueue **i, *vq = malloc(sizeof(*vq)); 1079 struct virtqueue **i, *vq = malloc(sizeof(*vq));
1079 void *p; 1080 void *p;
1080 1081
1081 /* First we need some pages for this virtqueue. */ 1082 /* First we need some memory for this virtqueue. */
1082 pages = (vring_size(num_descs, getpagesize()) + getpagesize() - 1) 1083 pages = (vring_size(num_descs, getpagesize()) + getpagesize() - 1)
1083 / getpagesize(); 1084 / getpagesize();
1084 p = get_pages(pages); 1085 p = get_pages(pages);
@@ -1122,7 +1123,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
1122} 1123}
1123 1124
1124/* The first half of the feature bitmask is for us to advertise features. The 1125/* The first half of the feature bitmask is for us to advertise features. The
1125 * second half if for the Guest to accept features. */ 1126 * second half is for the Guest to accept features. */
1126static void add_feature(struct device *dev, unsigned bit) 1127static void add_feature(struct device *dev, unsigned bit)
1127{ 1128{
1128 u8 *features = get_feature_bits(dev); 1129 u8 *features = get_feature_bits(dev);
@@ -1151,7 +1152,9 @@ static void set_config(struct device *dev, unsigned len, const void *conf)
1151} 1152}
1152 1153
1153/* This routine does all the creation and setup of a new device, including 1154/* This routine does all the creation and setup of a new device, including
1154 * calling new_dev_desc() to allocate the descriptor and device memory. */ 1155 * calling new_dev_desc() to allocate the descriptor and device memory.
1156 *
1157 * See what I mean about userspace being boring? */
1155static struct device *new_device(const char *name, u16 type, int fd, 1158static struct device *new_device(const char *name, u16 type, int fd,
1156 bool (*handle_input)(int, struct device *)) 1159 bool (*handle_input)(int, struct device *))
1157{ 1160{
@@ -1383,7 +1386,6 @@ struct vblk_info
1383 * Launcher triggers interrupt to Guest. */ 1386 * Launcher triggers interrupt to Guest. */
1384 int done_fd; 1387 int done_fd;
1385}; 1388};
1386/*:*/
1387 1389
1388/*L:210 1390/*L:210
1389 * The Disk 1391 * The Disk
@@ -1493,7 +1495,10 @@ static int io_thread(void *_dev)
1493 while (read(vblk->workpipe[0], &c, 1) == 1) { 1495 while (read(vblk->workpipe[0], &c, 1) == 1) {
1494 /* We acknowledge each request immediately to reduce latency, 1496 /* We acknowledge each request immediately to reduce latency,
1495 * rather than waiting until we've done them all. I haven't 1497 * rather than waiting until we've done them all. I haven't
1496 * measured to see if it makes any difference. */ 1498 * measured to see if it makes any difference.
1499 *
1500 * That would be an interesting test, wouldn't it? You could
1501 * also try having more than one I/O thread. */
1497 while (service_io(dev)) 1502 while (service_io(dev))
1498 write(vblk->done_fd, &c, 1); 1503 write(vblk->done_fd, &c, 1);
1499 } 1504 }
@@ -1501,7 +1506,7 @@ static int io_thread(void *_dev)
1501} 1506}
1502 1507
1503/* Now we've seen the I/O thread, we return to the Launcher to see what happens 1508/* Now we've seen the I/O thread, we return to the Launcher to see what happens
1504 * when the thread tells us it's completed some I/O. */ 1509 * when that thread tells us it's completed some I/O. */
1505static bool handle_io_finish(int fd, struct device *dev) 1510static bool handle_io_finish(int fd, struct device *dev)
1506{ 1511{
1507 char c; 1512 char c;
@@ -1573,11 +1578,12 @@ static void setup_block_file(const char *filename)
1573 * more work. */ 1578 * more work. */
1574 pipe(vblk->workpipe); 1579 pipe(vblk->workpipe);
1575 1580
1576 /* Create stack for thread and run it */ 1581 /* Create stack for thread and run it. Since stack grows upwards, we
1582 * point the stack pointer to the end of this region. */
1577 stack = malloc(32768); 1583 stack = malloc(32768);
1578 /* SIGCHLD - We dont "wait" for our cloned thread, so prevent it from 1584 /* SIGCHLD - We dont "wait" for our cloned thread, so prevent it from
1579 * becoming a zombie. */ 1585 * becoming a zombie. */
1580 if (clone(io_thread, stack + 32768, CLONE_VM | SIGCHLD, dev) == -1) 1586 if (clone(io_thread, stack + 32768, CLONE_VM | SIGCHLD, dev) == -1)
1581 err(1, "Creating clone"); 1587 err(1, "Creating clone");
1582 1588
1583 /* We don't need to keep the I/O thread's end of the pipes open. */ 1589 /* We don't need to keep the I/O thread's end of the pipes open. */
@@ -1587,14 +1593,14 @@ static void setup_block_file(const char *filename)
1587 verbose("device %u: virtblock %llu sectors\n", 1593 verbose("device %u: virtblock %llu sectors\n",
1588 devices.device_num, le64_to_cpu(conf.capacity)); 1594 devices.device_num, le64_to_cpu(conf.capacity));
1589} 1595}
1590/* That's the end of device setup. :*/ 1596/* That's the end of device setup. */
1591 1597
1592/* Reboot */ 1598/*L:230 Reboot is pretty easy: clean up and exec() the Launcher afresh. */
1593static void __attribute__((noreturn)) restart_guest(void) 1599static void __attribute__((noreturn)) restart_guest(void)
1594{ 1600{
1595 unsigned int i; 1601 unsigned int i;
1596 1602
1597 /* Closing pipes causes the waker thread and io_threads to die, and 1603 /* Closing pipes causes the Waker thread and io_threads to die, and
1598 * closing /dev/lguest cleans up the Guest. Since we don't track all 1604 * closing /dev/lguest cleans up the Guest. Since we don't track all
1599 * open fds, we simply close everything beyond stderr. */ 1605 * open fds, we simply close everything beyond stderr. */
1600 for (i = 3; i < FD_SETSIZE; i++) 1606 for (i = 3; i < FD_SETSIZE; i++)
@@ -1603,7 +1609,7 @@ static void __attribute__((noreturn)) restart_guest(void)
1603 err(1, "Could not exec %s", main_args[0]); 1609 err(1, "Could not exec %s", main_args[0]);
1604} 1610}
1605 1611
1606/*L:220 Finally we reach the core of the Launcher, which runs the Guest, serves 1612/*L:220 Finally we reach the core of the Launcher which runs the Guest, serves
1607 * its input and output, and finally, lays it to rest. */ 1613 * its input and output, and finally, lays it to rest. */
1608static void __attribute__((noreturn)) run_guest(int lguest_fd) 1614static void __attribute__((noreturn)) run_guest(int lguest_fd)
1609{ 1615{
@@ -1644,7 +1650,7 @@ static void __attribute__((noreturn)) run_guest(int lguest_fd)
1644 err(1, "Resetting break"); 1650 err(1, "Resetting break");
1645 } 1651 }
1646} 1652}
1647/* 1653/*L:240
1648 * This is the end of the Launcher. The good news: we are over halfway 1654 * This is the end of the Launcher. The good news: we are over halfway
1649 * through! The bad news: the most fiendish part of the code still lies ahead 1655 * through! The bad news: the most fiendish part of the code still lies ahead
1650 * of us. 1656 * of us.
@@ -1691,8 +1697,8 @@ int main(int argc, char *argv[])
1691 * device receive input from a file descriptor, we keep an fdset 1697 * device receive input from a file descriptor, we keep an fdset
1692 * (infds) and the maximum fd number (max_infd) with the head of the 1698 * (infds) and the maximum fd number (max_infd) with the head of the
1693 * list. We also keep a pointer to the last device. Finally, we keep 1699 * list. We also keep a pointer to the last device. Finally, we keep
1694 * the next interrupt number to hand out (1: remember that 0 is used by 1700 * the next interrupt number to use for devices (1: remember that 0 is
1695 * the timer). */ 1701 * used by the timer). */
1696 FD_ZERO(&devices.infds); 1702 FD_ZERO(&devices.infds);
1697 devices.max_infd = -1; 1703 devices.max_infd = -1;
1698 devices.lastdev = NULL; 1704 devices.lastdev = NULL;
@@ -1793,8 +1799,8 @@ int main(int argc, char *argv[])
1793 lguest_fd = tell_kernel(pgdir, start); 1799 lguest_fd = tell_kernel(pgdir, start);
1794 1800
1795 /* We fork off a child process, which wakes the Launcher whenever one 1801 /* We fork off a child process, which wakes the Launcher whenever one
1796 * of the input file descriptors needs attention. Otherwise we would 1802 * of the input file descriptors needs attention. We call this the
1797 * run the Guest until it tries to output something. */ 1803 * Waker, and we'll cover it in a moment. */
1798 waker_fd = setup_waker(lguest_fd); 1804 waker_fd = setup_waker(lguest_fd);
1799 1805
1800 /* Finally, run the Guest. This doesn't return. */ 1806 /* Finally, run the Guest. This doesn't return. */
diff --git a/Documentation/lguest/lguest.txt b/Documentation/lguest/lguest.txt
index 722d4e7fbebe..29510dc51510 100644
--- a/Documentation/lguest/lguest.txt
+++ b/Documentation/lguest/lguest.txt
@@ -1,6 +1,7 @@
1Rusty's Remarkably Unreliable Guide to Lguest 1 __
2 - or, A Young Coder's Illustrated Hypervisor 2 (___()'`; Rusty's Remarkably Unreliable Guide to Lguest
3http://lguest.ozlabs.org 3 /, /` - or, A Young Coder's Illustrated Hypervisor
4 \\"--\\ http://lguest.ozlabs.org
4 5
5Lguest is designed to be a minimal hypervisor for the Linux kernel, for 6Lguest is designed to be a minimal hypervisor for the Linux kernel, for
6Linux developers and users to experiment with virtualization with the 7Linux developers and users to experiment with virtualization with the
@@ -41,12 +42,16 @@ Running Lguest:
41 CONFIG_PHYSICAL_ALIGN=0x100000) 42 CONFIG_PHYSICAL_ALIGN=0x100000)
42 43
43 "Device Drivers": 44 "Device Drivers":
45 "Block devices"
46 "Virtio block driver (EXPERIMENTAL)" = M/Y
44 "Network device support" 47 "Network device support"
45 "Universal TUN/TAP device driver support" = M/Y 48 "Universal TUN/TAP device driver support" = M/Y
46 (CONFIG_TUN=m) 49 "Virtio network driver (EXPERIMENTAL)" = M/Y
47 "Virtualization" 50 (CONFIG_VIRTIO_BLK=m, CONFIG_VIRTIO_NET=m and CONFIG_TUN=m)
48 "Linux hypervisor example code" = M/Y 51
49 (CONFIG_LGUEST=m) 52 "Virtualization"
53 "Linux hypervisor example code" = M/Y
54 (CONFIG_LGUEST=m)
50 55
51- A tool called "lguest" is available in this directory: type "make" 56- A tool called "lguest" is available in this directory: type "make"
52 to build it. If you didn't build your kernel in-tree, use "make 57 to build it. If you didn't build your kernel in-tree, use "make
diff --git a/Documentation/mca.txt b/Documentation/mca.txt
index aabce4ad90f9..510375d4209a 100644
--- a/Documentation/mca.txt
+++ b/Documentation/mca.txt
@@ -143,14 +143,7 @@ MCA Device Drivers
143 143
144Currently, there are a number of MCA-specific device drivers. 144Currently, there are a number of MCA-specific device drivers.
145 145
1461) PS/2 ESDI 1461) PS/2 SCSI
147 drivers/block/ps2esdi.c
148 include/linux/ps2esdi.h
149 Uses major number 36, and should use /dev files /dev/eda, /dev/edb.
150 Supports two drives, but only one controller. May use the
151 command-line args "ed=cyl,head,sec" and "tp720".
152
1532) PS/2 SCSI
154 drivers/scsi/ibmmca.c 147 drivers/scsi/ibmmca.c
155 drivers/scsi/ibmmca.h 148 drivers/scsi/ibmmca.h
156 The driver for the IBM SCSI subsystem. Includes both integrated 149 The driver for the IBM SCSI subsystem. Includes both integrated
@@ -159,25 +152,25 @@ Currently, there are a number of MCA-specific device drivers.
159 machine with a front-panel display (i.e. model 95), you can use 152 machine with a front-panel display (i.e. model 95), you can use
160 "ibmmcascsi=display" to enable a drive activity indicator. 153 "ibmmcascsi=display" to enable a drive activity indicator.
161 154
1623) 3c523 1552) 3c523
163 drivers/net/3c523.c 156 drivers/net/3c523.c
164 drivers/net/3c523.h 157 drivers/net/3c523.h
165 3Com 3c523 Etherlink/MC ethernet driver. 158 3Com 3c523 Etherlink/MC ethernet driver.
166 159
1674) SMC Ultra/MCA and IBM Adapter/A 1603) SMC Ultra/MCA and IBM Adapter/A
168 drivers/net/smc-mca.c 161 drivers/net/smc-mca.c
169 drivers/net/smc-mca.h 162 drivers/net/smc-mca.h
170 Driver for the MCA version of the SMC Ultra and various other 163 Driver for the MCA version of the SMC Ultra and various other
171 OEM'ed and work-alike cards (Elite, Adapter/A, etc). 164 OEM'ed and work-alike cards (Elite, Adapter/A, etc).
172 165
1735) NE/2 1664) NE/2
174 driver/net/ne2.c 167 driver/net/ne2.c
175 driver/net/ne2.h 168 driver/net/ne2.h
176 The NE/2 is the MCA version of the NE2000. This may not work 169 The NE/2 is the MCA version of the NE2000. This may not work
177 with clones that have a different adapter id than the original 170 with clones that have a different adapter id than the original
178 NE/2. 171 NE/2.
179 172
1806) Future Domain MCS-600/700, OEM'd IBM Fast SCSI Adapter/A and 1735) Future Domain MCS-600/700, OEM'd IBM Fast SCSI Adapter/A and
181 Reply Sound Blaster/SCSI (SCSI part) 174 Reply Sound Blaster/SCSI (SCSI part)
182 Better support for these cards than the driver for ISA. 175 Better support for these cards than the driver for ISA.
183 Supports multiple cards with IRQ sharing. 176 Supports multiple cards with IRQ sharing.
diff --git a/Documentation/nmi_watchdog.txt b/Documentation/nmi_watchdog.txt
index c025a4561c10..757c729ee42e 100644
--- a/Documentation/nmi_watchdog.txt
+++ b/Documentation/nmi_watchdog.txt
@@ -23,8 +23,7 @@ kernel debugging options, such as Kernel Stack Meter or Kernel Tracer,
23may implicitly disable the NMI watchdog.] 23may implicitly disable the NMI watchdog.]
24 24
25For x86-64, the needed APIC is always compiled in, and the NMI watchdog is 25For x86-64, the needed APIC is always compiled in, and the NMI watchdog is
26always enabled with I/O-APIC mode (nmi_watchdog=1). Currently, local APIC 26always enabled with I/O-APIC mode (nmi_watchdog=1).
27mode (nmi_watchdog=2) does not work on x86-64.
28 27
29Using local APIC (nmi_watchdog=2) needs the first performance register, so 28Using local APIC (nmi_watchdog=2) needs the first performance register, so
30you can't use it for other purposes (such as high precision performance 29you can't use it for other purposes (such as high precision performance
diff --git a/Documentation/unaligned-memory-access.txt b/Documentation/unaligned-memory-access.txt
index 6223eace3c09..b0472ac5226a 100644
--- a/Documentation/unaligned-memory-access.txt
+++ b/Documentation/unaligned-memory-access.txt
@@ -57,7 +57,7 @@ here; a summary of the common scenarios is presented below:
57 unaligned access to be corrected. 57 unaligned access to be corrected.
58 - Some architectures are not capable of unaligned memory access, but will 58 - Some architectures are not capable of unaligned memory access, but will
59 silently perform a different memory access to the one that was requested, 59 silently perform a different memory access to the one that was requested,
60 resulting a a subtle code bug that is hard to detect! 60 resulting in a subtle code bug that is hard to detect!
61 61
62It should be obvious from the above that if your code causes unaligned 62It should be obvious from the above that if your code causes unaligned
63memory accesses to happen, your code will not work correctly on certain 63memory accesses to happen, your code will not work correctly on certain
@@ -209,7 +209,7 @@ memory and you wish to avoid unaligned access, its usage is as follows:
209 209
210 u32 value = get_unaligned((u32 *) data); 210 u32 value = get_unaligned((u32 *) data);
211 211
212These macros work work for memory accesses of any length (not just 32 bits as 212These macros work for memory accesses of any length (not just 32 bits as
213in the examples above). Be aware that when compared to standard access of 213in the examples above). Be aware that when compared to standard access of
214aligned memory, using these macros to access unaligned memory can be costly in 214aligned memory, using these macros to access unaligned memory can be costly in
215terms of performance. 215terms of performance.