aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/skas/tlb.c
diff options
context:
space:
mode:
authorBodo Stroesser <bstroesser@fujitsu-siemens.com>2005-09-03 18:57:50 -0400
committerLinus Torvalds <torvalds@evo.osdl.org>2005-09-05 03:06:24 -0400
commit07bf731e4b95d7c9ea9dbacd1fc4a041120dfffb (patch)
tree25ae7f2000421d45e484abac0b7252809476c0d0 /arch/um/kernel/skas/tlb.c
parent8b51304ed3184826fb262c1e9d3e58b0b00fd083 (diff)
[PATCH] uml: skas0 stubs now check system call return values
Change syscall-stub's data to include a "expected retval". Stub now checks syscalls retval and aborts execution of syscall list, if retval != expected retval. run_syscall_stub prints the data of the failed syscall, using the data pointer and retval written by the stub to the beginning of the stack. one_syscall_stub is removed, to simplify code, because only some instructions are saved by one_syscall_stub, no host-syscall. Using the stub with additional data (modify_ldt via stub) is prepared also. Signed-off-by: Bodo Stroesser <bstroesser@fujitsu-siemens.com> Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/kernel/skas/tlb.c')
-rw-r--r--arch/um/kernel/skas/tlb.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/arch/um/kernel/skas/tlb.c b/arch/um/kernel/skas/tlb.c
index 4b5fd2049547..6e84963dfc29 100644
--- a/arch/um/kernel/skas/tlb.c
+++ b/arch/um/kernel/skas/tlb.c
@@ -18,30 +18,31 @@
18#include "os.h" 18#include "os.h"
19#include "tlb.h" 19#include "tlb.h"
20 20
21static void *do_ops(union mm_context *mmu, struct host_vm_op *ops, int last, 21static int do_ops(union mm_context *mmu, struct host_vm_op *ops, int last,
22 int finished, void *flush) 22 int finished, void **flush)
23{ 23{
24 struct host_vm_op *op; 24 struct host_vm_op *op;
25 int i; 25 int i, ret = 0;
26 26
27 for(i = 0; i <= last; i++){ 27 for(i = 0; i <= last && !ret; i++){
28 op = &ops[i]; 28 op = &ops[i];
29 switch(op->type){ 29 switch(op->type){
30 case MMAP: 30 case MMAP:
31 flush = map(&mmu->skas.id, op->u.mmap.addr, 31 ret = map(&mmu->skas.id, op->u.mmap.addr,
32 op->u.mmap.len, op->u.mmap.r, op->u.mmap.w, 32 op->u.mmap.len, op->u.mmap.r, op->u.mmap.w,
33 op->u.mmap.x, op->u.mmap.fd, 33 op->u.mmap.x, op->u.mmap.fd,
34 op->u.mmap.offset, finished, flush); 34 op->u.mmap.offset, finished, flush);
35 break; 35 break;
36 case MUNMAP: 36 case MUNMAP:
37 flush = unmap(&mmu->skas.id, (void *) op->u.munmap.addr, 37 ret = unmap(&mmu->skas.id,
38 op->u.munmap.len, finished, flush); 38 (void *) op->u.munmap.addr,
39 op->u.munmap.len, finished, flush);
39 break; 40 break;
40 case MPROTECT: 41 case MPROTECT:
41 flush = protect(&mmu->skas.id, op->u.mprotect.addr, 42 ret = protect(&mmu->skas.id, op->u.mprotect.addr,
42 op->u.mprotect.len, op->u.mprotect.r, 43 op->u.mprotect.len, op->u.mprotect.r,
43 op->u.mprotect.w, op->u.mprotect.x, 44 op->u.mprotect.w, op->u.mprotect.x,
44 finished, flush); 45 finished, flush);
45 break; 46 break;
46 default: 47 default:
47 printk("Unknown op type %d in do_ops\n", op->type); 48 printk("Unknown op type %d in do_ops\n", op->type);
@@ -49,7 +50,7 @@ static void *do_ops(union mm_context *mmu, struct host_vm_op *ops, int last,
49 } 50 }
50 } 51 }
51 52
52 return flush; 53 return ret;
53} 54}
54 55
55extern int proc_mm; 56extern int proc_mm;