summaryrefslogtreecommitdiffstats
path: root/linux-user
Commit message (Collapse)AuthorAgeFilesLines
* linux-user: Remove ELFLOAD32.Richard Henderson2010-04-253-40/+1
| | | | | | | | | | | The ABI-specific types used by linux_binprm and image_info are different after forcing TARGET_ABI32 on. Which means that the parameters that load_elf_binary_multi sees are not those that loader_exec passed. This is inherently broken and is more trouble than it's worth fixing. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* linux-user: do_shmdt(): Fix page_set_flags's 2nd arg.takasi-y@ops.dti.ne.jp2010-04-141-1/+1
| | | | | | | | 2nd arg of page_set_flags() should be start+size, but size. Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp> Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: switch default ppc64 CPU to 970fx from 970Aurelien Jarno2010-04-081-1/+1
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Fix compilation with missing inotify_init1Stefan Weil2010-04-011-0/+2
| | | | | | | | | | | | | | | | | Commit c05c7a7306a23a4b01d1606172b142c45caffc92 breaks cross compilation for mips (and other compilations without CONFIG_INOTIFY1): make[1]: Entering directory `/qemu/bin/mips' CC i386-linux-user/syscall.o cc1: warnings being treated as errors /qemu/linux-user/syscall.c: In function ‘do_syscall’: /qemu/linux-user/syscall.c:7067: error: implicit declaration of function ‘sys_inotify_init1’ Cc: Riku Voipio <riku.voipio@nokia.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user/ia64: workaround ia64 strangenessesAurelien Jarno2010-04-012-105/+109
| | | | | | | | | | | ia64 has some strangenesses that need to be workaround: - it has a __clone2() syscall instead of the using clone() one, with different arguments, and which is not declared in the usual headers. - ucontext.uc_sigmask is declared with type long int, while it is actually of type sigset_t. - uc_mcontext, uc_sigmask, uc_stack, uc_link are declared using #define, which clashes with the target_ucontext fields. Change their names to tuc_*, as already done for some target architectures.
* Compile qemu-timer only onceBlue Swirl2010-03-291-1/+1
| | | | | | | | | Arrange various declarations so that also non-CPU code can access them, adjust users. Move CPU specific code to cpus.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* linux-user/ppc: use the Linux register layoutRob Landley2010-03-281-21/+2
| | | | | | | | | | | | | | The dynamic linker converts the Linux layout to the AIX layout and is reentrant so it won't do it a second time if it's already been converted. In short it work just fine with either register layout. OTOH, statically linked binaries expect a Linux layout. Remove code converting the Linux layout to AIX layout so that all binaries are presented the Linux Layout. Signed-off-by: Rob Landley <rob@landley.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: Use RLIMIT_STACK for default stack size.Richard Henderson2010-03-273-8/+19
| | | | | | | | | | | | | | | | | | The current default stack limit of 512kB is far too small; a fair number of gcc testsuite failures (for all guests) are directly attributable to this. Using the -s option in every invocation of the emulator is annoying to say the least. A reasonable compromise seems to be to honor the system rlimit. At least on two Linux distributions, this is set to 8MB and 10MB respectively. If the system does not limit the stack, then we're no worse off than before. At the same time, rename the variable from x86_stack_size and change the ultimate fallback size from 512kB to 8MB. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: Add the syscall id for pselect6 on ARMMichael Casadevall2010-03-261-1/+1
| | | | | | | | As this is now supported in newer linux kernels. Signed-off-by: Michael Casadevall <mcasadevall@ubuntu.com> Signed-off-by: Riku Voipio <riku.voipio@nokia.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: add inotify_init1 syscall supportRiku Voipio2010-03-261-0/+14
| | | | | | | | New syscall which gets actively used when you have a fresh kernel. Signed-off-by: Riku Voipio <riku.voipio@nokia.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Replace assert(0) with abort() or cpu_abort()Blue Swirl2010-03-181-1/+0
| | | | | | | | | When building with -DNDEBUG, assert(0) will not stop execution so it must not be used for abnormal termination. Use cpu_abort() when in CPU context, abort() otherwise. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix build with -DNDEBUG in CFLAGSBlue Swirl2010-03-131-1/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix usermode virtual address typePaul Brook2010-03-122-3/+3
| | | | | | Usermode virtual addresses are abi_ulong, not target_ulong. Signed-off-by: Paul Brook <paul@codesourcery.com>
* linux-user: Fix mmap_find_vma returning invalid addresses.Richard Henderson2010-03-123-33/+82
| | | | | | | | | | | | | Don't return addresses that aren't properly aligned for the guest, e.g. when the guest has a larger page size than the host. Don't return addresses that are outside the virtual address space for the target, by paying proper attention to the h2g/g2h macros. At the same time, place the default mapping base for 64-bit guests (on 64-bit hosts) outside the low 4G. Consistently interpret mmap_next_start in the guest address space. Signed-off-by: Richard Henderson <rth@twiddle.net>
* linux-user: Use h2g_valid in qemu_vmalloc.Richard Henderson2010-03-121-5/+4
| | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
* Update to a hopefully more future proof FSF addressBlue Swirl2010-03-0712-24/+12
| | | | | | | | See also 8167ee883931cb20c6264fc19d040ce2dc6ceaaa, 530e7615ce3c01882e582c84dc6304ab98a3d5c5 and fad6cb1a565bb73f83fc0e2654489457b489e436. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* linux-user: Save/restore fpu registers to signal context on sh4takasi-y@ops.dti.ne.jp2010-03-061-8/+21
| | | | | | | | As "todo" comment in source code. And modify restore_sigcontext() to have three args as kernel's does. Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: Fix syscall pipe2() retval on sh4takasi-y@ops.dti.ne.jp2010-03-061-3/+6
| | | | | | | | | On linux/sh4 pipe() return values by r0:r1 as SH C calling convention. pipe2() return values on memory as traditional unix way. Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Disassembler symbol lookup fixPaul Brook2010-03-011-2/+2
| | | | | | Fix function signature for userspace disassembler symbol lookup. Signed-off-by: Paul Brook <paul@codesourcery.com>
* alpha-linux-user: Implement signals.Richard Henderson2010-02-285-34/+481
| | | | | | | | | | Move userland PALcode handling into linux-user main loop so that we can send signals from there. This also makes alpha_palcode.c system-level only, so don't build it for userland. Add defines for GENTRAP PALcall mapping to signals. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-alpha: Reduce internal processor registers for user-mode.Richard Henderson2010-02-231-3/+1
| | | | | | | | | | | | The existing set of IPRs is totally irrelevant to user-mode emulation. Indeed, they most are irrelevant to implementing kernel-mode emulation, and would only be relevant to PAL-mode emulation, which I suspect that no one will ever attempt. Reducing the set of processor registers reduces the size of the CPU state. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Add cpu model configuration support..john cooper2010-02-221-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a reimplementation of prior versions which adds the ability to define cpu models for contemporary processors. The added models are likewise selected via -cpu <name>, and are intended to displace the existing convention of "-cpu qemu64" augmented with a series of feature flags. A primary motivation was determination of a least common denominator within a given processor class to simplify guest migration. It is still possible to modify an arbitrary model via additional feature flags however the goal here was to make doing so unnecessary in typical usage. The other consideration was providing models names reflective of current processors. Both AMD and Intel have reviewed the models in terms of balancing generality of migration vs. excessive feature downgrade relative to released silicon. This version of the patch replaces the prior hard wired definitions with a configuration file approach for new models. Existing models are thus far left as-is but may easily be transitioned to (or may be overridden by) the configuration file representation. Proposed new model definitions are provided here for current AMD and Intel processors. Each model consists of a name used to select it on the command line (-cpu <name>), and a model_id which corresponds to a least common denominator commercial instance of the processor class. A table of names/model_ids may be queried via "-cpu ?model": : x86 Opteron_G3 AMD Opteron 23xx (Gen 3 Class Opteron) x86 Opteron_G2 AMD Opteron 22xx (Gen 2 Class Opteron) x86 Opteron_G1 AMD Opteron 240 (Gen 1 Class Opteron) x86 Nehalem Intel Core i7 9xx (Nehalem Class Core i7) x86 Penryn Intel Core 2 Duo P9xxx (Penryn Class Core 2) x86 Conroe Intel Celeron_4x0 (Conroe/Merom Class Core 2) : Also added is "-cpu ?dump" which exhaustively outputs all config data for all defined models, and "-cpu ?cpuid" which enumerates all qemu recognized CPUID feature flags. The pseudo cpuid flag 'check' when added to the feature flag list will warn when feature flags (either implicit in a cpu model or explicit on the command line) would have otherwise been quietly unavailable to a guest: # qemu-system-x86_64 ... -cpu Nehalem,check warning: host cpuid 0000_0001 lacks requested flag 'sse4.2|sse4_2' [0x00100000] warning: host cpuid 0000_0001 lacks requested flag 'popcnt' [0x00800000] A similar 'enforce' pseudo flag exists which in addition to the above causes qemu to error exit if requested flags are unavailable. Configuration data for a cpu model resides in the target config file which by default will be installed as: /usr/local/etc/qemu/target-<arch>.conf The format of this file should be self explanatory given the definitions for the above six models and essentially mimics the structure of the static x86_def_t x86_defs. Encoding of cpuid flags names now allows aliases for both the configuration file and the command line which reconciles some Intel/AMD/Linux/Qemu naming differences. This patch was tested relative to qemu.git. Signed-off-by: john cooper <john.cooper@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix strace or FUTEX_PRIVATE_FLAGPaul Brook2010-02-191-1/+3
| | | | | | | FUTEX_PRIVATE_FLAG is a bit orred with an existing futex op, not a distinct value. Signed-off-by: Paul Brook <paul@codesourcery.com>
* linux-user: adapt uname machine to emulated CPULoïc Minier2010-02-063-1/+75
| | | | | | | | | This patch for linux-user adapts the output of the emulated uname() syscall to match the configured CPU. Tested with x86, x86-64 and arm emulation. Signed-off-by: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Loïc Minier <lool@dooz.org>
* mmap_frag() users only check for -1 errorJuan Quintela2010-01-261-1/+1
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* linux-user/mmap.c: fix warnings with _FORTIFY_SOURCEKirill A. Shutemov2010-01-261-2/+4
| | | | | | | | | | | | | | CC i386-linux-user/mmap.o cc1: warnings being treated as errors /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c: In function 'mmap_frag': /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c:253: error: ignoring return value of 'pread', declared with attribute warn_unused_result /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c: In function 'target_mmap': /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c:477: error: ignoring return value of 'pread', declared with attribute warn_unused_result make[1]: *** [mmap.o] Error 1 Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* fix linux-user microblaze ELF_ARCH definitionMike Frysinger2010-01-171-1/+1
| | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* alpha: fix stat64 issueVince Weaver2010-01-141-1/+1
| | | | | | | | | | | | | | | | The stat64/fstat64 syscalls are broken for alpha linux-user. This is because Alpha, even though it is native 64-bits, has a stat64 syscall that is different than regular stat. This means that the "TARGET_LONG_BITS==64" check in syscall.c isn't enough. Below is a patch that fixes things for me, although it might not be the cleanest fix. This issue keeps sixtrack and fma3d spec2k benchmarks from running. Signed-off-by: Vince Weaver <vince@csl.cornell.edu> Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: fix build with gcc-4.1Aurelien Jarno2009-12-241-0/+2
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* PPC: Make DCR uint32_tAlexander Graf2009-12-211-2/+2
| | | | | | | | | | | For what I know DCR is always 32 bits wide, so we should also use uint32_t to pass it along the stacks. This fixes a warning when compiling qemu-system-ppc64 with KVM enabled, making it compile without --disable-werror Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* PPC64: Fix alternate timebaseAurelien Jarno2009-12-211-2/+2
| | | | | | | Fix the alternate time base the same way as the default timebase. SPR_ATBL should return a 64-bit value on 64 bit implementations. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* PPC64: Fix timebaseAlexander Graf2009-12-211-2/+2
| | | | | | | | | | | | | | | On PPC we have a 64-bit time base. Usually (PPC32) this is accessed using two separate 32 bit SPR accesses to SPR_TBU and SPR_TBL. On PPC64 the SPR_TBL register acts as 64 bit though, so we get the full 64 bits as return value. If we only take the lower ones, fine. But Linux wants to see all 64 bits or it breaks. This patch makes PPC64 Linux work even after TB crossed the 32-bit boundary, which usually happened a few seconds after bootup. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: Add aliases for some Alpha syscallsRichard Henderson2009-12-211-0/+8
| | | | | | | | | Alpha always used 32-bit uids, but never renamed the syscalls to match i386 when 32-bit uids were added there. This enables the proper bits in syscall.c. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: add core dump support for SHNathan Froyd2009-12-191-0/+33
| | | | | Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: add core dump support for M68KNathan Froyd2009-12-191-0/+29
| | | | | Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: add core dump support for MIPSNathan Froyd2009-12-191-0/+46
| | | | | Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: add core dump support for PPCNathan Froyd2009-12-191-0/+26
| | | | | Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: fix ARM core dumps on opposite-endian hostsNathan Froyd2009-12-191-19/+19
| | | | | Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: commonify definitions of target typedefsNathan Froyd2009-12-191-22/+10
| | | | | | | | | There's no sense in separately declaring target_{elf_greg,uid,gid,pid}_t for every architecture. Just declare them once with appropriate USE_UID16 handling. Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: fix ELF_USE_CORE_DUMP/USE_ELF_CORE_DUMP confusionNathan Froyd2009-12-191-1/+1
| | | | | Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: use TARGET_ABI_FMT_lx to print abi_ulong typesAurelien Jarno2009-12-191-1/+1
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: cleanup force_sig() callsRiku Voipio2009-12-191-20/+20
| | | | | | | | | Force_sig should be always called with TARGET_ signals. Not that it really matters with SEGV, so this patch is just for cleanup and improving consistency. Signed-off-by: Riku Voipio <riku.voipio@nokia.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: Fix mmap_lock orderingRiku Voipio2009-12-191-2/+2
| | | | | | | | | mmap_lock() can be called while tb_lock() is being held. To avoid deadlock when one thread is holding mmap_lock and another tb_lock, _always_ lock first tb_lock(). Signed-off-by: Riku Voipio <riku.voipio@nokia.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-alpha: Fixes for alpha-linux syscalls.Richard Henderson2009-12-132-10/+339
| | | | | | | | | | | | | | | | | | 1. Add correct definitions of error numbers. 2. Implement SYS_osf_sigprocmask 3. Implement SYS_osf_get/setsysinfo for IEEE_FP_CONTROL. This last requires exposing the FPCR value to do_syscall. Since this value is actually split up into the float_status, expose routines from helper.c to access it. Finally, also add a float_exception_mask field to float_status. We don't actually use it to control delivery of exceptions to the emulator yet, but simply hold the value that we placed there when loading/storing the FPCR. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-alpha: Drop bogus UNIQ initial value on Linux.Richard Henderson2009-12-131-3/+0
| | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* 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>
OpenPOWER on IntegriCloud