aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2013-05-02 17:16:38 -0400
committerHelge Deller <deller@gmx.de>2013-05-06 17:09:10 -0400
commitdde397981cc14c2ee0c33d395691e63b1ee40fe5 (patch)
tree117aa01b5533a196709b2a90eac1931014e6bb66 /arch/parisc
parent6a45716abbf9dc0f397946306db1f78b2eba3086 (diff)
parisc: document the parisc gateway page
Include some documentation about how the parisc gateway page technically works and how it is used from userspace. James Bottomley is the original author of this description and it was copied here out of an email thread from Apr 12 2013 titled: man2 : syscall.2 : document syscall calling conventions CC: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/kernel/syscall.S25
1 files changed, 24 insertions, 1 deletions
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
index b27f4aabe898..e767ab733e32 100644
--- a/arch/parisc/kernel/syscall.S
+++ b/arch/parisc/kernel/syscall.S
@@ -1,12 +1,35 @@
1/* 1/*
2 * Linux/PA-RISC Project (http://www.parisc-linux.org/) 2 * Linux/PA-RISC Project (http://www.parisc-linux.org/)
3 * 3 *
4 * System call entry code Copyright (c) Matthew Wilcox 1999 <willy@bofh.ai> 4 * System call entry code / Linux gateway page
5 * Copyright (c) Matthew Wilcox 1999 <willy@bofh.ai>
5 * Licensed under the GNU GPL. 6 * Licensed under the GNU GPL.
6 * thanks to Philipp Rumpf, Mike Shaver and various others 7 * thanks to Philipp Rumpf, Mike Shaver and various others
7 * sorry about the wall, puffin.. 8 * sorry about the wall, puffin..
8 */ 9 */
9 10
11/*
12How does the Linux gateway page on PA-RISC work?
13------------------------------------------------
14The Linux gateway page on PA-RISC is "special".
15It actually has PAGE_GATEWAY bits set (this is linux terminology; in parisc
16terminology it's Execute, promote to PL0) in the page map. So anything
17executing on this page executes with kernel level privilege (there's more to it
18than that: to have this happen, you also have to use a branch with a ,gate
19completer to activate the privilege promotion). The upshot is that everything
20that runs on the gateway page runs at kernel privilege but with the current
21user process address space (although you have access to kernel space via %sr2).
22For the 0x100 syscall entry, we redo the space registers to point to the kernel
23address space (preserving the user address space in %sr3), move to wide mode if
24required, save the user registers and branch into the kernel syscall entry
25point. For all the other functions, we execute at kernel privilege but don't
26flip address spaces. The basic upshot of this is that these code snippets are
27executed atomically (because the kernel can't be pre-empted) and they may
28perform architecturally forbidden (to PL3) operations (like setting control
29registers).
30*/
31
32
10#include <asm/asm-offsets.h> 33#include <asm/asm-offsets.h>
11#include <asm/unistd.h> 34#include <asm/unistd.h>
12#include <asm/errno.h> 35#include <asm/errno.h>