Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
0fc3a8cd
Commit
0fc3a8cd
authored
Nov 25, 2002
by
Jeff Dike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small fixes to sync up the 2.4 and 2.5 pools.
Also fixed a stupid signal handling bug.
parent
64d40969
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
132 additions
and
123 deletions
+132
-123
arch/um/drivers/chan_user.c
arch/um/drivers/chan_user.c
+1
-1
arch/um/include/user_util.h
arch/um/include/user_util.h
+0
-1
arch/um/kernel/frame_kern.c
arch/um/kernel/frame_kern.c
+5
-5
arch/um/kernel/process.c
arch/um/kernel/process.c
+7
-37
arch/um/kernel/skas/include/skas.h
arch/um/kernel/skas/include/skas.h
+1
-0
arch/um/kernel/skas/process.c
arch/um/kernel/skas/process.c
+23
-0
arch/um/kernel/skas/trap_user.c
arch/um/kernel/skas/trap_user.c
+2
-0
arch/um/kernel/syscall_user.c
arch/um/kernel/syscall_user.c
+4
-4
arch/um/kernel/trap_user.c
arch/um/kernel/trap_user.c
+4
-4
arch/um/kernel/tt/gdb.c
arch/um/kernel/tt/gdb.c
+15
-4
arch/um/kernel/tt/include/debug.h
arch/um/kernel/tt/include/debug.h
+3
-0
arch/um/kernel/tt/process_kern.c
arch/um/kernel/tt/process_kern.c
+53
-53
arch/um/kernel/tt/ptproxy/Makefile
arch/um/kernel/tt/ptproxy/Makefile
+0
-1
arch/um/kernel/tt/tlb.c
arch/um/kernel/tt/tlb.c
+6
-5
arch/um/kernel/tt/tracer.c
arch/um/kernel/tt/tracer.c
+3
-2
arch/um/main.c
arch/um/main.c
+3
-3
include/asm-um/processor-generic.h
include/asm-um/processor-generic.h
+2
-3
No files found.
arch/um/drivers/chan_user.c
View file @
0fc3a8cd
arch/um/include/user_util.h
View file @
0fc3a8cd
...
...
@@ -73,7 +73,6 @@ extern void setup_hostinfo(void);
extern
void
add_arg
(
char
*
cmd_line
,
char
*
arg
);
extern
void
init_new_thread_stack
(
void
*
sig_stack
,
void
(
*
usr1_handler
)(
int
));
extern
void
init_new_thread_signals
(
int
altstack
);
extern
void
attach_process
(
int
pid
);
extern
void
do_exec
(
int
old_pid
,
int
new_pid
);
extern
void
tracer_panic
(
char
*
msg
,
...);
extern
char
*
get_umid
(
int
only_if_set
);
...
...
arch/um/kernel/frame_kern.c
View file @
0fc3a8cd
arch/um/kernel/process.c
View file @
0fc3a8cd
...
...
@@ -39,6 +39,7 @@
#include "mode.h"
#ifdef CONFIG_MODE_SKAS
#include "skas_ptrace.h"
#include "skas.h"
#endif
void
init_new_thread_stack
(
void
*
sig_stack
,
void
(
*
usr1_handler
)(
int
))
...
...
@@ -130,12 +131,6 @@ int start_fork_tramp(void *thread_arg, unsigned long temp_stack,
return
(
arg
.
pid
);
}
void
trace_myself
(
void
)
{
if
(
ptrace
(
PTRACE_TRACEME
,
0
,
0
,
0
)
<
0
)
panic
(
"ptrace failed in trace_myself"
);
}
void
suspend_new_thread
(
int
fd
)
{
char
c
;
...
...
@@ -254,31 +249,6 @@ void forward_pending_sigio(int target)
kill
(
target
,
SIGIO
);
}
#ifdef CONFIG_MODE_SKAS
static
void
init_registers
(
int
pid
)
{
int
err
;
if
(
ptrace
(
PTRACE_GETREGS
,
pid
,
0
,
exec_regs
)
<
0
)
panic
(
"check_ptrace : PTRACE_GETREGS failed, errno = %d"
,
errno
);
err
=
ptrace
(
PTRACE_GETFPXREGS
,
pid
,
0
,
exec_fpx_regs
);
if
(
!
err
)
return
;
have_fpx_regs
=
0
;
if
(
errno
!=
EIO
)
panic
(
"check_ptrace : PTRACE_GETFPXREGS failed, errno = %d"
,
errno
);
err
=
ptrace
(
PTRACE_GETFPREGS
,
pid
,
0
,
exec_fp_regs
);
if
(
err
)
panic
(
"check_ptrace : PTRACE_GETFPREGS failed, errno = %d"
,
errno
);
}
#endif
int
can_do_skas
(
void
)
{
#ifdef CONFIG_MODE_SKAS
...
...
arch/um/kernel/skas/include/skas.h
View file @
0fc3a8cd
...
...
@@ -33,6 +33,7 @@ extern int new_mm(int from);
extern
void
save_registers
(
struct
uml_pt_regs
*
regs
);
extern
void
restore_registers
(
struct
uml_pt_regs
*
regs
);
extern
void
start_userspace
(
void
);
extern
void
init_registers
(
int
pid
);
#endif
...
...
arch/um/kernel/skas/process.c
View file @
0fc3a8cd
...
...
@@ -351,6 +351,29 @@ void kill_off_processes_skas(void)
os_kill_process
(
userspace_pid
,
1
);
}
void
init_registers
(
int
pid
)
{
int
err
;
if
(
ptrace
(
PTRACE_GETREGS
,
pid
,
0
,
exec_regs
)
<
0
)
panic
(
"check_ptrace : PTRACE_GETREGS failed, errno = %d"
,
errno
);
err
=
ptrace
(
PTRACE_GETFPXREGS
,
pid
,
0
,
exec_fpx_regs
);
if
(
!
err
)
return
;
have_fpx_regs
=
0
;
if
(
errno
!=
EIO
)
panic
(
"check_ptrace : PTRACE_GETFPXREGS failed, errno = %d"
,
errno
);
err
=
ptrace
(
PTRACE_GETFPREGS
,
pid
,
0
,
exec_fp_regs
);
if
(
err
)
panic
(
"check_ptrace : PTRACE_GETFPREGS failed, errno = %d"
,
errno
);
}
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
...
...
arch/um/kernel/skas/trap_user.c
View file @
0fc3a8cd
...
...
@@ -50,6 +50,8 @@ void user_signal(int sig, struct uml_pt_regs *regs)
regs
->
mode
.
skas
.
trap_type
=
0
;
info
=
&
sig_info
[
sig
];
(
*
info
->
handler
)(
sig
,
regs
);
unblock_signals
();
}
/*
...
...
arch/um/kernel/syscall_user.c
View file @
0fc3a8cd
arch/um/kernel/trap_user.c
View file @
0fc3a8cd
...
...
@@ -119,11 +119,11 @@ void alarm_handler(int sig, struct sigcontext sc)
switch_timers
(
1
);
}
void
do_longjmp
(
void
*
p
,
int
val
)
void
do_longjmp
(
void
*
b
,
int
val
)
{
jmp_buf
*
jbuf
=
(
jmp_buf
*
)
p
;
jmp_buf
*
buf
=
b
;
longjmp
(
*
j
buf
,
val
);
longjmp
(
*
buf
,
val
);
}
/*
...
...
arch/um/kernel/tt/gdb.c
View file @
0fc3a8cd
...
...
@@ -117,7 +117,7 @@ struct gdb_data {
static
void
config_gdb_cb
(
void
*
arg
)
{
struct
gdb_data
*
data
=
arg
;
struct
task_struct
*
task
;
void
*
task
;
int
pid
;
data
->
err
=
-
1
;
...
...
@@ -228,19 +228,19 @@ int debugger_signal(int status, pid_t pid){ return(0); }
void
child_signal
(
pid_t
pid
,
int
status
){
}
int
init_ptrace_proxy
(
int
idle_pid
,
int
startup
,
int
stop
)
{
printk
(
KERN_ERR
"debug requested when CONFIG_PT_PROXY is off
\n
"
);
printk
(
UM_
KERN_ERR
"debug requested when CONFIG_PT_PROXY is off
\n
"
);
kill_child_dead
(
idle_pid
);
exit
(
1
);
}
void
signal_usr1
(
int
sig
)
{
printk
(
KERN_ERR
"debug requested when CONFIG_PT_PROXY is off
\n
"
);
printk
(
UM_
KERN_ERR
"debug requested when CONFIG_PT_PROXY is off
\n
"
);
}
int
attach_debugger
(
int
idle_pid
,
int
pid
,
int
stop
)
{
printk
(
KERN_ERR
"attach_debugger called when CONFIG_PT_PROXY "
printk
(
UM_
KERN_ERR
"attach_debugger called when CONFIG_PT_PROXY "
"is off
\n
"
);
return
(
-
1
);
}
...
...
@@ -265,3 +265,14 @@ void debugger_parent_signal(int status, int pid)
}
#endif
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
* adjust the settings for this buffer only. This must remain at the end
* of the file.
* ---------------------------------------------------------------------------
* Local variables:
* c-file-style: "linux"
* End:
*/
arch/um/kernel/tt/include/debug.h
View file @
0fc3a8cd
...
...
@@ -3,6 +3,7 @@
* Lars Brinkhoff.
* Licensed under the GPL
*/
#ifndef __DEBUG_H
#define __DEBUG_H
...
...
@@ -11,6 +12,8 @@ extern void child_proxy(pid_t pid, int status);
extern
void
init_proxy
(
pid_t
pid
,
int
waiting
,
int
status
);
extern
int
start_debugger
(
char
*
prog
,
int
startup
,
int
stop
,
int
*
debugger_fd
);
extern
void
fake_child_exit
(
void
);
extern
int
gdb_config
(
char
*
str
);
extern
int
gdb_remove
(
char
*
unused
);
#endif
...
...
arch/um/kernel/tt/process_kern.c
View file @
0fc3a8cd
...
...
@@ -24,30 +24,11 @@
#include "init.h"
#include "tt.h"
extern
void
start_kernel
(
void
);
static
int
start_kernel_proc
(
void
*
unused
)
{
int
pid
;
block_signals
();
pid
=
os_getpid
();
cpu_tasks
[
0
].
pid
=
pid
;
cpu_tasks
[
0
].
task
=
current
;
#ifdef CONFIG_SMP
cpu_online_map
=
1
;
#endif
if
(
debug
)
os_stop_process
(
pid
);
start_kernel
();
return
(
0
);
}
void
*
switch_to_tt
(
void
*
prev
,
void
*
next
,
void
*
last
)
{
struct
task_struct
*
from
,
*
to
;
unsigned
long
flags
;
int
vtalrm
,
alrm
,
prof
,
err
,
cpu
;
int
err
,
vtalrm
,
alrm
,
prof
,
cpu
;
char
c
;
/* jailing and SMP are incompatible, so this doesn't need to be
* made per-cpu
...
...
@@ -130,18 +111,6 @@ void exit_thread_tt(void)
close
(
current
->
thread
.
mode
.
tt
.
switch_pipe
[
1
]);
}
void
reboot_tt
(
void
)
{
current
->
thread
.
request
.
op
=
OP_REBOOT
;
os_usr1_process
(
os_getpid
());
}
void
halt_tt
(
void
)
{
current
->
thread
.
request
.
op
=
OP_HALT
;
os_usr1_process
(
os_getpid
());
}
extern
void
schedule_tail
(
struct
task_struct
*
prev
);
static
void
new_thread_handler
(
int
sig
)
...
...
@@ -276,6 +245,32 @@ int copy_thread_tt(int nr, unsigned long clone_flags, unsigned long sp,
return
(
0
);
}
void
reboot_tt
(
void
)
{
current
->
thread
.
request
.
op
=
OP_REBOOT
;
os_usr1_process
(
os_getpid
());
}
void
halt_tt
(
void
)
{
current
->
thread
.
request
.
op
=
OP_HALT
;
os_usr1_process
(
os_getpid
());
}
void
kill_off_processes_tt
(
void
)
{
struct
task_struct
*
p
;
int
me
;
me
=
os_getpid
();
for_each_process
(
p
){
if
(
p
->
thread
.
mode
.
tt
.
extern_pid
!=
me
)
os_kill_process
(
p
->
thread
.
mode
.
tt
.
extern_pid
,
0
);
}
if
(
init_task
.
thread
.
mode
.
tt
.
extern_pid
!=
me
)
os_kill_process
(
init_task
.
thread
.
mode
.
tt
.
extern_pid
,
0
);
}
void
initial_thread_cb_tt
(
void
(
*
proc
)(
void
*
),
void
*
arg
)
{
if
(
os_getpid
()
==
tracing_pid
){
...
...
@@ -395,7 +390,6 @@ static void mprotect_kernel_mem(int w)
mprotect_kernel_vm
(
w
);
}
/* No SMP problems since jailing and SMP are incompatible */
void
unprotect_kernel_mem
(
void
)
{
mprotect_kernel_mem
(
1
);
...
...
@@ -406,18 +400,23 @@ void protect_kernel_mem(void)
mprotect_kernel_mem
(
0
);
}
void
kill_off_processes_tt
(
void
)
extern
void
start_kernel
(
void
);
static
int
start_kernel_proc
(
void
*
unused
)
{
struct
task_struct
*
p
;
int
me
;
int
pid
;
me
=
os_getpid
();
for_each_process
(
p
){
if
(
p
->
thread
.
mode
.
tt
.
extern_pid
!=
me
)
os_kill_process
(
p
->
thread
.
mode
.
tt
.
extern_pid
,
0
);
}
if
(
init_task
.
thread
.
mode
.
tt
.
extern_pid
!=
me
)
os_kill_process
(
init_task
.
thread
.
mode
.
tt
.
extern_pid
,
0
);
block_signals
();
pid
=
os_getpid
();
cpu_tasks
[
0
].
pid
=
pid
;
cpu_tasks
[
0
].
task
=
current
;
#ifdef CONFIG_SMP
cpu_online_map
=
1
;
#endif
if
(
debug
)
os_stop_process
(
pid
);
start_kernel
();
return
(
0
);
}
void
set_tracing
(
void
*
task
,
int
tracing
)
...
...
@@ -435,7 +434,8 @@ int set_user_mode(void *t)
struct
task_struct
*
task
;
task
=
t
?
t
:
current
;
if
(
task
->
thread
.
mode
.
tt
.
tracing
)
return
(
1
);
if
(
task
->
thread
.
mode
.
tt
.
tracing
)
return
(
1
);
task
->
thread
.
request
.
op
=
OP_TRACE_ON
;
os_usr1_process
(
os_getpid
());
return
(
0
);
...
...
@@ -451,22 +451,22 @@ void set_init_pid(int pid)
err
);
}
void
clear_singlestep
(
void
*
t
)
{
struct
task_struct
*
task
=
(
struct
task_struct
*
)
t
;
task
->
ptrace
&=
~
PT_DTRACE
;
}
int
singlestepping
(
void
*
t
)
{
struct
task_struct
*
task
=
(
struct
task_struct
*
)
t
;
struct
task_struct
*
task
=
t
;
if
(
task
->
thread
.
mode
.
tt
.
singlestep_syscall
)
return
(
0
);
return
(
task
->
ptrace
&
PT_DTRACE
);
}
void
clear_singlestep
(
void
*
t
)
{
struct
task_struct
*
task
=
t
;
task
->
ptrace
&=
~
PT_DTRACE
;
}
int
start_uml_tt
(
void
)
{
void
*
sp
;
...
...
arch/um/kernel/tt/ptproxy/Makefile
View file @
0fc3a8cd
...
...
@@ -13,4 +13,3 @@ $(USER_OBJS) : %.o: %.c
$(CC)
$
(
CFLAGS_
$(
notdir
$@
)
)
$(USER_CFLAGS)
-c
-o
$@
$<
clean
:
rm
-f
*
.o core child ptproxy
arch/um/kernel/tt/tlb.c
View file @
0fc3a8cd
...
...
@@ -84,7 +84,8 @@ static void fix_range(struct mm_struct *mm, unsigned long start_addr,
atomic_t
vmchange_seq
=
ATOMIC_INIT
(
1
);
void
flush_kernel_range
(
unsigned
long
start
,
unsigned
long
end
,
int
update_seq
)
static
void
flush_kernel_vm_range
(
unsigned
long
start
,
unsigned
long
end
,
int
update_seq
)
{
struct
mm_struct
*
mm
;
pgd_t
*
pgd
;
...
...
@@ -133,7 +134,7 @@ void flush_kernel_range(unsigned long start, unsigned long end, int update_seq)
void
flush_tlb_kernel_range
(
unsigned
long
start
,
unsigned
long
end
)
{
flush_kernel_range
(
start
,
end
,
1
);
flush_kernel_
vm_
range
(
start
,
end
,
1
);
}
static
void
protect_vm_page
(
unsigned
long
addr
,
int
w
,
int
must_succeed
)
...
...
@@ -189,7 +190,7 @@ void flush_tlb_range_tt(struct vm_area_struct *vma, unsigned long start,
* either process memory or kernel vm
*/
if
((
start
>=
start_vm
)
&&
(
start
<
end_vm
))
flush_kernel_range
(
start
,
end
,
1
);
flush_kernel_
vm_
range
(
start
,
end
,
1
);
else
fix_range
(
vma
->
vm_mm
,
start
,
end
,
0
);
}
...
...
@@ -204,13 +205,13 @@ void flush_tlb_mm_tt(struct mm_struct *mm)
seq
=
atomic_read
(
&
vmchange_seq
);
if
(
current
->
thread
.
mode
.
tt
.
vm_seq
==
seq
)
return
;
current
->
thread
.
mode
.
tt
.
vm_seq
=
seq
;
flush_kernel_range
(
start_vm
,
end_vm
,
0
);
flush_kernel_
vm_
range
(
start_vm
,
end_vm
,
0
);
}
void
force_flush_all_tt
(
void
)
{
fix_range
(
current
->
mm
,
0
,
STACK_TOP
,
1
);
flush_kernel_range
(
start_vm
,
end_vm
,
0
);
flush_kernel_
vm_
range
(
start_vm
,
end_vm
,
0
);
}
/*
...
...
arch/um/kernel/tt/tracer.c
View file @
0fc3a8cd
...
...
@@ -372,13 +372,14 @@ int tracer(int (*init_proc)(void *), void *sp)
if
(
!
tracing
&&
(
debugger_pid
!=
-
1
)
&&
(
sig
!=
0
)
&&
(
sig
!=
SIGALRM
)
&&
(
sig
!=
SIGVTALRM
)
&&
(
sig
!=
SIGSEGV
)
&&
(
sig
!=
SIGTRAP
)
&&
(
sig
!=
SIGUSR2
)
&&
(
sig
!=
SIGIO
)){
(
sig
!=
SIGUSR2
)
&&
(
sig
!=
SIGIO
)
&&
(
sig
!=
SIGFPE
)){
child_signal
(
pid
,
status
);
continue
;
}
if
(
tracing
){
if
(
singlestepping
(
task
))
if
(
singlestepping
_tt
(
task
))
cont_type
=
PTRACE_SINGLESTEP
;
else
cont_type
=
PTRACE_SYSCALL
;
}
...
...
arch/um/main.c
View file @
0fc3a8cd
include/asm-um/processor-generic.h
View file @
0fc3a8cd
...
...
@@ -40,7 +40,6 @@ struct proc_skas_mode {
#endif
struct
thread_struct
{
int
tracing
;
int
forking
;
unsigned
long
kernel_stack
;
int
nsyscalls
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment