aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* x86: enable GART-IOMMU only after setting up protection methodsMark Langsdorf2009-06-061-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | The current code to set up the GART as an IOMMU enables GART translations before it removes the aperture from the kernel memory map, sets the GART PTEs to UC, sets up the guard and scratch pages, or does a wbinvd(). This leaves the possibility of cache aliasing open and can cause system crashes. Re-order the code so as to enable the GART translations only after all safeguards are in place and the tlb has been flushed. AMD has tested this patch on both Istanbul systems and 1st generation Opteron systems with APG enabled and seen no adverse effects. Istanbul systems with HT Assist enabled sometimes see MCE errors due to cache artifacts with the unmodified code. Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com> Cc: <stable@kernel.org> Cc: Joerg Roedel <joerg.roedel@amd.com> Cc: akpm@linux-foundation.org Cc: jbarnes@virtuousgeek.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
*---. Merge branches 'amd-iommu/fixes', 'amd-iommu/debug', ↵Joerg Roedel2009-05-286-229/+594
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'amd-iommu/suspend-resume' and 'amd-iommu/extended-allocator' into amd-iommu/2.6.31 Conflicts: arch/x86/kernel/amd_iommu.c arch/x86/kernel/amd_iommu_init.c
| | | * amd-iommu: don't free dma adresses below 512MB with CONFIG_IOMMU_STRESSJoerg Roedel2009-05-281-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will test the automatic aperture enlargement code. This is important because only very few devices will ever trigger this code path. So force it under CONFIG_IOMMU_STRESS. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | * amd-iommu: don't preallocate page tables with CONFIG_IOMMU_STRESSJoerg Roedel2009-05-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | This forces testing of on-demand page table allocation code. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | * amd-iommu: disable round-robin allocator for CONFIG_IOMMU_STRESSJoerg Roedel2009-05-281-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disabling the round-robin allocator results in reusing the same dma-addresses again very fast. This is a good test if the iotlb flushing is working correctly. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | * amd-iommu: remove amd_iommu_size kernel parameterJoerg Roedel2009-05-283-34/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This parameter is not longer necessary when aperture increases dynamically. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | * amd-iommu: enlarge the aperture dynamicallyJoerg Roedel2009-05-281-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | By dynamically increasing the aperture the extended allocator is now ready for use. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | * amd-iommu: handle exlusion ranges and unity mappings in alloc_new_rangeJoerg Roedel2009-05-281-11/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes sure no reserved addresses are allocated in an dma_ops domain when the aperture is increased dynamically. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | * amd-iommu: move aperture_range allocation code to seperate functionJoerg Roedel2009-05-281-36/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch prepares the dynamic increasement of dma_ops domain apertures. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | * amd-iommu: change dma_dom->next_bit to dma_dom->next_addressJoerg Roedel2009-05-282-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify the code a little bit by using the same unit for all address space related state in the dma_ops domain structure. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | * amd-iommu: make address allocator aware of multiple aperture rangesJoerg Roedel2009-05-282-39/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the AMD IOMMU address allocator to allow up to 32 aperture ranges per dma_ops domain. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | * amd-iommu: handle page table allocation failures in dma_ops codeJoerg Roedel2009-05-281-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The code will be required when the aperture size increases dynamically in the extended address allocator. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | * amd-iommu: move page table allocation code to seperate functionJoerg Roedel2009-05-281-25/+61
| | | | | | | | | | | | | | | | | | | | | | | | This patch makes page table allocation usable for dma_ops code. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | * amd-iommu: introduce aperture_range structureJoerg Roedel2009-05-282-35/+43
| | | | | | | | | | | | | | | | | | | | | | | | This is a preperation for extended address allocator. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | amd-iommu: implement suspend/resumeJoerg Roedel2009-05-281-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch puts everything together and enables suspend/resume support in the AMD IOMMU driver. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | amd_iommu: un __init functions required for suspend/resumeJoerg Roedel2009-05-281-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes sure that no function required for suspend/resume of AMD IOMMU driver is thrown away after boot. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | amd-iommu: add function to flush tlb for all devicesJoerg Roedel2009-05-282-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This function is required for suspend/resume support with AMD IOMMU enabled. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | amd-iommu: add function to flush tlb for all domainsJoerg Roedel2009-05-282-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This function is required for suspend/resume support with AMD IOMMU enabled. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | amd-iommu: add function to disable all iommusJoerg Roedel2009-05-281-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This function is required for suspend/resume support with AMD IOMMU enabled. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | amd-iommu: remove support for msi-xJoerg Roedel2009-05-281-43/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Current hardware uses msi instead of msi-x so this code it not necessary and can not be tested. The best thing is to drop this code. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | amd-iommu: drop pointless iommu-loop in msi setup codeJoerg Roedel2009-05-281-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not necessary to loop again over all IOMMUs in this code. So drop the loop. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | amd-iommu: consolidate hardware initialization to one functionJoerg Roedel2009-05-281-18/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch restructures the AMD IOMMU initialization code to initialize all hardware registers with one single function call. This is helpful for suspend/resume support. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | amd-iommu: introduce for_each_iommu* macrosJoerg Roedel2009-05-283-8/+16
| | |/ | | | | | | | | | | | | | | | | | | | | | This patch introduces the for_each_iommu and for_each_iommu_safe macros to simplify the developers life when having to iterate over all AMD IOMMUs in the system. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | amd-iommu: disable device isolation with CONFIG_IOMMU_STRESSJoerg Roedel2009-05-281-0/+6
| | | | | | | | | | | | | | | | | | | | | With device isolation disabled we can test better for race conditions in dma_ops related code. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | x86/iommu: add IOMMU_STRESS Kconfig entryJoerg Roedel2009-05-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This Kconfig option is intended to enable various code paths or parameters in IOMMU implementations to stress test the code and/or the hardware. This can also be done by disabling optimizations in the code when this option is switched on. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
| * | amd-iommu: move protection domain printk to dump codeJoerg Roedel2009-05-281-4/+6
| | | | | | | | | | | | | | | | | | | | | This information is only helpful for debugging. Don't print it anymore unless explicitly requested. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | amd-iommu: print ivmd information to dmesg when requestedJoerg Roedel2009-05-281-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | Add information about device memory mapping requirements for the IOMMU as described in the IVRS ACPI table to the kernel log if amd_iommu_dump was specified on the kernel command line. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | amd-iommu: print ivhd information to dmesg when requestedJoerg Roedel2009-05-281-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | Add information about devices belonging to an IOMMU as described in the IVRS ACPI table to the kernel log if amd_iommu_dump was specified on the kernel command line. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | amd-iommu: add dump for iommus described in ivrs tableJoerg Roedel2009-05-281-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Add information about IOMMU devices described in the IVRS ACPI table to the kernel log if amd_iommu_dump was specified on the kernel command line. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | amd-iommu: add amd_iommu_dump parameterJoerg Roedel2009-05-282-0/+16
| |/ | | | | | | | | | | | | | | This kernel parameter will be useful to get some AMD IOMMU related information in dmesg that is not necessary for the default user but may be helpful in debug situations. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* | amd iommu: properly detach from protection domain on ->removeChris Wright2009-05-281-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Some drivers may use the dma api during ->remove which will cause a protection domain to get reattached to a device. Delay the detach until after the driver is completely unbound. [ joro: added a little merge helper ] [ Impact: fix too early device<->domain removal ] Signed-off-by: Chris Wright <chrisw@redhat.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* | amd-iommu: make sure only ivmd entries are parsedJoerg Roedel2009-05-281-0/+2
| | | | | | | | | | | | | | | | | | The bug never triggered. But it should be fixed to protect against broken ACPI tables in the future. [ Impact: protect against broken ivrs acpi table ] Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* | amd-iommu: fix the handling of device aliases in the AMD IOMMU driver.Neil Turton2009-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The devid parameter to set_dev_entry_from_acpi is the requester ID rather than the device ID since it is used to index the IOMMU device table. The handling of IVHD_DEV_ALIAS used to pass the device ID. This patch fixes it to pass the requester ID. [ Impact: fix setting the wrong req-id in acpi-table parsing ] Signed-off-by: Neil Turton <nturton@solarflare.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* | amd-iommu: fix an off-by-one error in the AMD IOMMU driver.Neil Turton2009-05-281-1/+1
|/ | | | | | | | | | | | | The variable amd_iommu_last_bdf holds the maximum bdf of any device controlled by an IOMMU, so the number of device entries needed is amd_iommu_last_bdf+1. The function tbl_size used amd_iommu_last_bdf instead. This would be a problem if the last device were a large enough power of 2. [ Impact: fix amd_iommu_last_bdf off-by-one error ] Signed-off-by: Neil Turton <nturton@solarflare.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* Merge commit 'v2.6.30-rc5' into core/iommuIngo Molnar2009-05-112270-61650/+65751
|\ | | | | | | | | | | | | Merge reason: core/iommu was on an .30-rc1 base, update it to .30-rc5 to refresh. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * Linux 2.6.30-rc5v2.6.30-rc5Linus Torvalds2009-05-081-1/+1
| |
| * Merge git://git.infradead.org/mtd-2.6Linus Torvalds2009-05-082-15/+29
| |\ | | | | | | | | | | | | | | | | | | | | | * git://git.infradead.org/mtd-2.6: mtd: fix timeout in M25P80 driver mtd: Bug in m25p80.c during whole-chip erase mtd: expose subpage size via sysfs mtd: mtd in mtd_release is unused without CONFIG_MTD_CHAR
| | * mtd: fix timeout in M25P80 driverPeter Horton2009-05-081-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend erase timeout in M25P80 SPI Flash driver. The M25P80 drivers fails erasing sectors on a M25P128 because the ready wait timeout is too short. Change the timeout from a simple loop count to a suitable number of seconds. Signed-off-by: Peter Horton <zero@colonel-panic.org> Tested-by: Martin Michlmayr <tbm@cyrius.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| | * mtd: Bug in m25p80.c during whole-chip eraseSteven A. Falco2009-04-291-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a logic error in "whole chip erase" for the m25p80 family. If the whole device is successfully erased, erase_chip() will return 0, and the code will fall through to the "else" clause, and do sector-by-sector erase in addition to the whole-chip erase. This patch corrects that. Also, the MAX_READY_WAIT_COUNT is insufficient for an m25p16 connected to a 400 MHz powerpc. Increasing it allows me to successfully program the device on my board. Signed-off-by: Steven A. Falco <sfalco@harris.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| | * mtd: expose subpage size via sysfsArtem Bityutskiy2009-04-191-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MTD has got sysfs support in 2.6.30-rc1. But subpage size is not exposed there - do this. UBI utilities badly need this parameter. At the moment there is no way to get subpage size - ioctls do not return it. And we just got sysfs support, so we can easilly extend it with this additional parameter. This can be merged late in the development cycle because: 1. sysfs support has been just added - there are no users for it so far, even. 2. UBI utilities really need this parameter, and it is better not to delay this. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| | * mtd: mtd in mtd_release is unused without CONFIG_MTD_CHARDenis V. Lunev2009-04-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/mtd/mtdcore.c: In function 'mtd_release': drivers/mtd/mtdcore.c:51: warning: unused variable 'mtd' [akpm: make it actually build] Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | Merge branch 'x86-fixes-for-linus' of ↵Linus Torvalds2009-05-088-15/+40
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86: MCE: make cmci_discover_lock irq-safe x86: xen, i386: reserve Xen pagetables x86, kexec: fix crashdump panic with CONFIG_KEXEC_JUMP x86-64: finish cleanup_highmaps()'s job wrt. _brk_end x86: fix boot hang in early_reserve_e820() x86: Fix a typo in a printk message x86, srat: do not register nodes beyond e820 map
| | * | x86: MCE: make cmci_discover_lock irq-safeHidetoshi Seto2009-05-081-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lockdep reports the warning below when Li tries to offline one cpu: [ 110.835487] ================================= [ 110.835616] [ INFO: inconsistent lock state ] [ 110.835688] 2.6.30-rc4-00336-g8c9ed89 #52 [ 110.835757] --------------------------------- [ 110.835828] inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. [ 110.835908] swapper/0 [HC1[1]:SC0[0]:HE0:SE1] takes: [ 110.835982] (cmci_discover_lock){?.+...}, at: [<ffffffff80236dc0>] cmci_clear+0x30/0x9b cmci_clear() can be called via smp_call_function_single(). It is better to disable interrupt while holding cmci_discover_lock, to turn it into an irq-safe lock - we can deadlock otherwise. [ Impact: fix possible deadlock in the MCE code ] Reported-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Andrew Morton <akpm@linux-foundation.org> LKML-Reference: <4A03ED38.8000700@jp.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Reported-by: Shaohua Li<shaohua.li@intel.com>
| | * | x86: xen, i386: reserve Xen pagetablesJeremy Fitzhardinge2009-05-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Xen pagetables are no longer implicitly reserved as part of the other i386_start_kernel reservations, so make sure we explicitly reserve them. This prevents them from being released into the general kernel free page pool and reused. [ Impact: fix Xen guest crash ] Also-Bisected-by: Bryan Donlan <bdonlan@gmail.com> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Cc: Xen-devel <xen-devel@lists.xensource.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> LKML-Reference: <4A032EEC.30509@goop.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| | * | x86, kexec: fix crashdump panic with CONFIG_KEXEC_JUMPHuang Ying2009-05-072-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tim Starling reported that crashdump will panic with kernel compiled with CONFIG_KEXEC_JUMP due to null pointer deference in machine_kexec_32.c: machine_kexec(), when deferencing kexec_image. Refering to: http://bugzilla.kernel.org/show_bug.cgi?id=13265 This patch fixes the BUG via replacing global variable reference: kexec_image in machine_kexec() with local variable reference: image, which is more appropriate, and will not be null. Same BUG is in machine_kexec_64.c too, so fixed too in the same way. [ Impact: fix crash on kexec ] Reported-by: Tim Starling <tstarling@wikimedia.org> Signed-off-by: Huang Ying <ying.huang@intel.com> LKML-Reference: <1241751101.6259.85.camel@yhuang-dev.sh.intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * | x86-64: finish cleanup_highmaps()'s job wrt. _brk_endJan Beulich2009-05-071-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the introduction of the .brk section, special care must be taken that no unused page table entries remain if _brk_end and _end are separated by a 2M page boundary. cleanup_highmap() runs very early and hence cannot take care of that, hence potential entries needing to be removed past _brk_end must be cleared once the brk allocator has done its job. [ Impact: avoids undesirable TLB aliases ] Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * | x86: fix boot hang in early_reserve_e820()Jan Beulich2009-05-071-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the first non-reserved (sub-)range doesn't fit the size requested, an endless loop will be entered. If a range returned from find_e820_area_size() turns out insufficient in size, the range must be skipped before calling the function again. [ Impact: fixes boot hang on some platforms ] Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * | x86: Fix a typo in a printk messageNikanth Karthikesan2009-05-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ Impact: printk message cleanup ] Signed-off-by: Nikanth Karthikesan <knikanth@suse.de> LKML-Reference: <200905040908.27299.knikanth@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| | * | x86, srat: do not register nodes beyond e820 mapDavid Rientjes2009-05-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mem= option will truncate the memory map at a specified address so it's not possible to register nodes with memory beyond the e820 upper bound. unparse_node() is only called when then node had memory associated with it, although with the mem= option it is no longer addressable. [ Impact: fix boot hang on certain (large) systems ] Reported-by: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com> Signed-off-by: David Rientjes <rientjes@google.com> Acked-by: Jack Steiner <steiner@sgi.com> LKML-Reference: <alpine.DEB.2.00.0905051248150.20021@chino.kir.corp.google.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * | | Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6Linus Torvalds2009-05-082-1/+4
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: hwmon: (w83781d) Fix W83782D support (NULL pointer dereference) hwmon: (asus_atk0110) Fix compiler warning