linux/arch/um/kernel
Renzo Davoli 86d6f2bf61 UML on UML fixed: it did not start
It is currently impossible to run a user-mode linux machine inside another
user-mode linux (UML on UML).  It breaks after a few instructions.  When
it tries to check whether SYSEMU is installed (the inner) UML receives an
inconsistent result (from the outer UML).

This is the output of a broken attempt:
$ ./linux mem=256m ubd0=cow
Locating the bottom of the address space ... 0x0
Locating the top of the address space ... 0xc0000000
Core dump limits :
        soft - 0
        hard - NONE
Checking that ptrace can change system call numbers...OK
Checking ptrace new tags for syscall emulation...unsupported
Checking syscall emulation patch for ptrace...check_sysemu : expected SIGTRAP, got status = 256
$

The problem is the following:

PTRACE_SYSCALL/SINGLESTEP is currently managed inside arch_ptrace for ARCH=um.

PTRACE_SYSEMU/SUSEMU_SINGLESTEP is not captured in arch_ptrace's switch,
therefore it is erroneously passed back to ptrace_request (in
kernel/ptrace).

This simple patch simply forces ptrace to return an error on
PTRACE_SYSEMU/SUSEMU_SINGLESTEP as it is unsupported on ARCH=um, and fixes
the problem.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Renzo Davoli <renzo@cs.unibo.it>
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-03-12 16:20:23 -07:00
..
skas
asm-offsets.c
config.c.in
dyn.lds.S
exec.c x86, um: get rid of uml unistd.h 2008-10-22 22:55:21 -07:00
exitcode.c
gmon_syms.c
gprof_syms.c
init_task.c take init_fs to saner place 2008-12-31 18:07:42 -05:00
initrd.c
internal.h x86, um: get rid of uml unistd.h 2008-10-22 22:55:21 -07:00
irq.c
ksyms.c
Makefile
mem.c
physmem.c
process.c
ptrace.c UML on UML fixed: it did not start 2009-03-12 16:20:23 -07:00
reboot.c
sigio.c
signal.c x86, um: sanitize uml sigcontext.h uses 2008-10-22 22:55:20 -07:00
smp.c cpumask: centralize cpu_online_map and cpu_possible_map 2008-12-13 21:19:41 +10:30
syscall.c x86, um: get rid of uml unistd.h 2008-10-22 22:55:21 -07:00
sysrq.c
time.c cpumask: convert struct clock_event_device to cpumask pointers. 2008-12-13 21:20:26 +10:30
tlb.c
trap.c mm: invoke oom-killer from page fault 2009-01-06 15:58:58 -08:00
uaccess.c
um_arch.c
umid.c
uml.lds.S
vmlinux.lds.S