summaryrefslogtreecommitdiffstats
path: root/linux-user
Commit message (Collapse)AuthorAgeFilesLines
* Bad zero comparison for sas_ss_flags on powerpcAlex Barcelo2012-03-151-1/+1
| | | | | | | | | | | | | | | All architectures work the same way, and all check for sas_ss_flags == 0. The powerpc lines are wrong, and do the check the other way round (it's a qemu internal check, which is done wrong only for this architecture, it's more a typo than a bug). It's NOT ppc specific, it's POSIX standard (sigaltstack) and qemu internal. I have a test source that I will send in a follow-up (it's longer than I would have wished, I'm sure that a better test case can be written if needed) Signed-off-by: Alex Barcelo <abarcelo@ac.upc.edu> Signed-off-by: Alexander Graf <agraf@suse.de>
* Rename CPUState -> CPUArchStateAndreas Färber2012-03-145-44/+44
| | | | | | | | | | | | | Scripted conversion: for file in *.[hc] hw/*.[hc] hw/kvm/*.[hc] linux-user/*.[hc] linux-user/m68k/*.[hc] bsd-user/*.[hc] darwin-user/*.[hc] tcg/*/*.[hc] target-*/cpu.h; do sed -i "s/CPUState/CPUArchState/g" $file done All occurrences of CPUArchState are expected to be replaced by QOM CPUState, once all targets are QOM'ified and common fields have been extracted. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
* linux-user: Don't overuse CPUStateAndreas Färber2012-03-144-124/+131
| | | | | | | | In target-specific code use CPU*State. While at it, fix indentation on those lines. Signed-off-by: Andreas Färber <afaerber@suse.de>
* Rename cpu_reset() to cpu_state_reset()Andreas Färber2012-03-142-2/+2
| | | | | | | | | | Frees the identifier cpu_reset for QOM CPUs (manual rename). Don't hide the parameter type behind explicit casts, use static functions with strongly typed argument to indirect. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
* qom: Add QOM support to user emulatorsAndreas Färber2012-03-131-0/+2
| | | | | | | | | | | | Link the Object base class and the module infrastructure for class registration. Introduce $(universal-obj-y) for objects that are more common than $(common-obj-y), so that those only get built once. Call QOM module init for type registration. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Spelling fixes in comments (it's -> its)Stefan Weil2012-03-081-1/+1
| | | | | | | | | | * it's -> its (fixed for all files) * dont -> don't (only fixed in a line which was touched by the previous fix) * distrub -> disturb (fixed in the same line) Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* linux-user: brk() debuggingPaul Brook2012-02-101-7/+9
| | | | | | | Fix format type mismatches in do_brk debug printfs. Signed-off-by: Paul Brook <paul@codesourcery.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* linux-user: fail execve() if env/args too bigUlrich Hecht2012-02-101-0/+9
| | | | | | | | | | | | | | | If the host's page size is equal to or smaller than the target's, native execve() will fail appropriately with E2BIG if called with too big an environment for the target to handle. It may falsely succeed, however, if the host's page size is bigger, and feed the executed target process an environment that is too big for it to handle, at which point QEMU barfs and exits, confusing procmail's autoconf script and causing the build to fail. This patch makes sure that execve() will return E2BIG if the environment is too large for the target. Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* linux-user: Fix sa_flags byte swaps for mipsAndreas Färber2012-02-021-0/+8
| | | | | | | | | | | | sa_flags is uint32_t for mips{,n32,64}, so don't use tswapal(). edited by Riku Voipio: likewise on alpha Reported-by: Khansa Butt <khansa@kics.edu.pk> Suggested-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Ehsan Ul Haq <ehsan.ulhaq@kics.edu.pk> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: Define TARGET_QEMU_ESIGRETURN for mips64Andreas Färber2012-02-021-0/+3
| | | | | | | | Copied from mips/syscall.h. Signed-off-by: Khansa Butt <khansa@kics.edu.pk> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: Define TARGET_QEMU_ESIGRETURN for mipsn32Andreas Färber2012-02-021-0/+3
| | | | | | | | Copied from mips/syscall.h. Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: Implement *listxattr syscallsPeter Maydell2012-02-021-1/+35
| | | | | | | Implement listxattr, flistxattr and llistxattr syscalls. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user/syscall.c: Implement f and l versions of set/get/removexattrPeter Maydell2012-02-021-9/+70
| | | | | | | | Implement the f and l versions (operate on fd, don't follow links) of the setxattr, getxattr and removexattr syscalls. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: Allow NULL value pointer in setxattr and getxattrPeter Maydell2012-02-021-6/+18
| | | | | | | | It's valid to pass a NULL value pointer to setxattr, so don't fail this case EFAULT. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: fix wait* syscall status returnsAlexander Graf2012-02-021-2/+2
| | | | | | | | | | | | | | | | | | | | | When calling wait4 or waitpid with a status pointer and WNOHANG, the syscall can potentially not modify the status pointer input. Now if we have guest code like: int status = 0; waitpid(pid, &status, WNOHANG); if (status) <breakage> then we have to make sure that in case status did not change we actually return the guest's initialized status variable instead of our own uninitialized. We fail to do so today, as we proxy everything through an uninitialized status variable which for me ended up always containing the last error code. This patch fixes some test cases when building yast2-core in OBS for ARM. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user/strace.c: Correct errno printing for mmap etcPeter Maydell2012-02-021-5/+4
| | | | | | | | | | Correct the printing of errnos for syscalls which are handled via print_syscall_ret_addr (mmap, mmap2, brk, shmat): errnos are returned as negative returned values at this level, not via the host 'errno' variable. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: fix QEMU_STRACE=1 segfaultAlexander Graf2012-02-022-4/+17
| | | | | | | | | | | | While debugging some issues with QEMU_STRACE I stumbled over segmentation faults that were pretty reproducible. Turns out we tried to treat a normal return value as errno, resulting in an access over array boundaries for the resolution. Fix this by allowing failure to resolve invalid errnos into strings. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: add SO_PEERCRED support for getsockoptAkos PASZTORY2012-02-022-1/+39
| | | | | Signed-off-by: Akos PASZTORY <akos.pasztory@gmail.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user/main.c: Add option to user-mode emulation so that user can ↵陳韋任2012-02-021-0/+7
| | | | | | | | | | | | specify log file name QEMU linux user-mode's default log file name is "/tmp/qemu.log". In order to change the log file name, user need to modify the source code then recompile QEMU. This patch allow user use "-D logfile" option to specify the log file name. Signed-off-by: Chen Wen-Ren <chenwj@iis.sinica.edu.tw> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: fake /proc/self/auxvAlexander Graf2012-02-021-0/+30
| | | | | | | | | | | | Gtk tries to read /proc/self/auxv to find its auxv table instead of taking it from its own program memory space. However, when running with linux-user, we see the host's auxv which clearly exposes wrong information. so let's instead expose the guest memory backed auxv tables via /proc/self/auxv as well. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: fake /proc/self/statAlexander Graf2012-02-021-0/+26
| | | | | | | | | | | | The boehm gc finds the program's stack starting pointer by checking /proc/self/stat. Unfortunately, so far it reads qemu's stack pointer which clearly is wrong. So let's instead fake the file so the guest program sees the right address. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: fake /proc/self/mapsAlexander Graf2012-02-021-0/+15
| | | | | | | | | | | | glibc's pthread_attr_getstack tries to find the stack range from /proc/self/maps. Unfortunately, /proc is usually the host's /proc which means linux-user guests see qemu's stack there. Fake the file with a constructed maps entry that exposes the guest's stack range. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: add open() hijack infrastructureAlexander Graf2012-02-021-3/+49
| | | | | | | | | | There are a number of files in /proc that expose host information to the guest program. This patch adds infrastructure to override the open() syscall for guest programs to enable us to on the fly generate guest sensible files. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: save auxv lengthAlexander Graf2012-02-022-11/+5
| | | | | | | | | | | | | | We create our own AUXV segment on stack and save a pointer to it. However we don't save the length of it, so any code that wants to do anything useful with it later on has to walk it again. Instead, let's remember the length of our AUXV segment. This simplifies later uses by a lot. (edited by Riku to apply to qemu HEAD) Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: stack_base is now mandatory on all targetsRiku Voipio2012-02-021-1/+1
| | | | Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* elf: Improve symbol lookup (optimize, fix for bsd-user)Stefan Weil2012-01-101-7/+4
| | | | | | | | | | | | | | Coverity complained about local variable key which was only partially initiated. Only key.st_value was set. As this was also the only part of key which was used in function symfind, the code could be optimized by directly passing a pointer to orig_addr. In bsd-user/elfload.c, fix ec822001a2f26eef8701194714f6482b6d852de2 was missing. This was a simple replacement of > by >= in symfind, so I fixed it here without creating an additional patch. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
* Fix spelling in comments, documentation and messagesStefan Weil2011-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | accidently->accidentally annother->another choosen->chosen consideres->considers decriptor->descriptor developement->development paramter->parameter preceed->precede preceeding->preceding priviledge->privilege propogation->propagation substraction->subtraction throught->through upto->up to usefull->useful Fix also grammar in posix-aio-compat.c Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* linux-user/syscall.c: Don't skip stracing for fcntl64 failure casePeter Maydell2011-12-061-2/+4
| | | | | | | | | | In an fcntl64 failure path, we were returning directly rather than simply breaking out of the switch statement. This skips the strace code for printing the syscall return value, so don't do that. Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* linux-user/arm/nwfpe/fpopcode.h: Fix non-UTF-8 charactersPeter Maydell2011-12-061-17/+17
| | | | | | | | | Fix some stray non-UTF-8 characters used in some ASCII art tables by converting them to plain ASCII '|' instead. Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* linux-user/cpu-uname.c: Convert to UTF-8Peter Maydell2011-12-061-1/+1
| | | | | | | | | Convert comment from ISO-8859-1 encoding to UTF-8 to match the rest of QEMU's source code. Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* fix typo: delete redundant semicolonDong Xu Wang2011-12-061-1/+1
| | | | | | | Double semicolons should be single. Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* fix spelling in linux-user sub directoryDong Xu Wang2011-12-025-8/+8
| | | | | | Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* linux-user/elfload.c: Don't memset(NULL..) if malloc() failedPeter Maydell2011-11-112-4/+3
| | | | | | | | | | | If a malloc() in copy_elf_strings() failed we would call memset() before the "did malloc fail?" check. Fix this by moving to the glib alloc/free routines for this memory so we can use g_try_malloc0 rather than having a separate memset(). Spotted by Coverity (see bug 887883). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* configure: fix detection for xattr.h on modern distributionsAvi Kivity2011-11-091-1/+1
| | | | | | | | | | | Modern distributions place xattr.h in /usr/include/sys, and fold libattr.so into libc. They also don't have an ENOATTR. Make configure detect this, and add a qemu-xattr.h file that directs the #include to the right place. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'riku/linux-user-for-upstream' into stagingAnthony Liguori2011-10-319-175/+193
|\
| * ppc64-linux-user: Fix syscall return type.Richard Henderson2011-10-271-10/+3
| | | | | | | | | | | | | | | | Use target_ulong instead of hard-coded uint32_t. Remove the disabled printf's that are redundant with -strace. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
| * ppc64-linux-user: Properly interpret the entry function descriptor.Richard Henderson2011-10-271-4/+4
| | | | | | | | | | | | | | | | | | Don't confuse the load address with the load bias. They're equal for ET_DYN objects (i.e. ld.so) but different for ET_EXEC objects (i.e. statically linked). Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
| * sparc-linux-user: Add some missing syscall numbersRichard Henderson2011-10-271-0/+3
| | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
| * sparc-linux-user: Fixup sending SIGSEGVRichard Henderson2011-10-271-2/+2
| | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
| * sparc-linux-user: Handle SIGILL.Richard Henderson2011-10-271-0/+9
| | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
| * linux-user: implement reboot syscallAlexander Graf2011-10-271-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | For OBS, we're running a full cross-guest inside of a VM. When a build is done there, we reboot the guest as shutdown mechanism. Unfortunately, reboot is not implemented in linux-user. So this mechanism fails, spilling unpretty warnings. This patch implements sys_reboot() emulation. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
| * linux-user: fix openatAlexander Graf2011-10-271-13/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When running openat using qemu-arm, we stumbled over invalid permissions on the created files. The reason for this is that the mode parameter gets treates as an O_... flag, which it isn't - it's a permission bitmask. This patch removes the needless translation of the mode parameter, rendering permission passing of openat() to work with linux-user. Reported-by: Dirk Mueller <dmueller@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
| * linux-user: fix abi_(u)long, target_ulong mismatchMatthias Braun2011-10-276-143/+157
| | | | | | | | | | | | | | | | abi_(u)long might be different from target_ulong, so don't use tswapl but introduce a new tswapal Signed-off-by: Matthias Braun <matze@braunis.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
| * linux-user: fix rlimit syscalls on sparc(64)Matthias Braun2011-10-271-1/+6
| | | | | | | | | | Signed-off-by: Matthias Braun <matze@braunis.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
| * linux-user: fix TARGET_RLIM_INFINITY declarationMatthias Braun2011-10-271-1/+1
| | | | | | | | | | Signed-off-by: Matthias Braun <matze@braunis.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* | target-sparc: Change fpr representation to doubles.Richard Henderson2011-10-261-12/+16
|/ | | | | | | | This allows a more efficient representation for 64-bit hosts. It should be about the same for 32-bit hosts, as we can still access the individual pieces of the double. Signed-off-by: Richard Henderson <rth@twiddle.net>
* linux-user: Fix broken "-version" optionPeter Maydell2011-10-211-11/+8
| | | | | | | | | | | | | | | | Fix the "-version" option, which was accidentally broken in commit fc9c541: * exit after printing version information rather than proceeding blithely onward (and likely printing the full usage message) * correct the cut-n-paste error in the usage message for it * don't insist on the presence of a following argument for options which don't take an argument (this was preventing 'qemu-arm -version' from working) * remove a spurious argc check from the beginning of main() which meant 'QEMU_VERSION=1 qemu-arm' didn't work. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
* linux-user: Remove unused codeStefan Weil2011-10-051-4/+1
| | | | | | | The code is unused since 8 years, so remove it. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* Merge remote-tracking branch 'riku/linux-user-for-upstream' into stagingAnthony Liguori2011-09-264-220/+579
|\
| * introduce environment variables for all qemu-user optionsJohannes Schauer2011-09-091-207/+348
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (Edits by Riku Voipio to apply to current HEAD) Rework option parsing code for linux-user in a table-driven manner to allow environment variables for all commandline options. Also generate usage() output from option table. Fix complains from checkpatch.pl, also have envlist global Signed-off-by: Johannes Schauer <j.schauer@email.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
OpenPOWER on IntegriCloud