aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-gru (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-03-12sgi-gru: use for_each_set_bit()Akinobu Mita1-11/+4
Replace open-coded loop with for_each_set_bit(). Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: send cross partition interrupts using the gruJack Steiner2-15/+36
GRU Message queue instructions are used to deliver messages to other SSIs within the numalink domain. In most cases, a single GRU mesq instruction will deliver both the message AND an interrupt to notify the other SSI that a messsage is present. In some cases, however, the interrupt must be sent explicitly. To improve resilency, the GRU driver should send these explicit interrupts using the GRU to write the remote chipset register. Current code sends the interrupt using a cpu instruction to write the chipset register. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: update driver version numberJack Steiner1-1/+1
Update the version number of the GRU driver. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: improve GRU TLB dropin statisticsJack Steiner4-14/+17
Update the TLB dropin statistics kept for each GRU context. Count TLB dropins separate from the misses - some misses do not result in a TLB dropin. Some of the diagnostics need both counts. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: fix GRU interrupt race at deallocateJack Steiner3-7/+19
Fix a race where an interrupt could be received for a GRU context that has been deallocated. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: add hugepage supportJack Steiner1-3/+4
Add support for hugepages. Easier than I originally thought. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: fix bug in allocation of kernel contextsJack Steiner1-3/+11
Fix a bug in the assignment of GRU contexts used for kernel functions. If a sleep occurs on the wait for a semaphore, the thread could switch cpus and allocate resources on the wrong blade. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: update GRU structures to match latest hardware specJack Steiner2-1/+15
Add a few new definitions for chipset MMR field names. This matches rev 0.7 of the hardware spec. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: check for correct GRU chiplet assignmentJack Steiner1-14/+30
Simplify the code that checks for correct assignment of GRU contexts to users. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: remove stray local_irq_enableJack Steiner1-1/+0
Remove a stray local_irq_enable() in the GRU TLB dropin code. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: add symbolic names for GRU error codeJack Steiner1-5/+11
Use symbol names instead of numbers for error return values for the vtop functions. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: fix bug in exception handlingJack Steiner1-8/+22
Fix a GRU driver bug converting a CBR address to the context that contains the CBR. The conversion is rarely done so performance does not matter. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: preload tlb for bcopy instructionsJack Steiner9-16/+129
Add anticipatory TLB dropins for GRU TLB misses that occur on BCOPY instructions that copy large amounts of data. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: expicitly set instruction status to activeJack Steiner2-56/+67
Explicitly set GRU instructions to "ACTIVE". This eliminates the need for barriers that would have been necessary to prevent reading the instruction "status" field before the GRU had actually started the instruction. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: add additional GRU statisticsJack Steiner8-48/+77
Add additional GRU statistics & debug messages. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: update irq infrastructureJack Steiner4-70/+260
Update the GRU irq allocate/free functions to use the latest upstream infrastructure. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: fix prefetch and speculation bugsJack Steiner5-6/+38
Fix several bugs related to prefetch, ordering & speculation: - GRU cch_allocate() instruction causes cacheable memory to be created. Add a barriers to prevent speculation from prefetching data before it exists. - Add memory barriers before cache-flush instructions to ensure that previously stored data is included in the line flushed to memory. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: check for valid vmaJack Steiner1-9/+12
Fix bug caused by failure to allocate a GRU gts structure. The old code failed to handle the case where the vma was invalid. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: add test for gru_copy_gpaJack Steiner1-9/+39
Improve existing driver self-tests. Add a new debugging test to the SGI GRU driver for verifying the global GRU copy function. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: add debug option for cache flushingJack Steiner2-5/+10
Add a debug option to the SGI GRU driver for flushing GRU cache lines from memory. In theory this is not needed but it is useful for debugging. This has no use by end users. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: handle failures to mmu_notifier_registerJack Steiner3-11/+21
Under some conditions, mmu_notifier_register() will fail to register a mmu_notifier. Fix the GRU driver to correctly handle these failures. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: support 64-bit GRU addressesJack Steiner1-6/+0
Increase the maximum address supported by the SGI GRU driver to a full 64 bits. Note that GRU addresses are not always the same as socket virtual addresses. Sockets may not necessarily support the full 64 bits. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: improve messages for malfunctioning GRUsJack Steiner2-3/+25
Improve error messages for malfunctioning GRUs. Identify the type of instruction that is failing. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: fix bug in module unloadJack Steiner1-1/+1
Fix bug in module unload. Previous code was not correctly deleting the files in /proc. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: allow users to specify gru chiplet 3Jack Steiner3-29/+13
This patch builds on the infrastructure introduced in the patches that allow user specification of GRU blades & chiplets for context allocation. This patch simplifies the algorithms for migrating GRU contexts between blades. No new functionality is introduced. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: allow users to specify gru chiplet 2Jack Steiner6-80/+109
Add support to the GRU driver to allow users to specify the blade & chiplet for allocation of GRU contexts. Add new statistics for context loading/unloading/retargeting. Also deleted a few GRU stats that were no longer being unused. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: allow users to specify gru chiplet 1Jack Steiner4-2/+17
Add table & user request infrastructure that is needed to allow users to specify the blade and chiplet for allocation of GRU contexts. Use of this information is in a subsequent patch. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: handle blades without memoryJack Steiner1-2/+2
Do not use alloc_pages_exact_node() to allocate GRU tables. If a blade has no local memory, nid will be -1. Use alloc_pages_node() instead. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: fix istatus race in GRU tlb dropinJack Steiner1-29/+20
TLB dropins require updates to the CBR instruction istatus field. This is needed to resolve race conditions in the chip. The code currently uses the user address of the CBR. This works but opens up additional endcases related to stealing of contexts and accessing the CBR from tasks that do not have access to the user address space. (Some of this non-user task access is debug code that is not currently being pushed to the community). User CBRs are also directly accessible using the kernel mapping of the CBR. Change the TLB dropin code to use the the kernel mapping of the CBR. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: add comments raised in previous code reviewsJack Steiner2-1/+8
Add comments from previous code reviews. The comments help explain some of the more esoteric aspects of the driver. Move a free() to the other side of an unlock. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16gru: initial GRU based on blade topologyJack Steiner1-7/+5
Change the GRU initialization code to initialize based on blade topology instead of node topology. The result is the same but blade-based initialization is cleaner. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16X86: uv: implement a gru_read_gpa kernel functionRobin Holt5-0/+52
The BIOS has decided to store a pointer to the partition reserved page in a scratch MMR. The GRU is only able to read an MMR using a vload instruction. The gru_read_gpa() function will implemented. Signed-off-by: Robin Holt <holt@sgi.com> Signed-off-by: Jack Steiner <steiner@sgi.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-04tree-wide: fix assorted typos all over the placeAndré Goddard Rosa1-1/+1
That is "success", "unknown", "through", "performance", "[re|un]mapping" , "access", "default", "reasonable", "[con]currently", "temperature" , "channel", "[un]used", "application", "example","hierarchy", "therefore" , "[over|under]flow", "contiguous", "threshold", "enough" and others. Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-11-05sgi-gru: decrapfiy options_write() functionLinus Torvalds1-6/+7
Not a single line of actual code in the function was really fundamentally correct. Problems ranged from lack of proper range checking, to removing the last character written (which admittedly is usually '\n'), to not accepting hex numbers even though the 'show' routine would show the data in that format. This tries to do better. Acked-by: Michael Buesch <mb@bu3sch.de> Tested-and-acked-by: Jack Steiner <steiner@sgi.com> Cc: stable@kernel.org Cc: Jiri Kosina <jkosina@suse.cz> Cc: Michael Gilbert <michael.s.gilbert@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01const: constify remaining file_operationsAlexey Dobriyan1-2/+1
[akpm@linux-foundation.org: fix KVM] Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-27const: mark struct vm_struct_operationsAlexey Dobriyan2-2/+2
* mark struct vm_area_struct::vm_ops as const * mark vm_ops in AGP code But leave TTM code alone, something is fishy there with global vm_ops being used. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-24gru: allocation may fail in quicktest1()Roel Kluin1-0/+2
The allocation may fail. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-24gru: use proc_create()Alexey Dobriyan1-2/+1
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-12headers: smp_lock.h reduxAlexey Dobriyan2-2/+0
* Remove smp_lock.h from files which don't need it (including some headers!) * Add smp_lock.h to files which do need it * Make smp_lock.h include conditional in hardirq.h It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT This will make hardirq.h inclusion cheaper for every PREEMPT=n config (which includes allmodconfig/allyesconfig, BTW) Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-18gru: copyright fixesJack Steiner2-8/+28
Fix the copyright statements in a couple of GRU files. No functional changes are being made. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-18gru: remove references to the obsolete global status handleJack Steiner1-2/+0
Delete references to the SGI GRU GSH hardware resources. These GRU resources have been deleted from the hardware. (These resources have never benn used, anyway). Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-18gru: fixes to grudump utilityJack Steiner2-4/+8
Minor fixes to the SGI GRU grudump facility: - fix address where user data is written - add gru number to data passed to user - indicate if context is locked Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-18gru: fix potential use-after-free when purging GRU tlbsJack Steiner1-1/+3
Fix potential SGI GRU bug that could cause a use-after-free. If one thread in a task is flushing the GRU and another thread destroys the GRU context, there is the potential to access a table after it has been freed. Copy the gms pointer to a local variable before unlocking the gts table. Note that no refcnt is needed for the gms - the reference is held indirectly by the task's mm_struct. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-18gru: add user request to specify gru sliceJack Steiner4-1/+13
Add a user request to specify the gru instruction slice parameter for user contexts. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-18gru: generic infrastructure for context optionsJack Steiner5-13/+35
Change the user GRU request for specifying the "task_slice" option to use a generic infrastructure that can be expanded in the future to include additional context options. No new capabilities are added with this patch. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-18gru: cleanup gru inline functionsJack Steiner1-17/+16
Cleanup of GRU inline functions to eliminate unnecessary inline code. Update function descriptions. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-18gru: delete user request for fetching chiplet statusJack Steiner2-41/+0
Delete the user request for fetching the status of a GRU chiplet. This request has been made obsolete by other changes. Note: this is not a change to a user API - there are no compatibility issues with this change. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-18gru: collect per-context user statisticsJack Steiner5-0/+52
Collect GRU statistics for each user GRU context. Statistics are kept for TLB misses & content resource contention. Add user request for retrieving the statistics. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-18gru: fix automatic retry of gru instruction failuresJack Steiner1-3/+2
Fix bug in automatic retry of GRU instruction failures. CBR substatus (message queue failure) was being checked incorrectly. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-18gru: add user request to explicitly unload a gru contextJack Steiner3-28/+41
Add user function to explicitly unload GRU kernel contexts from the GRU. Only contexts that are not in-use will be unloaded. This function is primarily for testing. It is not expected that this will be used in normal production systems. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>