aboutsummaryrefslogtreecommitdiff
path: root/arch
AgeCommit message (Collapse)AuthorFilesLines
2009-11-30Merge branch 'fixes' of ↵Linus Torvalds1-1/+2
git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq: [CPUFREQ] Enable ACPI PDC handshake for VIA/Centaur CPUs
2009-11-30arch/alpha/kernel: Add kmalloc NULL testsJulia Lawall2-0/+4
Check that the result of kmalloc is not NULL before passing it to other functions. The semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ expression *x; identifier f; constant char *C; @@ x = \(kmalloc\|kcalloc\|kzalloc\)(...); ... when != x == NULL when != x != NULL when != (x || ...) ( kfree(x) f(...,C,...,x,...) | *f(...,x,...) | *x->f ) // </smpl> Signed-off-by: Julia Lawall <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Richard Henderson <[email protected]> Signed-off-by: Matt Turner <[email protected]>
2009-11-30arch/alpha/kernel/sys_ruffian.c: Use DIV_ROUND_CLOSESTJulia Lawall1-1/+1
The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d but is perhaps more readable. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @haskernel@ @@ @depends on haskernel@ expression x,__divisor; @@ - (((x) + ((__divisor) / 2)) / (__divisor)) + DIV_ROUND_CLOSEST(x,__divisor) // </smpl> Signed-off-by: Julia Lawall <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Richard Henderson <[email protected]> Signed-off-by: Matt Turner <[email protected]>
2009-11-30x86: Fix a section mismatch in arch/x86/kernel/setup.cHelight.Xu1-2/+2
copy_edd() should be __init. warning msg: WARNING: vmlinux.o(.text+0x7759): Section mismatch in reference from the function copy_edd() to the variable .init.data:boot_params The function copy_edd() references the variable __initdata boot_params. This is often because copy_edd lacks a __initdata annotation or the annotation of boot_params is wrong. Signed-off-by: ZhenwenXu <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: H. Peter Anvin <[email protected]>
2009-11-30parisc: fix unwind with recent gcc versionsHelge Deller2-4/+4
kernel unwinding is broken with gcc >= 4.x. Part of the problem is that binutils seems very sensitive to where the unwind information is stored. Signed-off-by: Helge Deller <[email protected]> Signed-off-by: Kyle McMartin <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2009-11-27x86/amd-iommu: Remove amd_iommu_pd_tableJoerg Roedel3-45/+11
The data that was stored in this table is now available in dev->archdata.iommu. So this table is not longer necessary. This patch removes the remaining uses of that variable and removes it from the code. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Move reset_iommu_command_buffer out of locked codeJoerg Roedel1-7/+6
This patch removes the ugly contruct where the iommu->lock must be released while before calling the reset_iommu_command_buffer function. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Cleanup DTE flushing codeJoerg Roedel2-66/+35
This patch cleans up the code to flush device table entries in the IOMMU. With this chance the driver can get rid of the iommu_queue_inv_dev_entry() function. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Introduce iommu_flush_device() functionJoerg Roedel1-4/+15
This patch adds a function to flush a DTE entry for a given struct device and replaces iommu_queue_inv_dev_entry calls with this function where appropriate. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Cleanup attach/detach_device codeJoerg Roedel1-44/+58
This patch cleans up the attach_device and detach_device paths and fixes reference counting while at it. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Keep devices per domain in a listJoerg Roedel2-0/+13
This patch introduces a list to each protection domain which keeps all devices associated with the domain. This can be used later to optimize certain functions and to completly remove the amd_iommu_pd_table. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Add device bind reference countingJoerg Roedel2-8/+30
This patch adds a reference count to each device to count how often the device was bound to that domain. This is important for single devices that act as an alias for a number of others. These devices must stay bound to their domains until all devices that alias to it are unbound from the same domain. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Use dev->arch->iommu to store iommu related informationJoerg Roedel3-24/+95
This patch changes IOMMU code to use dev->archdata->iommu to store information about the alias device and the domain the device is attached to. This allows the driver to get rid of the amd_iommu_pd_table in the future. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Remove support for domain sharingJoerg Roedel3-28/+2
This patch makes device isolation mandatory and removes support for the amd_iommu=share option. This simplifies the code in several places. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Rearrange dma_ops related functionsJoerg Roedel1-47/+42
This patch rearranges two dma_ops related functions so that their forward declarations are not longer necessary. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Move some pte allocation functions in the right sectionJoerg Roedel1-99/+94
This patch moves alloc_pte() and fetch_pte() into the page table handling code section so that the forward declarations for them could be removed. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Remove iommu parameter from dma_ops_domain_allocJoerg Roedel1-8/+4
This function doesn't use the parameter anymore so it can be removed. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Use get_device_id and check_device where appropriateJoerg Roedel1-61/+49
The logic of these two functions is reimplemented (at least in parts) in places in the code. This patch removes these code duplications and uses the functions instead. As a side effect it moves check_device() to the helper function code section. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Move find_protection_domain to helper functionsJoerg Roedel1-29/+28
This is a helper function and when its placed in the helper function section we can remove its forward declaration. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Simplify get_device_resources()Joerg Roedel1-50/+36
With the previous changes the get_device_resources function can be simplified even more. The only important information for the callers is the protection domain. This patch renames the function to get_domain() and let it only return the protection domain for a device. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Let domain_for_device handle aliasesJoerg Roedel1-92/+135
If there is no domain associated to a device yet and the device has an alias device which already has a domain, the original device needs to have the same domain as the alias device. This patch changes domain_for_device to handle this situation and directly assigns the alias device domain to the device in this situation. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Remove iommu specific handling from dma_ops pathJoerg Roedel1-17/+11
This patch finishes the removal of all iommu specific handling code in the dma_ops path. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Remove iommu parameter from __(un)map_singleJoerg Roedel1-10/+8
With the prior changes this parameter is not longer required. This patch removes it from the function and all callers. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Make alloc_new_range aware of multiple IOMMUsJoerg Roedel1-12/+15
Since the assumption that an dma_ops domain is only bound to one IOMMU was given up we need to make alloc_new_range aware of it. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Remove iommu parameter from dma_ops_domain_(un)mapJoerg Roedel1-7/+5
The parameter is unused in these function so remove it from the parameter list. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Use check_device in get_device_resourcesJoerg Roedel1-58/+28
Every call-place of get_device_resources calls check_device before it. So call it from get_device_resources directly and simplify the code. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Use check_device for amd_iommu_dma_supportedJoerg Roedel1-16/+19
The check_device logic needs to include the dma_supported checks to be really sure. Merge the dma_supported logic into check_device and use it to implement dma_supported. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Make np-cache a global flagJoerg Roedel3-7/+10
The non-present cache flag was IOMMU local until now which doesn't make sense. Make this a global flag so we can remove the lase user of 'struct iommu' in the map/unmap path. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Reimplement flush_all_domains_on_iommu()Joerg Roedel1-19/+24
This patch reimplements the function flush_all_domains_on_iommu to use the global protection domain list. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Reimplement amd_iommu_flush_all_domains()Joerg Roedel1-3/+5
This patch reimplementes the amd_iommu_flush_all_domains function to use the global protection domain list instead of flushing every domain on every IOMMU. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Implement protection domain listJoerg Roedel3-0/+48
This patch adds code to keep a global list of all protection domains. This allows to simplify the resume code. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Remove iommu_flush_domain functionJoerg Roedel1-16/+2
This iommu_flush_tlb_pde function does essentially the same. So the iommu_flush_domain function is redundant and can be removed. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Use __iommu_flush_pages for tlb flushesJoerg Roedel1-15/+7
This patch re-implements iommu_flush_tlb functions to use the __iommu_flush_pages logic. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Make iommu_flush_pages aware of multiple IOMMUsJoerg Roedel1-7/+24
This patch extends the iommu_flush_pages function to flush the TLB entries on all IOMMUs the domain has devices on. This basically gives up the former assumption that dma_ops domains are only bound to one IOMMU in the system. For dma_ops domains this is still true but not for IOMMU-API managed domains. Giving this assumption up for dma_ops domains too allows code simplification. Further it splits out the main logic into a generic function which can be used by iommu_flush_tlb too. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Add function to complete a tlb flushJoerg Roedel1-6/+22
This patch adds a function to the AMD IOMMU driver which completes all queued commands an all IOMMUs a specific domain has devices attached on. This is required in a later patch when per-domain flushing is implemented. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Add per IOMMU reference countingJoerg Roedel2-3/+11
This patch adds reference counting for protection domains per IOMMU. This allows a smarter TLB flushing strategy. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Add an index field to struct amd_iommuJoerg Roedel2-0/+32
This patch adds an index field to struct amd_iommu which can be used to lookup it up in an array. This index will be used in struct protection_domain to keep track which protection domain has devices behind which IOMMU. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Update copyright headersJoerg Roedel4-4/+4
This patch updates the copyright headers in the relevant AMD IOMMU driver files to match the date of the latest changes. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27x86/amd-iommu: Separate internal interface definitionsJoerg Roedel5-11/+44
This patch moves all function declarations which are only used inside the driver code to a seperate header file. Signed-off-by: Joerg Roedel <[email protected]>
2009-11-27hw-breakpoints: Use struct perf_event_attr to define user breakpointsFrederic Weisbecker1-33/+41
In-kernel user breakpoints are created using functions in which we pass breakpoint parameters as individual variables: address, length and type. Although it fits well for x86, this just does not scale across archictectures that may support this api later as these may have more or different needs. Pass in a perf_event_attr structure instead because it is meant to evolve as much as possible into a generic hardware breakpoint parameter structure. Reported-by: K.Prasad <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2009-11-26x86: SGI UV: Map low MMR rangesJack Steiner1-0/+8
Explicitly mmap the UV chipset MMR address ranges used to access blade-local registers. Although these same MMRs are also mmaped at higher addresses, the low range is more convenient when accessing blade-local registers. The low range addresses always alias to the local blade regardless of the blade id. Signed-off-by: Jack Steiner <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2009-11-26x86, 64-bit: Set data segments to null after switching to 64-bit modeBrian Gerst1-2/+2
This prevents kernel threads from inheriting non-null segment selectors, and causing optimizations in __switch_to() to be ineffective. Signed-off-by: Brian Gerst <[email protected]> Cc: Tim Blechmann <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Jeremy Fitzhardinge <[email protected]> Cc: Jan Beulich <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2009-11-26x86: Clean up the loadsegment() macroIngo Molnar1-13/+15
Make it readable in the source too, not just in the assembly output. No change in functionality. Cc: Brian Gerst <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2009-11-26x86: Optimize loadsegment()Brian Gerst1-7/+8
Zero the input register in the exception handler instead of using an extra register to pass in a zero value. Signed-off-by: Brian Gerst <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2009-11-26x86, mce: Add __cpuinit to hotplug callback functionsHidetoshi Seto1-2/+3
The mce_disable_cpu() and mce_reenable_cpu() are called only from mce_cpu_callback() which is marked as __cpuinit. So these functions can be __cpuinit too. Signed-off-by: Hidetoshi Seto <[email protected]> Cc: Andi Kleen <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2009-11-26x86: Limit number of per cpu TSC sync messagesMike Travis1-6/+7
Limit the number of per cpu TSC sync messages by only printing to the console if an error occurs, otherwise print as a DEBUG message. The info message "Skipping synchronization ..." is only printed after the last cpu has booted. Signed-off-by: Mike Travis <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Roland Dreier <[email protected]> Cc: Randy Dunlap <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Yinghai Lu <[email protected]> Cc: David Rientjes <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Rusty Russell <[email protected]> Cc: Hidetoshi Seto <[email protected]> Cc: Jack Steiner <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2009-11-26x86/hw-breakpoints: Don't lose GE flag while disabling a breakpointFrederic Weisbecker1-8/+14
When we schedule out a breakpoint from the cpu, we also incidentally remove the "Global exact breakpoint" flag from the breakpoint control register. It makes us losing the fine grained precision about the origin of the instructions that may trigger breakpoint exceptions for the other breakpoints running in this cpu. Reported-by: Prasad <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2009-11-26hw-breakpoints: Simplify error handling in breakpoint creation requestsFrederic Weisbecker1-7/+1
This simplifies the error handling when we create a breakpoint. We don't need to check the NULL return value corner case anymore since we have improved perf_event_create_kernel_counter() to always return an error code in the failure case. Signed-off-by: Frederic Weisbecker <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Prasad <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2009-11-26x86: dumpstack, 64-bit: Disable preemption when walking the IRQ/exception stacksIngo Molnar1-8/+13
This warning: [ 847.140022] rb_producer D 0000000000000000 5928 519 2 0x00000000 [ 847.203627] BUG: using smp_processor_id() in preemptible [00000000] code: khungtaskd/517 [ 847.207360] caller is show_stack_log_lvl+0x2e/0x241 [ 847.210364] Pid: 517, comm: khungtaskd Not tainted 2.6.32-rc8-tip+ #13761 [ 847.213395] Call Trace: [ 847.215847] [<ffffffff81413bde>] debug_smp_processor_id+0x1f0/0x20a [ 847.216809] [<ffffffff81015eae>] show_stack_log_lvl+0x2e/0x241 [ 847.220027] [<ffffffff81018512>] show_stack+0x1c/0x1e [ 847.223365] [<ffffffff8107b7db>] sched_show_task+0xe4/0xe9 [ 847.226694] [<ffffffff8112f21f>] check_hung_task+0x140/0x199 [ 847.230261] [<ffffffff8112f4a8>] check_hung_uninterruptible_tasks+0x1b7/0x20f [ 847.233371] [<ffffffff8112f500>] ? watchdog+0x0/0x50 [ 847.236683] [<ffffffff8112f54e>] watchdog+0x4e/0x50 [ 847.240034] [<ffffffff810cee56>] kthread+0x97/0x9f [ 847.243372] [<ffffffff81012aea>] child_rip+0xa/0x20 [ 847.246690] [<ffffffff81e43494>] ? restore_args+0x0/0x30 [ 847.250019] [<ffffffff81e43083>] ? _spin_lock+0xe/0x10 [ 847.253351] [<ffffffff810cedbf>] ? kthread+0x0/0x9f [ 847.256833] [<ffffffff81012ae0>] ? child_rip+0x0/0x20 Happens because on preempt-RCU, khungd calls show_stack() with preemption enabled. Make sure we are not preemptible while walking the IRQ and exception stacks on 64-bit. (32-bit stack dumping is preemption safe.) Signed-off-by: Ingo Molnar <[email protected]>
2009-11-26x86: dumpstack: Clean up the x86_stack_ids[][] initalization and other detailsIngo Molnar2-17/+17
Make the initialization more readable, plus tidy up a few small visual details as well. No change in functionality. LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <[email protected]>