[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 00/23] bsd-user: FreeBSD support for mips/mips64 and
From: |
Stacey Son |
Subject: |
[Qemu-devel] [PATCH 00/23] bsd-user: FreeBSD support for mips/mips64 and arm |
Date: |
Sun, 23 Jun 2013 21:03:32 -0500 |
Hi all,
This patch series add BSD user mode support for FreeBSD. In addition,
it adds the necessary architecture dependent code for the mips, mips64,
and arm targets. In its current state it can emulate most mips/mips64
and arm target binaries on a x86 host in a simple chroot environment
(see https://wiki.freebsd.org/QemuUserModeHowTo for example).
To build this code it requires Ed Maste's configure/linker patches for
using an alternate .text segment on FreeBSD. ie.
https://github.com/emaste/qemu/commit/2fdae0f4172175dddbd19283a4607eae2a46587d
and the suggested change by Richard Henderson
https://github.com/emaste/qemu/commit/ede607ad998bac1d44f2e3a79d5f5fb5e70c9f46
Besides adding a lot of shims and other support code this change
restructures the code significantly to reduce the amount of C
preprocessor conditionals for the various target and host arch/OS's.
In general, the target cpu depedent code has been moved into into
the various arch directories and the host OS dependent code (ie.
FreeBSD, NetBSD, OpenBSD) has been moved into the OS directories as
much as possible.
I recognize and give credit to Olivier Houchard (arm dependent and other
bsd-user code), Juergen Lock (FreeBSD qemu port owner), and Ed Maste (linker
configuration). Also, to Andreas Tobler (initial PPC dependent code). I
am sure I forgot someone and apoligize in advance.
Once this patch set has been has been reviewed and approved I can submit
it as a pull request if desired.
Best Regards,
Stacey D. Son
---
Stacey Son (23):
bsd-user: initial code clean up
bsd-user: add initial support for mips/mips64
bsd-user: additional seperation of OS and architecture dependent code
bsd-user: add bsd signal emulation
bsd-user: add bsd_binprm to TaskState for core dumping emulation
bsd-user: fix thread initialization and ELF addresses for mips/mips64
bsd-user: find target executable in path when absolute path not given
bsd-user: initialize stack with signal trampolin code and canary
bsd-user: refresh FreeBSD's system call numbers
bsd-user: add shims for memory management related syscalls
bsd-user: add shims for file related system calls
bsd-user: add shims for time related system calls.
bsd-user: add shims for signal related system calls
bsd-user: add shims for process related system calls
bsd-user: add shims for socket related system calls
bsd-user: add shims for stat and file handle related syscalls
bsd-user: add shims for thread related system calls
bsd-user: add shim for the ioctl system call
bsd-user: add shims for sysarch() and sysctl() system calls
bsd-user: add shims for extended attributes system calls
bsd-user: add miscellaneous system call shims
bsd-user: add more strace formating
bsd-user: add arm cpu support
Makefile.target | 5 +-
bsd-user/Makefile.objs | 9 +-
bsd-user/arm/syscall.h | 36 +
bsd-user/arm/target_arch.h | 13 +
bsd-user/arm/target_arch_cpu.h | 405 +++++++
bsd-user/arm/target_arch_signal.h | 255 ++++
bsd-user/arm/target_arch_sigtramp.h | 33 +
bsd-user/arm/target_arch_sysarch.h | 80 ++
bsd-user/arm/target_arch_thread.h | 40 +
bsd-user/arm/target_arch_vmparam.h | 49 +
bsd-user/bsd-file.h | 1095 ++++++++++++++++++
bsd-user/bsd-mem.c | 122 ++
bsd-user/bsd-mem.h | 387 +++++++
bsd-user/bsd-misc.c | 209 ++++
bsd-user/bsd-misc.h | 339 ++++++
bsd-user/bsd-mman.h | 121 --
bsd-user/bsd-proc.c | 160 +++
bsd-user/bsd-proc.h | 434 +++++++
bsd-user/bsd-signal.h | 232 ++++
bsd-user/bsd-socket.c | 108 ++
bsd-user/bsd-socket.h | 266 +++++
bsd-user/bsdload.c | 139 ++-
bsd-user/elfload.c | 387 ++++---
bsd-user/errno_defs.h | 13 +-
bsd-user/freebsd/host_os.h | 46 +
bsd-user/freebsd/ioctl-cmds.h | 47 +
bsd-user/freebsd/ioctl-filio.h | 45 +
bsd-user/freebsd/ioctl-ioccom.h | 54 +
bsd-user/freebsd/ioctl-ttycom.h | 257 ++++
bsd-user/freebsd/ioctl-types.h | 7 +
bsd-user/freebsd/os-extattr.c | 119 ++
bsd-user/freebsd/os-extattr.h | 644 +++++++++++
bsd-user/freebsd/os-misc.h | 442 +++++++
bsd-user/freebsd/os-proc.c | 234 ++++
bsd-user/freebsd/os-proc.h | 427 +++++++
bsd-user/freebsd/os-signal.h | 43 +
bsd-user/freebsd/os-socket.c | 149 +++
bsd-user/freebsd/os-socket.h | 548 +++++++++
bsd-user/freebsd/os-stat.c | 234 ++++
bsd-user/freebsd/os-stat.h | 437 +++++++
bsd-user/freebsd/os-strace.h | 29 +
bsd-user/freebsd/os-sys.c | 268 +++++
bsd-user/freebsd/os-thread.c | 802 +++++++++++++
bsd-user/freebsd/os-thread.h | 742 ++++++++++++
bsd-user/freebsd/os-time.c | 205 ++++
bsd-user/freebsd/os-time.h | 602 ++++++++++
bsd-user/freebsd/qemu-os.h | 77 ++
bsd-user/freebsd/strace.list | 76 ++-
bsd-user/freebsd/syscall_nr.h | 813 +++++++------
bsd-user/freebsd/target_os_siginfo.h | 100 ++
bsd-user/freebsd/target_os_signal.h | 79 ++
bsd-user/freebsd/target_os_stack.h | 124 ++
bsd-user/freebsd/target_os_vmparam.h | 19 +
bsd-user/i386/syscall.h | 23 +
bsd-user/i386/target_arch.h | 11 +
bsd-user/i386/target_arch_cpu.c | 79 ++
bsd-user/i386/target_arch_cpu.h | 290 +++++
bsd-user/i386/target_arch_signal.h | 81 ++
bsd-user/i386/target_arch_sigtramp.h | 11 +
bsd-user/i386/target_arch_sysarch.h | 78 ++
bsd-user/i386/target_arch_thread.h | 30 +
bsd-user/i386/target_arch_vmparam.h | 26 +
bsd-user/i386/target_signal.h | 20 -
bsd-user/ioctl.c | 447 +++++++
bsd-user/main.c | 875 +++------------
bsd-user/mips/syscall.h | 52 +
bsd-user/mips/target_arch.h | 13 +
bsd-user/mips/target_arch_cpu.h | 227 ++++
bsd-user/mips/target_arch_signal.h | 237 ++++
bsd-user/mips/target_arch_sigtramp.h | 23 +
bsd-user/mips/target_arch_sysarch.h | 69 ++
bsd-user/mips/target_arch_thread.h | 45 +
bsd-user/mips/target_arch_vmparam.h | 47 +
bsd-user/mips64/syscall.h | 53 +
bsd-user/mips64/target_arch.h | 13 +
bsd-user/mips64/target_arch_cpu.h | 226 ++++
bsd-user/mips64/target_arch_signal.h | 236 ++++
bsd-user/mips64/target_arch_sigtramp.h | 23 +
bsd-user/mips64/target_arch_sysarch.h | 69 ++
bsd-user/mips64/target_arch_thread.h | 45 +
bsd-user/mips64/target_arch_vmparam.h | 47 +
bsd-user/mmap.c | 108 +--
bsd-user/netbsd/host_os.h | 31 +
bsd-user/netbsd/ioctl-cmds.h | 48 +
bsd-user/netbsd/ioctl-filio.h | 29 +
bsd-user/netbsd/ioctl-ioccom.h | 38 +
bsd-user/netbsd/ioctl-ttycom.h | 240 ++++
bsd-user/netbsd/ioctl-types.h | 7 +
bsd-user/netbsd/os-extattr.h | 247 ++++
bsd-user/netbsd/os-proc.c | 11 +
bsd-user/netbsd/os-proc.h | 243 ++++
bsd-user/netbsd/os-signal.h | 34 +
bsd-user/netbsd/os-socket.c | 1 +
bsd-user/netbsd/os-socket.h | 98 ++
bsd-user/netbsd/os-stat.c | 1 +
bsd-user/netbsd/os-stat.h | 176 +++
bsd-user/netbsd/os-strace.h | 1 +
bsd-user/netbsd/os-sys.c | 46 +
bsd-user/netbsd/os-time.c | 1 +
bsd-user/netbsd/os-time.h | 179 +++
bsd-user/netbsd/qemu-os.h | 1 +
bsd-user/netbsd/strace.list | 18 +
bsd-user/netbsd/syscall_nr.h | 24 +-
bsd-user/netbsd/target_os_siginfo.h | 82 ++
bsd-user/netbsd/target_os_signal.h | 70 ++
bsd-user/netbsd/target_os_stack.h | 31 +
bsd-user/netbsd/target_os_vmparam.h | 17 +
bsd-user/openbsd/host_os.h | 31 +
bsd-user/openbsd/ioctl-cmds.h | 48 +
bsd-user/openbsd/ioctl-filio.h | 29 +
bsd-user/openbsd/ioctl-ioccom.h | 38 +
bsd-user/openbsd/ioctl-ttycom.h | 240 ++++
bsd-user/openbsd/ioctl-types.h | 7 +
bsd-user/openbsd/os-extattr.h | 247 ++++
bsd-user/openbsd/os-proc.c | 11 +
bsd-user/openbsd/os-proc.h | 243 ++++
bsd-user/openbsd/os-signal.h | 34 +
bsd-user/openbsd/os-socket.c | 1 +
bsd-user/openbsd/os-socket.h | 98 ++
bsd-user/openbsd/os-stat.c | 1 +
bsd-user/openbsd/os-stat.h | 176 +++
bsd-user/openbsd/os-strace.h | 1 +
bsd-user/openbsd/os-sys.c | 46 +
bsd-user/openbsd/os-time.c | 1 +
bsd-user/openbsd/os-time.h | 179 +++
bsd-user/openbsd/qemu-os.h | 1 +
bsd-user/openbsd/strace.list | 18 +
bsd-user/openbsd/syscall_nr.h | 24 +-
bsd-user/openbsd/target_os_siginfo.h | 82 ++
bsd-user/openbsd/target_os_signal.h | 70 ++
bsd-user/openbsd/target_os_stack.h | 31 +
bsd-user/openbsd/target_os_vmparam.h | 17 +
bsd-user/qemu-bsd.h | 79 ++
bsd-user/qemu.h | 195 +++-
bsd-user/signal.c | 923 +++++++++++++++-
bsd-user/sparc/syscall.h | 29 +-
bsd-user/sparc/target_arch.h | 9 +
bsd-user/sparc/target_arch_cpu.c | 113 ++
bsd-user/sparc/target_arch_cpu.h | 143 +++
bsd-user/sparc/target_arch_signal.h | 64 +
bsd-user/sparc/target_arch_sigtramp.h | 11 +
bsd-user/sparc/target_arch_sysarch.h | 52 +
bsd-user/sparc/target_arch_thread.h | 30 +
bsd-user/sparc/target_arch_vmparam.h | 35 +
bsd-user/sparc/target_signal.h | 27 -
bsd-user/sparc64/syscall.h | 28 +-
bsd-user/sparc64/target_arch.h | 9 +
bsd-user/sparc64/target_arch_cpu.c | 118 ++
bsd-user/sparc64/target_arch_cpu.h | 175 +++
bsd-user/sparc64/target_arch_signal.h | 81 ++
bsd-user/sparc64/target_arch_sigtramp.h | 11 +
bsd-user/sparc64/target_arch_sysarch.h | 52 +
bsd-user/sparc64/target_arch_thread.h | 30 +
bsd-user/sparc64/target_arch_vmparam.h | 37 +
bsd-user/sparc64/target_signal.h | 27 -
bsd-user/strace.c | 175 ++-
bsd-user/syscall.c | 1929 ++++++++++++++++++++++++-------
bsd-user/syscall_defs.h | 790 +++++++++++--
bsd-user/uaccess.c | 20 +-
bsd-user/x86_64/syscall.h | 26 +-
bsd-user/x86_64/target_arch.h | 11 +
bsd-user/x86_64/target_arch_cpu.c | 79 ++
bsd-user/x86_64/target_arch_cpu.h | 312 +++++
bsd-user/x86_64/target_arch_signal.h | 81 ++
bsd-user/x86_64/target_arch_sigtramp.h | 11 +
bsd-user/x86_64/target_arch_sysarch.h | 76 ++
bsd-user/x86_64/target_arch_thread.h | 30 +
bsd-user/x86_64/target_arch_vmparam.h | 28 +
bsd-user/x86_64/target_signal.h | 19 -
configure | 25 +-
default-configs/arm-bsd-user.mak | 3 +
default-configs/armeb-bsd-user.mak | 3 +
default-configs/mips-bsd-user.mak | 1 +
default-configs/mips64-bsd-user.mak | 1 +
default-configs/mips64el-bsd-user.mak | 1 +
default-configs/mipsel-bsd-user.mak | 1 +
include/qemu/tls.h | 2 +-
target-mips/mips-defs.h | 13 +-
178 files changed, 23181 insertions(+), 2192 deletions(-)
create mode 100644 bsd-user/arm/syscall.h
create mode 100644 bsd-user/arm/target_arch.h
create mode 100644 bsd-user/arm/target_arch_cpu.c
create mode 100644 bsd-user/arm/target_arch_cpu.h
create mode 100644 bsd-user/arm/target_arch_signal.h
create mode 100644 bsd-user/arm/target_arch_sigtramp.h
create mode 100644 bsd-user/arm/target_arch_sysarch.h
create mode 100644 bsd-user/arm/target_arch_thread.h
create mode 100644 bsd-user/arm/target_arch_vmparam.h
create mode 100644 bsd-user/bsd-file.h
create mode 100644 bsd-user/bsd-mem.c
create mode 100644 bsd-user/bsd-mem.h
create mode 100644 bsd-user/bsd-misc.c
create mode 100644 bsd-user/bsd-misc.h
delete mode 100644 bsd-user/bsd-mman.h
create mode 100644 bsd-user/bsd-proc.c
create mode 100644 bsd-user/bsd-proc.h
create mode 100644 bsd-user/bsd-signal.h
create mode 100644 bsd-user/bsd-socket.c
create mode 100644 bsd-user/bsd-socket.h
create mode 100644 bsd-user/freebsd/host_os.h
create mode 100644 bsd-user/freebsd/ioctl-cmds.h
create mode 100644 bsd-user/freebsd/ioctl-filio.h
create mode 100644 bsd-user/freebsd/ioctl-ioccom.h
create mode 100644 bsd-user/freebsd/ioctl-ttycom.h
create mode 100644 bsd-user/freebsd/ioctl-types.h
create mode 100644 bsd-user/freebsd/os-extattr.c
create mode 100644 bsd-user/freebsd/os-extattr.h
create mode 100644 bsd-user/freebsd/os-misc.h
create mode 100644 bsd-user/freebsd/os-proc.c
create mode 100644 bsd-user/freebsd/os-proc.h
create mode 100644 bsd-user/freebsd/os-signal.h
create mode 100644 bsd-user/freebsd/os-socket.c
create mode 100644 bsd-user/freebsd/os-socket.h
create mode 100644 bsd-user/freebsd/os-stat.c
create mode 100644 bsd-user/freebsd/os-stat.h
create mode 100644 bsd-user/freebsd/os-strace.h
create mode 100644 bsd-user/freebsd/os-sys.c
create mode 100644 bsd-user/freebsd/os-thread.c
create mode 100644 bsd-user/freebsd/os-thread.h
create mode 100644 bsd-user/freebsd/os-time.c
create mode 100644 bsd-user/freebsd/os-time.h
create mode 100644 bsd-user/freebsd/qemu-os.h
create mode 100644 bsd-user/freebsd/target_os_siginfo.h
create mode 100644 bsd-user/freebsd/target_os_signal.h
create mode 100644 bsd-user/freebsd/target_os_stack.h
create mode 100644 bsd-user/freebsd/target_os_vmparam.h
create mode 100644 bsd-user/i386/target_arch.h
create mode 100644 bsd-user/i386/target_arch_cpu.c
create mode 100644 bsd-user/i386/target_arch_cpu.h
create mode 100644 bsd-user/i386/target_arch_signal.h
create mode 100644 bsd-user/i386/target_arch_sigtramp.h
create mode 100644 bsd-user/i386/target_arch_sysarch.h
create mode 100644 bsd-user/i386/target_arch_thread.h
create mode 100644 bsd-user/i386/target_arch_vmparam.h
delete mode 100644 bsd-user/i386/target_signal.h
create mode 100644 bsd-user/ioctl.c
create mode 100644 bsd-user/mips/syscall.h
create mode 100644 bsd-user/mips/target_arch.h
create mode 100644 bsd-user/mips/target_arch_cpu.c
create mode 100644 bsd-user/mips/target_arch_cpu.h
create mode 100644 bsd-user/mips/target_arch_signal.h
create mode 100644 bsd-user/mips/target_arch_sigtramp.h
create mode 100644 bsd-user/mips/target_arch_sysarch.h
create mode 100644 bsd-user/mips/target_arch_thread.h
create mode 100644 bsd-user/mips/target_arch_vmparam.h
create mode 100644 bsd-user/mips64/syscall.h
create mode 100644 bsd-user/mips64/target_arch.h
create mode 100644 bsd-user/mips64/target_arch_cpu.c
create mode 100644 bsd-user/mips64/target_arch_cpu.h
create mode 100644 bsd-user/mips64/target_arch_signal.h
create mode 100644 bsd-user/mips64/target_arch_sigtramp.h
create mode 100644 bsd-user/mips64/target_arch_sysarch.h
create mode 100644 bsd-user/mips64/target_arch_thread.h
create mode 100644 bsd-user/mips64/target_arch_vmparam.h
create mode 100644 bsd-user/mips64/touch_arch.cpu.c
create mode 100644 bsd-user/netbsd/host_os.h
create mode 100644 bsd-user/netbsd/ioctl-cmds.h
create mode 100644 bsd-user/netbsd/ioctl-filio.h
create mode 100644 bsd-user/netbsd/ioctl-ioccom.h
create mode 100644 bsd-user/netbsd/ioctl-ttycom.h
create mode 100644 bsd-user/netbsd/ioctl-types.h
create mode 100644 bsd-user/netbsd/os-extattr.h
create mode 100644 bsd-user/netbsd/os-proc.c
create mode 100644 bsd-user/netbsd/os-proc.h
create mode 100644 bsd-user/netbsd/os-signal.h
create mode 100644 bsd-user/netbsd/os-socket.c
create mode 100644 bsd-user/netbsd/os-socket.h
create mode 100644 bsd-user/netbsd/os-stat.c
create mode 100644 bsd-user/netbsd/os-stat.h
create mode 100644 bsd-user/netbsd/os-strace.h
create mode 100644 bsd-user/netbsd/os-sys.c
create mode 100644 bsd-user/netbsd/os-time.c
create mode 100644 bsd-user/netbsd/os-time.h
create mode 100644 bsd-user/netbsd/qemu-os.h
create mode 100644 bsd-user/netbsd/target_os_siginfo.h
create mode 100644 bsd-user/netbsd/target_os_signal.h
create mode 100644 bsd-user/netbsd/target_os_stack.h
create mode 100644 bsd-user/netbsd/target_os_vmparam.h
create mode 100644 bsd-user/openbsd/host_os.h
create mode 100644 bsd-user/openbsd/ioctl-cmds.h
create mode 100644 bsd-user/openbsd/ioctl-filio.h
create mode 100644 bsd-user/openbsd/ioctl-ioccom.h
create mode 100644 bsd-user/openbsd/ioctl-ttycom.h
create mode 100644 bsd-user/openbsd/ioctl-types.h
create mode 100644 bsd-user/openbsd/os-extattr.h
create mode 100644 bsd-user/openbsd/os-proc.c
create mode 100644 bsd-user/openbsd/os-proc.h
create mode 100644 bsd-user/openbsd/os-signal.h
create mode 100644 bsd-user/openbsd/os-socket.c
create mode 100644 bsd-user/openbsd/os-socket.h
create mode 100644 bsd-user/openbsd/os-stat.c
create mode 100644 bsd-user/openbsd/os-stat.h
create mode 100644 bsd-user/openbsd/os-strace.h
create mode 100644 bsd-user/openbsd/os-sys.c
create mode 100644 bsd-user/openbsd/os-time.c
create mode 100644 bsd-user/openbsd/os-time.h
create mode 100644 bsd-user/openbsd/qemu-os.h
create mode 100644 bsd-user/openbsd/target_os_siginfo.h
create mode 100644 bsd-user/openbsd/target_os_signal.h
create mode 100644 bsd-user/openbsd/target_os_stack.h
create mode 100644 bsd-user/openbsd/target_os_vmparam.h
create mode 100644 bsd-user/qemu-bsd.h
create mode 100644 bsd-user/sparc/target_arch.h
create mode 100644 bsd-user/sparc/target_arch_cpu.c
create mode 100644 bsd-user/sparc/target_arch_cpu.h
create mode 100644 bsd-user/sparc/target_arch_signal.h
create mode 100644 bsd-user/sparc/target_arch_sigtramp.h
create mode 100644 bsd-user/sparc/target_arch_sysarch.h
create mode 100644 bsd-user/sparc/target_arch_thread.h
create mode 100644 bsd-user/sparc/target_arch_vmparam.h
delete mode 100644 bsd-user/sparc/target_signal.h
create mode 100644 bsd-user/sparc64/target_arch.h
create mode 100644 bsd-user/sparc64/target_arch_cpu.c
create mode 100644 bsd-user/sparc64/target_arch_cpu.h
create mode 100644 bsd-user/sparc64/target_arch_signal.h
create mode 100644 bsd-user/sparc64/target_arch_sigtramp.h
create mode 100644 bsd-user/sparc64/target_arch_sysarch.h
create mode 100644 bsd-user/sparc64/target_arch_thread.h
create mode 100644 bsd-user/sparc64/target_arch_vmparam.h
delete mode 100644 bsd-user/sparc64/target_signal.h
create mode 100644 bsd-user/x86_64/target_arch.h
create mode 100644 bsd-user/x86_64/target_arch_cpu.c
create mode 100644 bsd-user/x86_64/target_arch_cpu.h
create mode 100644 bsd-user/x86_64/target_arch_signal.h
create mode 100644 bsd-user/x86_64/target_arch_sigtramp.h
create mode 100644 bsd-user/x86_64/target_arch_sysarch.h
create mode 100644 bsd-user/x86_64/target_arch_thread.h
create mode 100644 bsd-user/x86_64/target_arch_vmparam.h
delete mode 100644 bsd-user/x86_64/target_signal.h
create mode 100644 default-configs/arm-bsd-user.mak
create mode 100644 default-configs/armeb-bsd-user.mak
create mode 100644 default-configs/mips-bsd-user.mak
create mode 100644 default-configs/mips64-bsd-user.mak
create mode 100644 default-configs/mips64el-bsd-user.mak
create mode 100644 default-configs/mipsel-bsd-user.mak
--
1.7.8
- [Qemu-devel] [PATCH 00/23] bsd-user: FreeBSD support for mips/mips64 and arm,
Stacey Son <=
- [Qemu-devel] [PATCH 07/23] bsd-user: find target executable in path when absolute path not given, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 05/23] bsd-user: add bsd_binprm to TaskState for core dumping emulation, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 06/23] bsd-user: fix thread initialization and ELF addresses for mips/mips64, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 13/23] bsd-user: add shims for signal related system calls, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 08/23] bsd-user: initialize stack with signal trampolin code and canary, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 02/23] bsd-user: add initial support for mips/mips64, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 01/23] bsd-user: initial code clean up, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 11/23] bsd-user: add shims for file related system calls, Stacey Son, 2013/06/24