diff options
author | Karsten Weiss <K.Weiss@science-computing.de> | 2007-02-13 07:26:21 -0500 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-02-13 07:26:21 -0500 |
commit | 5558870bfbcca10cfc7b13ab866687012ea3c9af (patch) | |
tree | 45605429a4fd5eee9b05d5e7c852fa72bfd07a21 | |
parent | 5809f9d442e9dbb23859e2c37d8c47043f6b5cc9 (diff) |
[PATCH] x86-64: improved iommu documentation
- add SWIOTLB config help text
- mention Documentation/x86_64/boot-options.txt in
Documentation/kernel-parameters.txt
- remove the duplication of the iommu kernel parameter documentation.
- Better explanation of some of the iommu kernel parameter options.
- "32MB<<order" instead of "32MB^order".
- Mention the default "order" value.
- list the four existing PCI-DMA mapping implementations of arch x86_64
- group the iommu= option keywords by PCI-DMA mapping implementation.
- Distinguish iommu= option keywords from number arguments.
- Explain the meaning of DAC and SAC.
Signed-off-by: Karsten Weiss <knweiss@science-computing.de>
Signed-off-by: Andi Kleen <ak@suse.de>
Acked-by: Muli Ben-Yehuda <muli@il.ibm.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
-rw-r--r-- | Documentation/kernel-parameters.txt | 3 | ||||
-rw-r--r-- | Documentation/x86_64/boot-options.txt | 109 | ||||
-rw-r--r-- | arch/x86_64/Kconfig | 10 | ||||
-rw-r--r-- | arch/x86_64/kernel/pci-dma.c | 28 |
4 files changed, 90 insertions, 60 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index d25acd51e181..733a736bc6c8 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -104,6 +104,9 @@ loader, and have no meaning to the kernel directly. | |||
104 | Do not modify the syntax of boot loader parameters without extreme | 104 | Do not modify the syntax of boot loader parameters without extreme |
105 | need or coordination with <Documentation/i386/boot.txt>. | 105 | need or coordination with <Documentation/i386/boot.txt>. |
106 | 106 | ||
107 | There are also arch-specific kernel-parameters not documented here. | ||
108 | See for example <Documentation/x86_64/boot-options.txt>. | ||
109 | |||
107 | Note that ALL kernel parameters listed below are CASE SENSITIVE, and that | 110 | Note that ALL kernel parameters listed below are CASE SENSITIVE, and that |
108 | a trailing = on the name of any parameter states that that parameter will | 111 | a trailing = on the name of any parameter states that that parameter will |
109 | be entered as an environment variable, whereas its absence indicates that | 112 | be entered as an environment variable, whereas its absence indicates that |
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86_64/boot-options.txt index 5c86ed6f0448..0d653993f361 100644 --- a/Documentation/x86_64/boot-options.txt +++ b/Documentation/x86_64/boot-options.txt | |||
@@ -180,40 +180,81 @@ PCI | |||
180 | pci=lastbus=NUMBER Scan upto NUMBER busses, no matter what the mptable says. | 180 | pci=lastbus=NUMBER Scan upto NUMBER busses, no matter what the mptable says. |
181 | pci=noacpi Don't use ACPI to set up PCI interrupt routing. | 181 | pci=noacpi Don't use ACPI to set up PCI interrupt routing. |
182 | 182 | ||
183 | IOMMU | 183 | IOMMU (input/output memory management unit) |
184 | 184 | ||
185 | iommu=[size][,noagp][,off][,force][,noforce][,leak][,memaper[=order]][,merge] | 185 | Currently four x86-64 PCI-DMA mapping implementations exist: |
186 | [,forcesac][,fullflush][,nomerge][,noaperture][,calgary] | 186 | |
187 | size set size of iommu (in bytes) | 187 | 1. <arch/x86_64/kernel/pci-nommu.c>: use no hardware/software IOMMU at all |
188 | noagp don't initialize the AGP driver and use full aperture. | 188 | (e.g. because you have < 3 GB memory). |
189 | off don't use the IOMMU | 189 | Kernel boot message: "PCI-DMA: Disabling IOMMU" |
190 | leak turn on simple iommu leak tracing (only when CONFIG_IOMMU_LEAK is on) | 190 | |
191 | memaper[=order] allocate an own aperture over RAM with size 32MB^order. | 191 | 2. <arch/x86_64/kernel/pci-gart.c>: AMD GART based hardware IOMMU. |
192 | noforce don't force IOMMU usage. Default. | 192 | Kernel boot message: "PCI-DMA: using GART IOMMU" |
193 | force Force IOMMU. | 193 | |
194 | merge Do SG merging. Implies force (experimental) | 194 | 3. <arch/x86_64/kernel/pci-swiotlb.c> : Software IOMMU implementation. Used |
195 | nomerge Don't do SG merging. | 195 | e.g. if there is no hardware IOMMU in the system and it is need because |
196 | forcesac For SAC mode for masks <40bits (experimental) | 196 | you have >3GB memory or told the kernel to us it (iommu=soft)) |
197 | fullflush Flush IOMMU on each allocation (default) | 197 | Kernel boot message: "PCI-DMA: Using software bounce buffering |
198 | nofullflush Don't use IOMMU fullflush | 198 | for IO (SWIOTLB)" |
199 | allowed overwrite iommu off workarounds for specific chipsets. | 199 | |
200 | soft Use software bounce buffering (default for Intel machines) | 200 | 4. <arch/x86_64/pci-calgary.c> : IBM Calgary hardware IOMMU. Used in IBM |
201 | noaperture Don't touch the aperture for AGP. | 201 | pSeries and xSeries servers. This hardware IOMMU supports DMA address |
202 | allowdac Allow DMA >4GB | 202 | mapping with memory protection, etc. |
203 | When off all DMA over >4GB is forced through an IOMMU or bounce | 203 | Kernel boot message: "PCI-DMA: Using Calgary IOMMU" |
204 | buffering. | 204 | |
205 | nodac Forbid DMA >4GB | 205 | iommu=[<size>][,noagp][,off][,force][,noforce][,leak[=<nr_of_leak_pages>] |
206 | panic Always panic when IOMMU overflows | 206 | [,memaper[=<order>]][,merge][,forcesac][,fullflush][,nomerge] |
207 | calgary Use the Calgary IOMMU if it is available | 207 | [,noaperture][,calgary] |
208 | 208 | ||
209 | swiotlb=pages[,force] | 209 | General iommu options: |
210 | 210 | off Don't initialize and use any kind of IOMMU. | |
211 | pages Prereserve that many 128K pages for the software IO bounce buffering. | 211 | noforce Don't force hardware IOMMU usage when it is not needed. |
212 | force Force all IO through the software TLB. | 212 | (default). |
213 | 213 | force Force the use of the hardware IOMMU even when it is | |
214 | calgary=[64k,128k,256k,512k,1M,2M,4M,8M] | 214 | not actually needed (e.g. because < 3 GB memory). |
215 | calgary=[translate_empty_slots] | 215 | soft Use software bounce buffering (SWIOTLB) (default for |
216 | calgary=[disable=<PCI bus number>] | 216 | Intel machines). This can be used to prevent the usage |
217 | of an available hardware IOMMU. | ||
218 | |||
219 | iommu options only relevant to the AMD GART hardware IOMMU: | ||
220 | <size> Set the size of the remapping area in bytes. | ||
221 | allowed Overwrite iommu off workarounds for specific chipsets. | ||
222 | fullflush Flush IOMMU on each allocation (default). | ||
223 | nofullflush Don't use IOMMU fullflush. | ||
224 | leak Turn on simple iommu leak tracing (only when | ||
225 | CONFIG_IOMMU_LEAK is on). Default number of leak pages | ||
226 | is 20. | ||
227 | memaper[=<order>] Allocate an own aperture over RAM with size 32MB<<order. | ||
228 | (default: order=1, i.e. 64MB) | ||
229 | merge Do scather-gather (SG) merging. Implies "force" | ||
230 | (experimental). | ||
231 | nomerge Don't do scather-gather (SG) merging. | ||
232 | noaperture Ask the IOMMU not to touch the aperture for AGP. | ||
233 | forcesac Force single-address cycle (SAC) mode for masks <40bits | ||
234 | (experimental). | ||
235 | noagp Don't initialize the AGP driver and use full aperture. | ||
236 | allowdac Allow double-address cycle (DAC) mode, i.e. DMA >4GB. | ||
237 | DAC is used with 32-bit PCI to push a 64-bit address in | ||
238 | two cycles. When off all DMA over >4GB is forced through | ||
239 | an IOMMU or software bounce buffering. | ||
240 | nodac Forbid DAC mode, i.e. DMA >4GB. | ||
241 | panic Always panic when IOMMU overflows. | ||
242 | calgary Use the Calgary IOMMU if it is available | ||
243 | |||
244 | iommu options only relevant to the software bounce buffering (SWIOTLB) IOMMU | ||
245 | implementation: | ||
246 | swiotlb=<pages>[,force] | ||
247 | <pages> Prereserve that many 128K pages for the software IO | ||
248 | bounce buffering. | ||
249 | force Force all IO through the software TLB. | ||
250 | |||
251 | Settings for the IBM Calgary hardware IOMMU currently found in IBM | ||
252 | pSeries and xSeries machines: | ||
253 | |||
254 | calgary=[64k,128k,256k,512k,1M,2M,4M,8M] | ||
255 | calgary=[translate_empty_slots] | ||
256 | calgary=[disable=<PCI bus number>] | ||
257 | panic Always panic when IOMMU overflows | ||
217 | 258 | ||
218 | 64k,...,8M - Set the size of each PCI slot's translation table | 259 | 64k,...,8M - Set the size of each PCI slot's translation table |
219 | when using the Calgary IOMMU. This is the size of the translation | 260 | when using the Calgary IOMMU. This is the size of the translation |
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig index 02dd39457bcf..a55382a1bb46 100644 --- a/arch/x86_64/Kconfig +++ b/arch/x86_64/Kconfig | |||
@@ -458,8 +458,8 @@ config IOMMU | |||
458 | on systems with more than 3GB. This is usually needed for USB, | 458 | on systems with more than 3GB. This is usually needed for USB, |
459 | sound, many IDE/SATA chipsets and some other devices. | 459 | sound, many IDE/SATA chipsets and some other devices. |
460 | Provides a driver for the AMD Athlon64/Opteron/Turion/Sempron GART | 460 | Provides a driver for the AMD Athlon64/Opteron/Turion/Sempron GART |
461 | based IOMMU and a software bounce buffer based IOMMU used on Intel | 461 | based hardware IOMMU and a software bounce buffer based IOMMU used |
462 | systems and as fallback. | 462 | on Intel systems and as fallback. |
463 | The code is only active when needed (enough memory and limited | 463 | The code is only active when needed (enough memory and limited |
464 | device) unless CONFIG_IOMMU_DEBUG or iommu=force is specified | 464 | device) unless CONFIG_IOMMU_DEBUG or iommu=force is specified |
465 | too. | 465 | too. |
@@ -496,6 +496,12 @@ config CALGARY_IOMMU_ENABLED_BY_DEFAULT | |||
496 | # need this always selected by IOMMU for the VIA workaround | 496 | # need this always selected by IOMMU for the VIA workaround |
497 | config SWIOTLB | 497 | config SWIOTLB |
498 | bool | 498 | bool |
499 | help | ||
500 | Support for software bounce buffers used on x86-64 systems | ||
501 | which don't have a hardware IOMMU (e.g. the current generation | ||
502 | of Intel's x86-64 CPUs). Using this PCI devices which can only | ||
503 | access 32-bits of memory can be used on systems with more than | ||
504 | 3 GB of memory. If unsure, say Y. | ||
499 | 505 | ||
500 | config X86_MCE | 506 | config X86_MCE |
501 | bool "Machine check support" if EMBEDDED | 507 | bool "Machine check support" if EMBEDDED |
diff --git a/arch/x86_64/kernel/pci-dma.c b/arch/x86_64/kernel/pci-dma.c index 683b7a5c1ab3..651ccfb06697 100644 --- a/arch/x86_64/kernel/pci-dma.c +++ b/arch/x86_64/kernel/pci-dma.c | |||
@@ -223,30 +223,10 @@ int dma_set_mask(struct device *dev, u64 mask) | |||
223 | } | 223 | } |
224 | EXPORT_SYMBOL(dma_set_mask); | 224 | EXPORT_SYMBOL(dma_set_mask); |
225 | 225 | ||
226 | /* iommu=[size][,noagp][,off][,force][,noforce][,leak][,memaper[=order]][,merge] | 226 | /* |
227 | [,forcesac][,fullflush][,nomerge][,biomerge] | 227 | * See <Documentation/x86_64/boot-options.txt> for the iommu kernel parameter |
228 | size set size of iommu (in bytes) | 228 | * documentation. |
229 | noagp don't initialize the AGP driver and use full aperture. | 229 | */ |
230 | off don't use the IOMMU | ||
231 | leak turn on simple iommu leak tracing (only when CONFIG_IOMMU_LEAK is on) | ||
232 | memaper[=order] allocate an own aperture over RAM with size 32MB^order. | ||
233 | noforce don't force IOMMU usage. Default. | ||
234 | force Force IOMMU. | ||
235 | merge Do lazy merging. This may improve performance on some block devices. | ||
236 | Implies force (experimental) | ||
237 | biomerge Do merging at the BIO layer. This is more efficient than merge, | ||
238 | but should be only done with very big IOMMUs. Implies merge,force. | ||
239 | nomerge Don't do SG merging. | ||
240 | forcesac For SAC mode for masks <40bits (experimental) | ||
241 | fullflush Flush IOMMU on each allocation (default) | ||
242 | nofullflush Don't use IOMMU fullflush | ||
243 | allowed overwrite iommu off workarounds for specific chipsets. | ||
244 | soft Use software bounce buffering (default for Intel machines) | ||
245 | noaperture Don't touch the aperture for AGP. | ||
246 | allowdac Allow DMA >4GB | ||
247 | nodac Forbid DMA >4GB | ||
248 | panic Force panic when IOMMU overflows | ||
249 | */ | ||
250 | __init int iommu_setup(char *p) | 230 | __init int iommu_setup(char *p) |
251 | { | 231 | { |
252 | iommu_merge = 1; | 232 | iommu_merge = 1; |