Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74756
b: refs/heads/master
c: 41f81e8
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Dec 10, 2007
1 parent 9878875 commit ed0dc4a
Show file tree
Hide file tree
Showing 3,728 changed files with 91,773 additions and 61,176 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cf10e82bdc0d38d09dfaf46d0daf56136138ef3f
refs/heads/master: 41f81e88e01eb959f439f8537c58078e4bfc5291
1 change: 1 addition & 0 deletions trunk/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*.s
*.ko
*.so
*.so.dbg
*.mod.c
*.i
*.lst
Expand Down
12 changes: 6 additions & 6 deletions trunk/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ S: 2037 Walnut #6
S: Boulder, Colorado 80302
S: USA

N: Heiko Eissfeldt
N: Heiko Eißfeldt
E: heiko@colossus.escape.de heiko@unifix.de
D: verify_area stuff, generic SCSI fixes
D: SCSI Programming HOWTO
Expand Down Expand Up @@ -1988,8 +1988,8 @@ N: Volker Lendecke
E: vl@kki.org
D: Kernel smbfs (to mount WfW, NT and OS/2 network drives.)
D: NCP filesystem support (to mount NetWare volumes)
S: Von Ossietzky Str. 12
S: 37085 Goettingen
S: Von-Ossietzky-Str. 12
S: 37085 Göttingen
S: Germany

N: Kevin Lentin
Expand Down Expand Up @@ -2431,11 +2431,11 @@ S: 12725 SW Millikan Way, Suite 400
S: Beaverton, Oregon 97005
S: USA

N: Eberhard Moenkeberg
N: Eberhard Mönkeberg
E: emoenke@gwdg.de
D: CDROM driver "sbpcd" (Matsushita/Panasonic/Soundblaster)
S: Ruhstrathoehe 2 b.
S: D-37085 Goettingen
S: Ruhstrathöhe 2 b.
S: D-37085 Göttingen
S: Germany

N: Thomas Molina
Expand Down
2 changes: 2 additions & 0 deletions trunk/Documentation/00-INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ mtrr.txt
- how to use PPro Memory Type Range Registers to increase performance.
mutex-design.txt
- info on the generic mutex subsystem.
namespaces/
- directory with various information about namespaces
nbd.txt
- info on a TCP implementation of a network block device.
netlabel/
Expand Down
4 changes: 2 additions & 2 deletions trunk/Documentation/DocBook/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \
procfs-guide.xml writing_usb_driver.xml \
kernel-api.xml filesystems.xml lsm.xml usb.xml \
gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
genericirq.xml s390-drivers.xml
genericirq.xml s390-drivers.xml uio-howto.xml

###
# The build process is as follows (targets):
Expand Down Expand Up @@ -165,7 +165,7 @@ quiet_cmd_db2man = MAN $@
@touch $@

###
# Rules to generate postscripts and PNG imgages from .fig format files
# Rules to generate postscripts and PNG images from .fig format files
quiet_cmd_fig2eps = FIG2EPS $@
cmd_fig2eps = fig2dev -Leps $< $@

Expand Down
2 changes: 1 addition & 1 deletion trunk/Documentation/DocBook/kernel-api.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

<sect1><title>Atomic and pointer manipulation</title>
!Iinclude/asm-x86/atomic_32.h
!Iinclude/asm-x86/unaligned_32.h
!Iinclude/asm-x86/unaligned.h
</sect1>

<sect1><title>Delaying, scheduling, and timer routines</title>
Expand Down
6 changes: 3 additions & 3 deletions trunk/Documentation/DocBook/mtdnand.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ int __init board_init (void)
goto out;
}

/* map physical adress */
/* map physical address */
baseaddr = (unsigned long)ioremap(CHIP_PHYSICAL_ADDRESS, 1024);
if(!baseaddr){
printk("Ioremap to access NAND chip failed\n");
Expand All @@ -306,7 +306,7 @@ int __init board_init (void)
this->dev_ready = board_dev_ready;
this->eccmode = NAND_ECC_SOFT;

/* Scan to find existance of the device */
/* Scan to find existence of the device */
if (nand_scan (board_mtd, 1)) {
err = -ENXIO;
goto out_ior;
Expand Down Expand Up @@ -340,7 +340,7 @@ static void __exit board_cleanup (void)
/* Release resources, unregister device */
nand_release (board_mtd);

/* unmap physical adress */
/* unmap physical address */
iounmap((void *)baseaddr);

/* Free the MTD device structure */
Expand Down
90 changes: 32 additions & 58 deletions trunk/Documentation/DocBook/uio-howto.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
</abstract>

<revhistory>
<revision>
<revnumber>0.4</revnumber>
<date>2007-11-26</date>
<authorinitials>hjk</authorinitials>
<revremark>Removed section about uio_dummy.</revremark>
</revision>
<revision>
<revnumber>0.3</revnumber>
<date>2007-04-29</date>
Expand Down Expand Up @@ -94,6 +100,26 @@ interested in translating it, please email me
user space. This simplifies development and reduces the risk of
serious bugs within a kernel module.
</para>
<para>
Please note that UIO is not an universal driver interface. Devices
that are already handled well by other kernel subsystems (like
networking or serial or USB) are no candidates for an UIO driver.
Hardware that is ideally suited for an UIO driver fulfills all of
the following:
</para>
<itemizedlist>
<listitem>
<para>The device has memory that can be mapped. The device can be
controlled completely by writing to this memory.</para>
</listitem>
<listitem>
<para>The device usually generates interrupts.</para>
</listitem>
<listitem>
<para>The device does not fit into one of the standard kernel
subsystems.</para>
</listitem>
</itemizedlist>
</sect1>

<sect1 id="thanks">
Expand Down Expand Up @@ -174,8 +200,9 @@ interested in translating it, please email me
For cards that don't generate interrupts but need to be
polled, there is the possibility to set up a timer that
triggers the interrupt handler at configurable time intervals.
See <filename>drivers/uio/uio_dummy.c</filename> for an
example of this technique.
This interrupt simulation is done by calling
<function>uio_event_notify()</function>
from the timer's event handler.
</para>

<para>
Expand Down Expand Up @@ -263,63 +290,11 @@ offset = N * getpagesize();
</sect1>
</chapter>

<chapter id="using-uio_dummy" xreflabel="Using uio_dummy">
<?dbhtml filename="using-uio_dummy.html"?>
<title>Using uio_dummy</title>
<para>
Well, there is no real use for uio_dummy. Its only purpose is
to test most parts of the UIO system (everything except
hardware interrupts), and to serve as an example for the
kernel module that you will have to write yourself.
</para>

<sect1 id="what_uio_dummy_does">
<title>What uio_dummy does</title>
<para>
The kernel module <filename>uio_dummy.ko</filename> creates a
device that uses a timer to generate periodic interrupts. The
interrupt handler does nothing but increment a counter. The
driver adds two custom attributes, <varname>count</varname>
and <varname>freq</varname>, that appear under
<filename>/sys/devices/platform/uio_dummy/</filename>.
</para>

<para>
The attribute <varname>count</varname> can be read and
written. The associated file
<filename>/sys/devices/platform/uio_dummy/count</filename>
appears as a normal text file and contains the total number of
timer interrupts. If you look at it (e.g. using
<function>cat</function>), you'll notice it is slowly counting
up.
</para>

<para>
The attribute <varname>freq</varname> can be read and written.
The content of
<filename>/sys/devices/platform/uio_dummy/freq</filename>
represents the number of system timer ticks between two timer
interrupts. The default value of <varname>freq</varname> is
the value of the kernel variable <varname>HZ</varname>, which
gives you an interval of one second. Lower values will
increase the frequency. Try the following:
</para>
<programlisting format="linespecific">
cd /sys/devices/platform/uio_dummy/
echo 100 > freq
</programlisting>
<para>
Use <function>cat count</function> to see how the interrupt
frequency changes.
</para>
</sect1>
</chapter>

<chapter id="custom_kernel_module" xreflabel="Writing your own kernel module">
<?dbhtml filename="custom_kernel_module.html"?>
<title>Writing your own kernel module</title>
<para>
Please have a look at <filename>uio_dummy.c</filename> as an
Please have a look at <filename>uio_cif.c</filename> as an
example. The following paragraphs explain the different
sections of this file.
</para>
Expand Down Expand Up @@ -354,9 +329,8 @@ See the description below for details.
interrupt, it's your modules task to determine the irq number during
initialization. If you don't have a hardware generated interrupt but
want to trigger the interrupt handler in some other way, set
<varname>irq</varname> to <varname>UIO_IRQ_CUSTOM</varname>. The
uio_dummy module does this as it triggers the event mechanism in a timer
routine. If you had no interrupt at all, you could set
<varname>irq</varname> to <varname>UIO_IRQ_CUSTOM</varname>.
If you had no interrupt at all, you could set
<varname>irq</varname> to <varname>UIO_IRQ_NONE</varname>, though this
rarely makes sense.
</para></listitem>
Expand Down
115 changes: 115 additions & 0 deletions trunk/Documentation/Intel-IOMMU.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
Linux IOMMU Support
===================

The architecture spec can be obtained from the below location.

http://www.intel.com/technology/virtualization/

This guide gives a quick cheat sheet for some basic understanding.

Some Keywords

DMAR - DMA remapping
DRHD - DMA Engine Reporting Structure
RMRR - Reserved memory Region Reporting Structure
ZLR - Zero length reads from PCI devices
IOVA - IO Virtual address.

Basic stuff
-----------

ACPI enumerates and lists the different DMA engines in the platform, and
device scope relationships between PCI devices and which DMA engine controls
them.

What is RMRR?
-------------

There are some devices the BIOS controls, for e.g USB devices to perform
PS2 emulation. The regions of memory used for these devices are marked
reserved in the e820 map. When we turn on DMA translation, DMA to those
regions will fail. Hence BIOS uses RMRR to specify these regions along with
devices that need to access these regions. OS is expected to setup
unity mappings for these regions for these devices to access these regions.

How is IOVA generated?
---------------------

Well behaved drivers call pci_map_*() calls before sending command to device
that needs to perform DMA. Once DMA is completed and mapping is no longer
required, device performs a pci_unmap_*() calls to unmap the region.

The Intel IOMMU driver allocates a virtual address per domain. Each PCIE
device has its own domain (hence protection). Devices under p2p bridges
share the virtual address with all devices under the p2p bridge due to
transaction id aliasing for p2p bridges.

IOVA generation is pretty generic. We used the same technique as vmalloc()
but these are not global address spaces, but separate for each domain.
Different DMA engines may support different number of domains.

We also allocate gaurd pages with each mapping, so we can attempt to catch
any overflow that might happen.


Graphics Problems?
------------------
If you encounter issues with graphics devices, you can try adding
option intel_iommu=igfx_off to turn off the integrated graphics engine.

If it happens to be a PCI device included in the INCLUDE_ALL Engine,
then try enabling CONFIG_DMAR_GFX_WA to setup a 1-1 map. We hear
graphics drivers may be in process of using DMA api's in the near
future and at that time this option can be yanked out.

Some exceptions to IOVA
-----------------------
Interrupt ranges are not address translated, (0xfee00000 - 0xfeefffff).
The same is true for peer to peer transactions. Hence we reserve the
address from PCI MMIO ranges so they are not allocated for IOVA addresses.


Fault reporting
---------------
When errors are reported, the DMA engine signals via an interrupt. The fault
reason and device that caused it with fault reason is printed on console.

See below for sample.


Boot Message Sample
-------------------

Something like this gets printed indicating presence of DMAR tables
in ACPI.

ACPI: DMAR (v001 A M I OEMDMAR 0x00000001 MSFT 0x00000097) @ 0x000000007f5b5ef0

When DMAR is being processed and initialized by ACPI, prints DMAR locations
and any RMRR's processed.

ACPI DMAR:Host address width 36
ACPI DMAR:DRHD (flags: 0x00000000)base: 0x00000000fed90000
ACPI DMAR:DRHD (flags: 0x00000000)base: 0x00000000fed91000
ACPI DMAR:DRHD (flags: 0x00000001)base: 0x00000000fed93000
ACPI DMAR:RMRR base: 0x00000000000ed000 end: 0x00000000000effff
ACPI DMAR:RMRR base: 0x000000007f600000 end: 0x000000007fffffff

When DMAR is enabled for use, you will notice..

PCI-DMA: Using DMAR IOMMU

Fault reporting
---------------

DMAR:[DMA Write] Request device [00:02.0] fault addr 6df084000
DMAR:[fault reason 05] PTE Write access is not set
DMAR:[DMA Write] Request device [00:02.0] fault addr 6df084000
DMAR:[fault reason 05] PTE Write access is not set

TBD
----

- For compatibility testing, could use unity map domain for all devices, just
provide a 1-1 for all useful memory under a single domain for all devices.
- API for paravirt ops for abstracting functionlity for VMM folks.
2 changes: 1 addition & 1 deletion trunk/Documentation/SubmitChecklist
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ kernel patches.
20: Check that it all passes `make headers_check'.

21: Has been checked with injection of at least slab and page-allocation
fauilures. See Documentation/fault-injection/.
failures. See Documentation/fault-injection/.

If the new code is substantial, addition of subsystem-specific fault
injection might be appropriate.
Expand Down
3 changes: 1 addition & 2 deletions trunk/Documentation/SubmittingDrivers
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ Linux 2.4:
If the code area has a general maintainer then please submit it to
the maintainer listed in MAINTAINERS in the kernel file. If the
maintainer does not respond or you cannot find the appropriate
maintainer then please contact Marcelo Tosatti
<marcelo.tosatti@cyclades.com>.
maintainer then please contact Willy Tarreau <w@1wt.eu>.

Linux 2.6:
The same rules apply as 2.4 except that you should follow linux-kernel
Expand Down
4 changes: 2 additions & 2 deletions trunk/Documentation/SubmittingPatches
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,8 @@ section Linus Computer Science 101.
Nuff said. If your code deviates too much from this, it is likely
to be rejected without further review, and without comment.

Once significant exception is when moving code from one file to
another in this case you should not modify the moved code at all in
One significant exception is when moving code from one file to
another -- in this case you should not modify the moved code at all in
the same patch which moves it. This clearly delineates the act of
moving the code and your changes. This greatly aids review of the
actual differences and allows tools to better track the history of
Expand Down
Loading

0 comments on commit ed0dc4a

Please sign in to comment.