summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/iommu.c
AgeCommit message (Collapse)Author
2006-11-01[POWERPC] Use 4kB iommu pages even on 64kB-page systemsLinas Vepstas
The 10Gigabit ethernet device drivers appear to be able to chew up all 256MB of TCE mappings on pSeries systems, as evidenced by numerous error messages: iommu_alloc failed, tbl c0000000010d5c48 vaddr c0000000d875eff0 npages 1 Some experimentation indicates that this is essentially because one 1500 byte ethernet MTU gets mapped as a 64K DMA region when the large 64K pages are enabled. Thus, it doesn't take much to exhaust all of the available DMA mappings for a high-speed card. This patch changes the iommu allocator to work with its own unique, distinct page size. Although the patch is long, its actually quite simple: it just #defines a distinct IOMMU_PAGE_SIZE and then uses this in all the places that matter. As a side effect, it also dramatically improves network performance on platforms with H-calls on iommu translation inserts/removes (since we no longer call it 16 times for a 1500 bytes packet when the iommu HW is still 4k). In the future, we might want to make the IOMMU_PAGE_SIZE a variable in the iommu_table instance, thus allowing support for different HW page sizes in the iommu itself. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Olof Johansson <olof@lixom.net> Acked-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-10-06[POWERPC] linux,tce-size property is 32 bitsNathan Lynch
The "linux,tce-size" property is only 32 bits (see prom_initialize_tce_table() in arch/powerpc/kernel/prom_init.c). Treating it as an unsigned long in iommu_table_setparms() leads to access beyond the end of the property's buffer, so we pass garbage to the memset() in that function. [boot]0020 XICS Init i8259 legacy interrupt controller initialized [boot]0021 XICS Done PID hash table entries: 4096 (order: 12, 32768 bytes) cpu 0x0: Vector: 300 (Data Access) at [c0000000fe783850] pc: c000000000035e90: .memset+0x60/0xfc lr: c000000000044fa4: .iommu_table_setparms+0xb0/0x158 sp: c0000000fe783ad0 msr: 9000000000009032 dar: c000000100000000 dsisr: 42010000 current = 0xc00000000450e810 paca = 0xc000000000411580 pid = 1, comm = swapper enter ? for help [link register ] c000000000044fa4 .iommu_table_setparms+0xb0/0x158 [c0000000fe783ad0] c000000000044f4c .iommu_table_setparms+0x58/0x158 (unreliable) [c0000000fe783b70] c00000000004529c .iommu_bus_setup_pSeries+0x1c4/0x254 [c0000000fe783c00] c00000000002b8ac .do_bus_setup+0x3c/0xe4 [c0000000fe783c80] c00000000002c924 .pcibios_fixup_bus+0x64/0xd8 [c0000000fe783d00] c0000000001a2d5c .pci_scan_child_bus+0x6c/0x10c [c0000000fe783da0] c00000000002be28 .scan_phb+0x17c/0x1b4 [c0000000fe783e40] c0000000003cfa00 .pcibios_init+0x58/0x19c [c0000000fe783ec0] c0000000000094b4 .init+0x1e8/0x3d8 [c0000000fe783f90] c000000000026e54 .kernel_thread+0x4c/0x68 Signed-off-by: Nathan Lynch <ntl@pobox.com> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-07-31[POWERPC] pseries: Constify & voidify get_property()Jeremy Kerr
Now that get_property() returns a void *, there's no need to cast its return value. Also, treat the return value as const, so we can constify get_property later. pseries platform changes. Built for pseries_defconfig Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-06-30Remove obsolete #include <linux/config.h>Jörn Engel
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-06-28[POWERPC] kdump: Reserve the existing TCE mappings left by the first kernelHaren Myneni
During kdump boot, noticed some machines checkstop on dma protection fault for ongoing DMA left in the first kernel. Instead of initializing TCE entries in iommu_init() for the kdump boot, this patch fixes this issue by walking through the each TCE table and checks whether the entries are in use by the first kernel. If so, reserve those entries by setting the corresponding bit in tbl->it_map such that these entries will not be available for the kdump boot. However it could be possible that all TCE entries might be used up due to the driver bug that does continuous mapping. My observation is around 1700 TCE entries are used on some systems (Ex: P4) at some point of time during kdump boot and saving dump (either write into the disk or sending to remote machine). Hence, this patch will make sure that minimum of 2048 entries will be available such that kdump boot could be successful in some cases. Signed-off-by: Haren Myneni <haren@us.ibm.com> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-06-21[POWERPC] Dont look for class-code in pci childrenAnton Blanchard
Looking for class-code in PCI children breaks with direct slots. Lets just count all children. Signed-off-by: Anton Blanchard <anton@samba.org> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-06-15[POWERPC] node local IOMMU tablesAnton Blanchard
Allocate IOMMU tables local to the relevant node. Signed-off-by: Anton Blanchard <anton@samba.org> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-05-19[PATCH] powerpc: pseries: Use generic dma-window parsing functionJeremy Kerr
Change the pseries iommu init code to use the new of_parse_dma_window() to parse the ibm,dma-window and ibm,my-dma-window properties of pci and virtual device nodes. Also, clean up vio_build_iommu_table() a little. Tested on pseries, with both vio and pci devices. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-04-29[PATCH] powerpc: kill union tce_entryOlof Johansson
It's been long overdue to kill the union tce_entry in the pSeries/iSeries TCE code, especially since I asked the Summit guys to do it on the code they copied from us. Also, while I was at it, I cleaned up some whitespace. Built and booted on pSeries, built on iSeries. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-03-22[PATCH] powerpc: Replace platform_is_lpar() with a firmware featureMichael Ellerman
It has been decreed that platform numbers are evil, so as a step in that direction, replace platform_is_lpar() with a FW_FEATURE_LPAR bit. Currently FW_FEATURE_LPAR really means i/pSeries LPAR, in the future we might have to clean that up if we need to be more specific about what LPAR actually means. But that's another patch ... Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-02-10[PATCH] powerpc: trivial: modify comments to refer to new location of filesJon Mason
This patch removes all self references and fixes references to files in the now defunct arch/ppc64 tree. I think this accomplises everything wanted, though there might be a few references I missed. Signed-off-by: Jon Mason <jdmason@us.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-12[PATCH] powerpc: pseries namespace cleanupArnd Bergmann
These symbols are only used in the file that they are defined in, so they should not be in the global namespace. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09[PATCH] powerpc: minor cleanup of void ptr dereflinas
Minor: use macro to perform void pointer deref; this may someday help avoid pointer typecasting errors. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-12-05powerpc/pseries: Optimize IOMMU setupPaul Mackerras
The previous commit will use the page-at-a-time hypervisor call for setting up IOMMU entries when we are using 64k pages and setting up one 64k page, even though that means 16 calls to the hypervisor, since the hypervisor still works on 4k pages. This optimizes this case by using the multi-page IOMMU setup hypervisor call instead. Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-12-02[PATCH] powerpc/pseries: Fix TCE building with 64k pagesizeMichal Ostrowski
Must adjust tcenum and npages by TCE_PAGE_FACTOR to convert between 64KB pages and TCE (4K) pages. (This is done in other places, except for this one location.) Signed-off-by: Michal Ostrowski <mostrows at watson ibm com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-23[PATCH] powerpc: update my email addressOlof Johansson
Email address update, changing old work address to personal (permanent) one. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10[PATCH] powerpc: merge code values for identifying platformsPaul Mackerras
This patch merges platform codes. systemcfg->platform is no longer used, systemcfg use in general is deprecated as much as possible (and renamed _systemcfg before it gets completely moved elsewhere in a future patch), _machine is now used on ppc64 along as ppc32. Platform codes aren't gone yet but we are getting a step closer. A bunch of asm code in head[_64].S is also turned into C code. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-07powerpc: Various UP build fixesPaul Mackerras
Mostly this involves adding #include <asm/smp.h>, since that defines things like boot_cpuid[_phys] and [gs]et_hard_smp_processor_id, which are SMP-related but still needed on UP. This incorporates fixes posted by Olof Johansson and Heikki Lindholm. Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-07[PATCH] powerpc: Kill ppcdebugDavid Gibson
The ancient ppcdebug/PPCDBG mechanism is now only used in two places. First, in the hash setup code, one of the bits allows the size of the hash table to be reduced by a factor of 8 - which would be better accomplished with a command line option for that purpose. The other was a bunch of bus walking related messages in the iSeries code, which would seem to be insufficient reason to keep the mechanism. This patch removes the last traces of this mechanism. Built and booted on iSeries and pSeries POWER5 LPAR (ARCH=powerpc). Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-04Merge with PaulusMichael Ellerman
2005-11-03[PATCH] ppc64: Fix add notifier crashesJohn Rose
The extraction of PCI stuff from struct device_node left some false assumptions in notifier code. As a result, dynamic add crashes when non-PCI nodes are added. This patch fixes these assumptions. Signed-off-by: John Rose <johnrose@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-03powerpc: Move plpar_wrappers.h into arch/powerpc/platforms/pseriesMichael Ellerman
Move plpar_wrappers.h into arch/powerpc/platforms/pseries, fixup white space, and update callers. Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
2005-10-10powerpc: move pSeries files to arch/powerpc/platforms/pseriesPaul Mackerras
Signed-off-by: Paul Mackerras <paulus@samba.org>