aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/skas/process_kern.c
diff options
context:
space:
mode:
authorBodo Stroesser <bstroesser@fujitsu-siemens.com>2006-01-18 20:42:39 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-18 22:20:18 -0500
commit12919aa6e015dd85170fc3b1a3e10a5dfd116c72 (patch)
tree07072818e5155f55f7c9867d216725f1261ec009 /arch/um/kernel/skas/process_kern.c
parentea1eae75eb596e0628dc5e01d32c78b1f6b257fb (diff)
[PATCH] uml: move LDT creation
s390 doesn't have a LDT. So MM_COPY_SEGMENTS will not be supported on s390. The only user of MM_COPY_SEGMENTS is new_mm(), but that's no longer useful, as arch/sys-i386/ldt.c defines init_new_ldt(), which is called immediately after new_mm(). So we should copy host's LDT in init_new_ldt(), if /proc/mm is available, to have this subarch specific call in subarch code. Signed-off-by: Bodo Stroesser <bstroesser@fujitsu-siemens.com> Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/kernel/skas/process_kern.c')
-rw-r--r--arch/um/kernel/skas/process_kern.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/arch/um/kernel/skas/process_kern.c b/arch/um/kernel/skas/process_kern.c
index dc41c6dc2f34..fcddee76c7c0 100644
--- a/arch/um/kernel/skas/process_kern.c
+++ b/arch/um/kernel/skas/process_kern.c
@@ -20,7 +20,6 @@
20#include "tlb.h" 20#include "tlb.h"
21#include "kern.h" 21#include "kern.h"
22#include "mode.h" 22#include "mode.h"
23#include "proc_mm.h"
24#include "registers.h" 23#include "registers.h"
25 24
26void switch_to_skas(void *prev, void *next) 25void switch_to_skas(void *prev, void *next)
@@ -125,25 +124,14 @@ int copy_thread_skas(int nr, unsigned long clone_flags, unsigned long sp,
125 124
126extern void map_stub_pages(int fd, unsigned long code, 125extern void map_stub_pages(int fd, unsigned long code,
127 unsigned long data, unsigned long stack); 126 unsigned long data, unsigned long stack);
128int new_mm(int from, unsigned long stack) 127int new_mm(unsigned long stack)
129{ 128{
130 struct proc_mm_op copy; 129 int fd;
131 int n, fd;
132 130
133 fd = os_open_file("/proc/mm", of_cloexec(of_write(OPENFLAGS())), 0); 131 fd = os_open_file("/proc/mm", of_cloexec(of_write(OPENFLAGS())), 0);
134 if(fd < 0) 132 if(fd < 0)
135 return(fd); 133 return(fd);
136 134
137 if(from != -1){
138 copy = ((struct proc_mm_op) { .op = MM_COPY_SEGMENTS,
139 .u =
140 { .copy_segments = from } } );
141 n = os_write_file(fd, &copy, sizeof(copy));
142 if(n != sizeof(copy))
143 printk("new_mm : /proc/mm copy_segments failed, "
144 "err = %d\n", -n);
145 }
146
147 if(skas_needs_stub) 135 if(skas_needs_stub)
148 map_stub_pages(fd, CONFIG_STUB_CODE, CONFIG_STUB_DATA, stack); 136 map_stub_pages(fd, CONFIG_STUB_CODE, CONFIG_STUB_DATA, stack);
149 137