aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* linux-user: switch default ppc64 CPU to 970fx from 970Aurelien Jarno2010-04-091-1/+1
| | | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit f7177937a2c0db4c3bb42e3adfde937e9c0734a1)
* Fix ARM userspace strex implementation.Paul Brook2009-12-111-0/+1
| | | | Signed-off-by: Paul Brook <paul@codesourcery.com>
* linux-user: remove hardcoded value of _NSIG in signal.cArnaud Patard2009-11-241-6/+6
| | | | | | | | | In a bunch of places, 64 is used as value of _NSIG but it's wrong at least on MIPS were _NSIG is 128. Based on a patch from Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Add missing break.Paul Brook2009-11-241-0/+1
| | | | Signed-off-by: Paul Brook <paul@codesourcery.com>
* ARM atomic ops rewritePaul Brook2009-11-221-0/+80
| | | | | | Implement ARMv6 atomic ops (ldrex/strex) using the same trick as PPC. Signed-off-by: Paul Brook <paul@codesourcery.com>
* target-mips: rename CP0_LLAddr into lladdrAurelien Jarno2009-11-221-2/+2
| | | | | | | | The variable CP0_LLAddr represent the full lladdr, not the actual register value, which is only part of this value and depends on the CPU. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* (x86/Sparc/PPC)-user: fix cpu_copyBlue Swirl2009-11-071-0/+3
| | | | | | | | b55a37c981914aa8ecd21b9a2a2fb37f39b917c5 moved the call to cpu_reset to user emulators. But cpu_copy also initializes a CPU structure, so add the call also there. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* user: move CPU reset call to main.c for x86/PPC/SparcBlue Swirl2009-11-071-0/+4
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Re: linux-user/syscall.c - don't add GUEST_BASE to NULL pointerJan-Simon Möller2009-10-171-2/+6
| | | | | | | | | | | This patch fixes the mount call. GUEST_BASE shouldn't be added to a NULL pointer on arg5 . failing call: mount("rootfs", "/", 0x47a78, MS_MGC_VAL|MS_REMOUNT, 0x10000) = -1 EFAULT (Bad address) correct call: mount("rootfs", "/", 0x37ab0, MS_MGC_VAL|MS_REMOUNT, NULL) = 0 Signed-off-by:  Jan-Simon Möller  <dl9pf@gmx.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: KD/VT/FB ioctlsUlrich Hecht2009-10-174-0/+83
| | | | | | | everything needed to run SDL on a framebuffer device in the userspace emulator Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: Update ARM hwcapsRiku Voipio2009-10-161-1/+8
| | | | | | Update ARM hwcaps to match Linux kernel 2.6.31 state Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: don't zero a buffer twicePaul Bolle2009-10-161-1/+0
| | | | | | | | prepare_binprm() zeroes bprm->buf. That buffer is already zeroed in main() and hasn't been touched since so that is not necessary. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: fix ppc target_stat64 st_blocks layoutMax Filippov2009-10-151-1/+1
| | | | | | | | Swap __pad1 and st_blocks fields location to maintain proper alignment. This fixes incorrect 'du' and 'stat' report on ppc guest. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: getpriority errno fixUlrich Hecht2009-10-151-1/+1
| | | | | | | getpriority returned wrong errno; fixes LTP test getpriority02. Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* implementations of dup3 and fallocate that are good enough to fool LTPUlrich Hecht2009-10-151-0/+10
| | | | | | | | | | updated fallocate check to new configure, added dup3 check as suggested by Jan-Simon Möller. Riku: updated to apply to current git. Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: fix "#if 0"'d printf()Paul Bolle2009-10-041-1/+1
| | | | | | | | | | Make an "#if 0"'d printf() in load_elf_binary(), probably left to aid in debugging, reflect what the actual code does. The current printf() will only confuse those who "#if 1" it (it certainly confused me enough to write this trivial patch). Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: fix up oversealous nitpickingMichael S. Tsirkin2009-10-021-1/+1
| | | | | | | | | | Looks like linux-user code was correct, just unreadable: what it wanted to do with "-=" was really assign a negative number, not decrement. Fix up accordingly. Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Revert "Get rid of _t suffix"Anthony Liguori2009-10-0122-251/+251
| | | | | | | | | | | | In the very least, a change like this requires discussion on the list. The naming convention is goofy and it causes a massive merge problem. Something like this _must_ be presented on the list first so people can provide input and cope with it. This reverts commit 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Get rid of _t suffixmalc2009-10-0122-251/+251
| | | | | | | Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
* linux-user: fix coding style nitMichael S. Tsirkin2009-09-301-1/+1
| | | | | | | | Put space between = and & when taking a pointer, to avoid confusion with old-style "&=". Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* linux-user: fix old style decrement usageMichael S. Tsirkin2009-09-301-1/+1
| | | | | | | | Modern compilers do not parse "=-" as decrement: you must use "-=" for that. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* elfload: fix coding style nitMichael S. Tsirkin2009-09-301-1/+1
| | | | | | | | Put space between = and * when dereferencing a pointer, to avoid confusion with old-style "*=" Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* __thread should be before real typeJuan Quintela2009-09-251-1/+1
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* static and inline should came before the type of the functionsJuan Quintela2009-09-251-1/+1
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Export tables properly to avoid a Sparse warningBlue Swirl2009-09-211-3/+4
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix Sparse warnings about using plain integer as NULL pointerBlue Swirl2009-09-211-1/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile loader only onceBlue Swirl2009-09-201-2/+2
| | | | | | | | | | | | | Callers must pass ELF machine, byte swapping and symbol LSB clearing information to ELF loader. A.out loader needs page size information, pass that too as a parameter. Extract prototypes to a separate file. Move loader.[ch] and elf_ops.h under hw. Adjust callers. Also use target_phys_addr_t instead of target_ulong for addresses: loader addresses aren't virtual. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Revert "Fix Sparc/Linux host breakage by ↵Blue Swirl2009-09-131-21/+0
| | | | | | | | df70204db53e3611af986f434e74a882bce190ca" This reverts commit 91b40c5be84a478e98c0416325844a7f66d0efae. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix Sparc/Linux host breakage by df70204db53e3611af986f434e74a882bce190caBlue Swirl2009-09-131-0/+21
| | | | | | | | | | | While i386, x86_64 and Sparc64/OpenBSD still worked after df70204db53e3611af986f434e74a882bce190ca, Sparc32 and Sparc64 Linux hosts broke. Partially revert the commit: make the restored code conditional to !CONFIG_USER_PIE. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix text relocations in linux-user targetsKirill A. Shutemov2009-09-121-26/+0
| | | | | | | | | | | | | There is a link hack in linux-user which produces an executable that looks like PIE, but always has text relocations since all object files isn't position-independent (compiled without -fpic/-fpie). Dynamic loader has to do more work to load a binary with text relocations. The best way to keep this functionality is to build a true PIE without text relocations. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix sys-queue.h conflict for goodBlue Swirl2009-09-122-15/+15
| | | | | | | | | | | | | | | Problem: Our file sys-queue.h is a copy of the BSD file, but there are some additions and it's not entirely compatible. Because of that, there have been conflicts with system headers on BSD systems. Some hacks have been introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896, f40d753718c72693c5f520f0d9899f6e50395e94, 96555a96d724016e13190b28cffa3bc929ac60dc and 3990d09adf4463eca200ad964cc55643c33feb50 but the fixes were fragile. Solution: Avoid the conflict entirely by renaming the functions and the file. Revert the previous hacks. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* F_DUPFD_CLOEXEC is not universally availablemalc2009-09-101-0/+2
| | | | | | | The same issue (and the same patch to the byte) was experienced/proposed by Vince Weaver. Signed-off-by: malc <av1474@comtv.ru>
* Fix Sparse warnings: add "static"Blue Swirl2009-09-051-1/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* linux-user: Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit ↵Kirill A. Shutemov2009-08-251-36/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | targets qemu's page table can be incomple if /proc/self/maps is unavailable or host allocating a memory with mmap(), so we can't use it to find free memory area. New version mmap_find_vma() uses mmap() without MAP_FIXED to find free memory. Tested-by: Martin Mohring <martin.mohring@opensuse.org> : quite some time ago this patch had been sent by Kirill to the QEMU ml. At that time, the patch was rejected. Now we found out why the current user mode memory allocator sometimes fails: - Kernel Bug linux/fs/proc/task_mmu.c (fixed after 2.6.27) http://bugzilla.kernel.org/attachment.cgi?id=17219 - use of proc file system to find memory mappings => bad idea So I please apply the attached patch from Kirill to qemu to fix this longstanding bug, because it causes all older linux distros (using kernel 2.6.26 or older) to fail the QEMU memory allocator in user mode. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: zero fstat buffer to initialize nsec fieldsUlrich Hecht2009-08-251-0/+1
| | | | | | | | | | | The fstat implementation does not initialize the nanosecond fields in the stat buffer; this caused funny values to turn up there, preventing, for instance, cp -p from preserving timestamps because utimensat rejected the out-of-bounds nanosecond values. Resetting the entire structure to zero fixes that. Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: fadvise64 implementationUlrich Hecht2009-08-251-3/+14
| | | | | | | good enough to pass all LTP fadvise64 tests Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: enable getdents for > 32-bit systemsUlrich Hecht2009-08-251-5/+1
| | | | | | | | works perfectly fine with the example from getdents(2) and passes the LTP tests (tested with s390x on x86_64 emulation) Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: fcntl fixes for LTPUlrich Hecht2009-08-252-12/+29
| | | | | | | | Fixes swaps on l_pid which were pretty much of random size. Implements F_SETLEASE, F_GETLEASE. Now passes all LTP fcntl tests. Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: fix mq_* compilation problemsNathan Froyd2009-08-251-2/+5
| | | | | | | | | | | mqueue.h is only available if __NR_mq_open is defined. So don't include it unconditionally. Similarly, the mq_* family of syscalls depend on __NR_mq_open. Finally, the copy_{from,to}_user_mq_attr functions should not be defined unconditionally, but only if we're going to use the mq_* syscalls. Signed-off-by: Nathan Froyd <froydnj@codesourcery.com Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* m68k, linux-user: enable sigaltstack()Laurent Vivier2009-08-251-1/+2
| | | | | | | | As setup_frame() and setup_rt_frame() are now implemented we can now enable sigaltstack(). Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* m68k, linux-user: add setup_rt_frameLaurent Vivier2009-08-251-3/+202
| | | | | | | This patch implements setup_rt_frame(). Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* m68k,linux-user: add setup_frameLaurent Vivier2009-08-251-0/+183
| | | | | | | | | | | | This patch adds signals management for linux-user. It implements setup_frame() which allows to call the user signal handler. setup_rt_frame() is always unimplemented. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: add eventfd supportRiku Voipio2009-08-251-0/+15
| | | | | | | | Straightforward implementation. This syscall is rare enough that we don't need to support the odder cases, just disable it if host glibc is too old. Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* Replace local ADDRX/PADDRX macros with TARGET_FMT_lx/plxBlue Swirl2009-08-161-3/+3
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* linux-user: compile envlist.c only onceBlue Swirl2009-08-152-269/+0
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* user: compile path.c only onceBlue Swirl2009-08-152-161/+0
| | | | | | Also merge bsd-user/path.c and linux-user/path.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix symfind.Laurent Desnogues2009-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | this patch fixes an issue in symfind. Assume you have the following symbols: Address Size 0045bca0 00000080 T s0 0045bd20 00000112 T s1 You'll notice that s1 is s0 + size. So the current symfind will find that address 0045bd20 belongs to s0 instead of s1. Laurent Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
* Sparc64: replace tsptr with helper routineIgor Kovalenko2009-08-041-1/+1
| | | | | | | | | | | | | | | | | | | tl and tsptr of members sparc64 cpu state must be changed simultaneously to keep trap state window in sync with current trap level. Currently translation of store to tl does not change tsptr, which leads to corrupt trap state on corresponding trap level. This patch removes tsptr from sparc64 cpu state and replaces all uses with call to helper routine. Changes v0->v1: - reimplemented helper routine with tcg generator - on cpu reset trap type and pstate are populated with power-on reset values, including tl=maxtl Signed-off-by: igor.v.kovalenko@gmail.com Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* linux-user: make FUTEX_* calls honor timeout parameterNathan Froyd2009-08-031-8/+16
| | | | | Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: malc <av1474@comtv.ru>
* linux-user: handle POWERPC_EXCP_STCXNathan Froyd2009-08-031-0/+68
| | | | | | | | We handle conditional stores as an exception so we can ensure that no other thread is changing memory out from underneath us. Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: malc <av1474@comtv.ru>