History log of /drivers/misc/sgi-gru/grukservices.c
Revision Date Author Comments
7a32129a42cf167550008b363a017234d0b73f2a 10-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com> drivers/misc: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required.

We will need this to avoid build failures pending a future implicit
module.h presence cleanup.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
25985edcedea6396277003854657b5f3cb31a628 31-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi> Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
76148df19cbd5437dc5358408a58c7cc6366ecf4 16-Dec-2009 Jack Steiner <steiner@sgi.com> gru: send cross partition interrupts using the gru

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>
0cd2b0813aac660f5f7a6574083157a70c152dd5 16-Dec-2009 Jack Steiner <steiner@sgi.com> gru: fix bug in allocation of kernel contexts

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>
1848a710287b33a92c3c5b2f4c3ae201a879eb7e 16-Dec-2009 Jack Steiner <steiner@sgi.com> gru: fix bug in exception handling

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>
c550222f64265c9384c45d7f691445386025a82b 16-Dec-2009 Jack Steiner <steiner@sgi.com> gru: preload tlb for bcopy instructions

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>
563447d7eb04c9b382f90a132be126a21a635647 16-Dec-2009 Jack Steiner <steiner@sgi.com> gru: add additional GRU statistics

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>
67bf04a5c2574e9495f660f418f6df776821d578 16-Dec-2009 Jack Steiner <steiner@sgi.com> gru: fix prefetch and speculation bugs

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>
33f3648342dc40f8bd6383a5a1a91c22e06f6b77 16-Dec-2009 Jack Steiner <steiner@sgi.com> gru: add test for gru_copy_gpa

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>
55484c45dbeca2eec7642932ec3f60f8a2d4bdbf 16-Dec-2009 Jack Steiner <steiner@sgi.com> gru: allow users to specify gru chiplet 2

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>
091f1a10614db89a108cda980425799730d73d8a 16-Dec-2009 Jack Steiner <steiner@sgi.com> gru: add comments raised in previous code reviews

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>
289750d1f1fd4a715baa2a2c6dd0cec2b8317fd7 16-Dec-2009 Robin Holt <holt@sgi.com> X86: uv: implement a gru_read_gpa kernel function

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>
9e5f1138d76e45b0ce56314ba0587e5942b55dcc 24-Sep-2009 Roel Kluin <roel.kluin@gmail.com> gru: allocation may fail in quicktest1()

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>
405f55712dfe464b3240d7816cc4fe4174831be2 11-Jul-2009 Alexey Dobriyan <adobriyan@gmail.com> headers: smp_lock.h redux

* 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>
d6e2fbce0d70c2072a1c478dbd37b34d27129d74 18-Jun-2009 Jack Steiner <steiner@sgi.com> gru: fix automatic retry of gru instruction failures

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>
d5826dd6002f23940458860701ce22fba9df2614 18-Jun-2009 Jack Steiner <steiner@sgi.com> gru: add user request to explicitly unload a gru context

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>
1a2c09e3b41e334b6651d53b39cfe8ceefbc45f8 18-Jun-2009 Jack Steiner <steiner@sgi.com> gru: fix cache coherency issues with instruction retry

Fix two problems related to GRU instruction failures. Cache coherency is
not maintained for CBEs except when loading or unloading contexts. When
reading a CBE to extract error information, the CBE must first be flushed
from the cache.

The function that reads kerrnel CBEs was reading the wrong CBE.

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>
270952a907220c0331fdaecbb55df892921c5e2d 18-Jun-2009 Jack Steiner <steiner@sgi.com> gru: update to rev 0.9 of gru spec

Update GRU driver to the latest version of the GRU spec. This consists
of minor updates:
- changes & additions to error status bits
- new restriction on handling of TLB misses while in FMM mode
- new field (not used by software) in TFH

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>
eb5bd5e52a8eafb1ddb42f983d41f97552afa106 18-Jun-2009 Jack Steiner <steiner@sgi.com> gru: update gru kernel self tests

Change the kernel self tests that can be optionally executed on GRU
initialization. This is primarily for testing.

Eliminate the BUG statements on failure and return bad status. Add ioctl
interface to execute the tests on demand.

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>
9120dec47f150636d85b3dba03318ccecd181c79 18-Jun-2009 Jack Steiner <steiner@sgi.com> gru: support for asynchronous gru instructions

Add support for asynchronous GRU instructions. Currently, asynchronous
instructions are supported only for GRU instructions issued by the kernel.

[akpm@linux-foundation.org: build fix]
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>
17b49a67a6a59f0e9f3c22e67ddb602410e8e182 18-Jun-2009 Jack Steiner <steiner@sgi.com> gru: fix handling of mesq failures

Fix endcase in handling GRU message queue failures due to NACKs of PUT
requests. Must ensure that the "present" bits are cleared before
resending the message.

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>
836ce679c0b5b5040164171afc33753396864b30 18-Jun-2009 Jack Steiner <steiner@sgi.com> gru: change resource assignment for kernel threads

Change the way GRU resources are assigned for kernel threads. GRU
contexts for kernel threads are now allocated on demand and can be stolen
by user processes when idle. This allows MPI jobs to use ALL of the GRU
resources when the kernel is not using them.

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>
6e9100741ca430eeef8022794f8b62a23a5916af 18-Jun-2009 Jack Steiner <steiner@sgi.com> gru: support cch_allocate for kernel threads

Change the interface to cch_allocate so that it can be used to allocate
GRU contexts for kernel threads. Kernel threads use the GRU in unmapped
mode and do not require ASIDs for the GRU TLB.

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>
7b8274e93fbabc7534aa51f95551c30aecdd0066 03-Apr-2009 Jack Steiner <steiner@sgi.com> sgi-gru: support multiple pagesizes in GRU

Add multiple pagesize support to 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>
27ca8a7b2bdfb3e22e67fbd5df58e6b6f0bbcd48 03-Apr-2009 Jack Steiner <steiner@sgi.com> sgi-gru: fix bugs related to module unload of the GRU driver

Fix bugs related to module unload 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>
6f2584f47474d29ce829604bfc8b56c10b352fdb 03-Apr-2009 Jack Steiner <steiner@sgi.com> sgi-gru: add support to the GRU driver for message queue interrupts

Add support to the GRU driver for message queue interrupts.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
438846043af39fef286f68b197d42bd75f49898e 03-Apr-2009 Jack Steiner <steiner@sgi.com> sgi-gru: improvements to GRU debug messages & statistics

Improvements to GRU debug messages & 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>
fe5bb6b00c3a9374841d651e01694fe4190a677e 03-Apr-2009 Jack Steiner <steiner@sgi.com> sgi-gru: misc GRU cleanup

Misc trivial GRU drivers fixes:
- fix long lines
- eliminate extra whitespace
- eliminate compiler warning
- better validation of invalidate user parameters
- bug fix for GRU TLB flush (not the cpu TLB flush)

These changes are all internal to the SGI GRU driver and have no effect
on the base kernel.

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>
923f7f6970bd448b8e88b9e4be10fd01fc7106a4 16-Oct-2008 Jack Steiner <steiner@sgi.com> GRU driver: minor updates

A few minor updates for the GRU driver.
- documentation changes found in code reviews
- changes to #ifdefs to make them recognized by "unifdef"
(used in simulator testing)
- change GRU context load/unload to prefetch data

[akpm@linux-foundation.org: fix typo in comment]
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>
cbf330b94e9c888e9d2b99523037f9be5c4ba795 16-Oct-2008 Julia Lawall <julia@diku.dk> drivers/misc: Use DIV_ROUND_UP

The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /
(d)) but is perhaps more readable.

An extract of the semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@haskernel@
@@

#include <linux/kernel.h>

@depends on haskernel@
expression n,d;
@@

(
- (n + d - 1) / d
+ DIV_ROUND_UP(n,d)
|
- (n + (d - 1)) / d
+ DIV_ROUND_UP(n,d)
)

@depends on haskernel@
expression n,d;
@@

- DIV_ROUND_UP((n),d)
+ DIV_ROUND_UP(n,d)

@depends on haskernel@
expression n,d;
@@

- DIV_ROUND_UP(n,(d))
+ DIV_ROUND_UP(n,d)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9ca8e40c130c906c1060d105e63628410c860261 30-Jul-2008 Jack Steiner <steiner@sgi.com> GRU Driver V3: fixes to resolve code review comments

Fixes problems identified in a code review:
- add comment with high level dscription of the GRU
- prepend "gru_" to all global names
- delete unused function
- couple of trivial bug fixes

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jack Steiner <steiner@sgi.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
28bffaf094a6d0992c85e1b01f04c9b0f56c9d62 30-Jul-2008 Jack Steiner <steiner@sgi.com> GRU Driver: kernel services provide by driver

This file contains functions for handling services provided to other
kernel modules that use the GRU.

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>