History | View | Annotate | Download (118.2 kB)
fix spelling in linux-user sub directory
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>
ppc64-linux-user: Fix syscall return type.
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>
sparc-linux-user: Handle SIGILL.
sparc-linux-user: Fixup sending SIGSEGV
linux-user: Fix broken "-version" option
Fix the "-version" option, which was accidentally broken in commitfc9c541: * 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...
introduce environment variables for all qemu-user options
(Edits by Riku Voipio to apply to current HEAD)
Rework option parsing code for linux-user in a table-driven manner to allowenvironment variables for all commandline options.
Also generate usage() output from option table....
linux-user: Verify MIPS syscall arguments
On MIPS, some syscall arguments are taken from the stack. This patch addsverification such that do_syscall() is only invoked if all argumentshave been successfully taken from the stack.
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>...
linux-user: Fix MIPS indirect syscall handling
Change the number of argument for MIPS sys_syscall from 0 to 8. Thisallows arguments for indirect syscalls to be processed correctly.
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
linux-user: Exit with an error if we couldn't set up gdbserver
If gdbserver_start() fails (usually because we couldn't bind to therequested TCP port) then exit qemu rather than blithely continuing.This brings the linux-user behaviour in to line with system mode....
linux-user: Implement new ARM 64 bit cmpxchg kernel helper
Linux 3.1 will have a new kernel-page helper for ARM implementing64 bit cmpxchg. Implement this helper in QEMU linux-user mode: * Provide kernel helper emulation for 64bit cmpxchg...
microblaze-user: Deliver SIGFPE on div by zero
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Avoid allocating TCG resources in non-TCG mode
Do not allocate TCG-only resources like the translation buffer whenrunning over KVM or XEN. Saves a "few" bytes in the qemu address spaceand is also conceptually cleaner.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
user: Restore debug usage message for '-d ?' in user mode emulation
The code which prints the debug usage message on '-d ?' for *-userhas to come before the check for "not enough arguments", so that"qemu-foo -d ?" prints the list of possible debug log items rather than...
mips: null pointer deref should segfault
Dereferencing a null pointer causes an exception 0xC (EXCP_AdEL)instead of EXCP_TLBL. This should also trigger a segfault.
Signed-off-by: Wesley W. Terpstra <terpstra@debian.org>Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
mips: missing syscall returns wrong errno
Return -TARGET_ENOSYS instead of -ENOSYS from linux-user/main.c * Caused strange 'Level 2 synchronization messages' instead ofcorrectly reporting the syscall was missing. * Made glibc simply fail instead of using older syscalls...
mips: sigaltstack args
The syscall sigaltstack takes two parameters, not zero. This patchshould have no impact as only values above 4 influence the runtimebehaviour. Nevertheless, it is wrong.
linux-user: Add syscall numbers from kernel 2.6.39.2
Add syscall numbers for new syscall numbers; this brings usinto line with Linux 2.6.39.2.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
user: Fix -d debug logging for usermode emulation
Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging
Remove exec-all.h include directives
Most exec-all.h include directives are now useless, remove them.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
linux-user: Bump do_syscall() up to 8 syscall arguments
On 32 bit MIPS a few syscalls have 7 arguments, and so to callthem via NR_syscall the guest needs to be able to pass 8 argumentsto do_syscall(). Raise the number of arguments do_syscall() takesaccordingly....
Command line support for altering the log file location
Add command line support for logging to a location other than /tmp/qemu.log.
With logging enabled (command line option -d), the log is written tothe hard-coded path /tmp/qemu.log. This patch adds support for writing...
target-alpha: Rationalize internal processor registers.
Delete all the code that tried to emulate the real IPRs of someunnamed CPU. Replace those with just 3 slots that we can use tocommunicate trap information between the helper functions thatsignal exceptions and the OS trap handler....
target-alpha: Tidy exception constants.
There's no need to attempt to match EXCP_* values with PALcode entrypoint offsets. Instead, compress all the values to make for moreefficient switch statements within QEMU.
We will be doing TLB fill within QEMU proper, not within the PALcode,...
Merge branch 's390-next' of git://repo.or.cz/qemu/agraf
Delete unused tb_invalidate_page_range
tb_invalidate_page_range() was intended to be used to invalidate anarea of a TB which the guest explicitly flushes from i-cache. However,QEMU detects writes to code areas where TBs have been generated, sohis has never been useful....
s390x: s390x-linux-user support
This patch adds support for running s390x binaries in the linux-user emulationcode.
Signed-off-by: Ulrich Hecht <uli@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>
Fix spelling in comments (intruction -> instruction)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
unicore32: necessary modifications for other files to support unicore32
Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
microblaze: Correct ec mask in debug print
linux-user: Add support for -version option
Add support to the linux-user qemu for the -version command lineoption, bringing it into line with the system emulation qemu.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
ARM: fix ldrexd/strexd
Correct ldrexd and strexd code to always read and write thehigh word of the 64-bit value from addr+4.Also make ldrexd and strexd agree that for a 64 bit value theaddress in env->exclusive_addr is that of the low word.
This fixes the issues reported in...
linux-user: fix memory leaks with NPTL emulation
Running programs that create large numbers of threads, such as thissnippet from libstdc++'s pthread7-rope.cc:
const int max_thread_count = 4; const int max_loop_count = 10000; ... for (int j = 0; j < max_loop_count; j++)...
Add new user mode option -ignore-environment
An empty environment is sometimes useful in user mode.The new option provides it for linux-user and bsd-user(darwin-user still has no environment related options).
The patch also adds the documentation for other...
microblaze: User-mode emulation of hw-excp signals
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
linux-user: display cpu list.
As it is done for qemu-system with "-cpu ?", when cpu_list_id() is missingfor a target, call cpu_list() instead.
Signed-off-by: Laurent Vivier <laurent@vivier.eu>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
rename CONFIG_QEMU_PREFIX
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
linux-user: honor low bit of entry PC for MIPS
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Pre-allocate guest address space
Allow pre-allocation of the guest virtual address space in usermode emulation.
Signed-off-by: Paul Brook <paul@codesourcery.com>
alpha-linux-user: Fill in SI_CODE for SIGSEGV.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg: Initialize the prologue after GUEST_BASE is fixed.
This will allow backends to make intelligent choices about howto implement GUEST_BASE.
alpha-linux-user: Fix sigprocmask.
Alpha passes oldset by value in a register, and returns the newsetas the return value; as compared to the standard implementation inwhich both are passed by reference. This requires being able todistinguish negative return values that are not errors. Do this in...
alpha-linux-user: Fix siginfo.si_addr for SIGSEGV and SIGBUS.
linux-user: rlimit conversion between host and target.
rlim_t conversion between host and target added.Otherwise there are some incorrect case like- RLIM_INFINITY on 32bit target > 64bit host. RLIM_INFINITY on 64bit host > mips and sparc target ? Big value(for 32bit target) on 64bit host -> 32bit target....
target-alpha: Implement rs/rc properly.
This is a per-cpu flag; there's no need for a spinlock of any kind.
We were also failing to manipulate the flag with $31 as a target regand failing to clear the flag on execution of a return-from-interruptinstruction....
target-alpha: Fix load-locked/store-conditional.
Use an exception plus start_exclusive to implement the compare-and-swap.This follows the example set by the MIPS and PPC ports.
linux-user: Fix Sparc64 syscall returns.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
linux-user: switch default ppc64 CPU to 970fx from 970
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Compile qemu-timer only once
Arrange various declarations so that also non-CPU code can accessthem, adjust users.
Move CPU specific code to cpus.c.
linux-user: Use RLIMIT_STACK for default stack size.
The current default stack limit of 512kB is far too small; a fairnumber of gcc testsuite failures (for all guests) are directlyattributable to this. Using the -s option in every invocation ofthe emulator is annoying to say the least....
linux-user: Fix mmap_find_vma returning invalid addresses.
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'treturn addresses that are outside the virtual address space for the...
alpha-linux-user: Implement signals.
Move userland PALcode handling into linux-user main loop so thatwe can send signals from there. This also makes alpha_palcode.csystem-level only, so don't build it for userland. Add definesfor GENTRAP PALcall mapping to signals....
target-alpha: Reduce internal processor registers for user-mode.
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...
Add cpu model configuration support..
This is a reimplementation of prior versions which addsthe 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...
linux-user: fix build with gcc-4.1
PPC: Make DCR uint32_t
For what I know DCR is always 32 bits wide, so we should also use uint32_t topass it along the stacks.
This fixes a warning when compiling qemu-system-ppc64 with KVM enabled, makingit compile without --disable-werror
Signed-off-by: Alexander Graf <agraf@suse.de>...
PPC64: Fix alternate timebase
Fix the alternate time base the same way as the default timebase. SPR_ATBLshould return a 64-bit value on 64 bit implementations.
PPC64: Fix timebase
On PPC we have a 64-bit time base. Usually (PPC32) this is accessed usingtwo 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 full64 bits as return value. If we only take the lower ones, fine. But Linux...
linux-user: Fix mmap_lock ordering
mmap_lock() can be called while tb_lock() is being held. Toavoid deadlock when one thread is holding mmap_lock and anothertb_lock, always lock first tb_lock().
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix ARM userspace strex implementation.
Add missing break.
ARM atomic ops rewrite
Implement ARMv6 atomic ops (ldrex/strex) using the same trick as PPC.
target-mips: rename CP0_LLAddr into lladdr
The variable CP0_LLAddr represent the full lladdr, not the actualregister value, which is only part of this value and depends on theCPU.
user: move CPU reset call to main.c for x86/PPC/Sparc
Revert "Get rid of _t suffix"
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. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
Revert "Fix Sparc/Linux host breakage by df70204db53e3611af986f434e74a882bce190ca"
This reverts commit 91b40c5be84a478e98c0416325844a7f66d0efae.
Fix Sparc/Linux host breakage by df70204db53e3611af986f434e74a882bce190ca
While i386, x86_64 and Sparc64/OpenBSD still worked afterdf70204db53e3611af986f434e74a882bce190ca, Sparc32 and Sparc64 Linux hostsbroke.
Partially revert the commit: make the restored code conditional to...
Fix text relocations in linux-user targets
There is a link hack in linux-user which produces an executable thatlooks like PIE, but always has text relocations since all object filesisn't position-independent (compiled without -fpic/-fpie). Dynamic loader...
Replace local ADDRX/PADDRX macros with TARGET_FMT_lx/plx
Sparc64: replace tsptr with helper routine
tl and tsptr of members sparc64 cpu state must be changedsimultaneously to keep trap state window in sync with currenttrap level. Currently translation of store to tl does not changetsptr, which leads to corrupt trap state on corresponding...
linux-user: handle POWERPC_EXCP_STCX
We handle conditional stores as an exception so we can ensure that noother thread is changing memory out from underneath us.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>Signed-off-by: malc <av1474@comtv.ru>
rename USE_NPTL to CONFIG_USE_NPTL
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Userspace guest address offsetting
Re-implement GUEST_BASE support.Offset guest ddress space by default if the guest binary containsregions below the host mmap_min_addr.Implement support for i386, x86-64 and arm hosts.
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>...
Update to a hopefully more future proof FSF address
Avoid SIGSEGV when dumping cpu state without enabled logging
consolidate user cpu_{in, out}[bwl] into ioport-user.c
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge commit 'linux-user/linux-user-for-upstream' into tmp-staging
MIPS atomic instructions
Implement MIPS ll/sc instructions using atomic compare+exchange.
Fix MIPS sys_clone
The clone syscall takes 6 args.
linux-user: increment MAX_ARG_PAGES
There's a error When doing something like that :find / -type f -print0 | xargs -0 echo
[ done in a arm chroot with qemu-arm and linux binfmt stuff or withfind / -type f -print0 | qemu-arm -L <path> <path>/usr/bin/xargs -0...
linux-user: implemented ELF coredump support for ARM target
When target process is killed with signal (such signal thatshould dump core) a coredump file is created. This file issimilar than coredump generated by Linux (there are few exceptionsthough)....
microblaze: linux-user support.
linux-user: ppc signal handling
Implement setup_{,rt_}frame and do_{,rt_}sigreturn for PPC 32-bit. Usethe same TARGET_QEMU_ESIGRETURN hack as for MIPS to avoid clobberingregister state on a sigreturn.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>...
Replace gcc variadic macro extension with C99 version
MIPS signal handling fixes.
Also fixes a register corruption bug in do_sigreturn. When "returning" from sigreturn we are actually restoring the virtual cpu state from thesignal frame. This is actually surprisingly hard to observe in practice.
Typically an thread be blocked in a FUTEX_WAIT call when the signal arrives,...
MIPS: Raise SIGSEGV, not SIGILL when an access faults.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7193 c046a42c-6fe2-441c-8c8c-71466251a162
linux-user: add support for passing contents of argv0
Added switch -0 (zero) which can be used to pass argv0 totarget process. The main use is for a binfmt_misc wrapper whenthe "P - preserve-argv0" setting is used.
From: Mika Westerberg
Enable generic accepts-anything cpu by default for usermode emulation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7051 c046a42c-6fe2-441c-8c8c-71466251a162
Add --with-pkgversion.Allows distributors to identify their builds without needing to hack thesources.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7036 c046a42c-6fe2-441c-8c8c-71466251a162
Add new command line option -singlestep for tcg single stepping.
This replaces a compile time option for some targets and addsthis feature to targets which did not have a compile time option.
Add monitor command to enable or disable single step mode.
Modify monitor command "info status" to display single step mode....
Use a dedicated function to request exit from execution loop
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6762 c046a42c-6fe2-441c-8c8c-71466251a162
The _exit syscall is used for both thread termination in NPTL applications,and process termination in legacy applications. Try to guess which we wantbased on the presence of multiple threads.
Also implement locking when modifying the CPU list.
Signed-off-by: Paul Brook <paul@codesourcery.com>...
Flush stdout after printing usage()
Fixes qemu-arm|grep cpu - with _exit() getting output from qemu --helpis a bit random. Since no atexit() handlers are registered for user modeemulation, just use exit() instead.
Fix crash caused by missing command line arguments
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6580 c046a42c-6fe2-441c-8c8c-71466251a162
linux-user: identify running binary in /proc/self/exe
Some applications like to test /proc/self/exe to findout who they are. Fake the result of readlink() forthem. Use realpath() to return full path to binary(which the links /proc/self/exe are)
linux-user: Add generic env variable handling
Adds support for qemu to modify target process environmentvariables using -E and -U commandline switches. This replaceseventually the -drop-ld-preload flag.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>...
Fix user emulator breakage, based on patch by Riku Voipio
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6371 c046a42c-6fe2-441c-8c8c-71466251a162
Convert references to logfile/loglevel to use qemu_log*() macros
This is a large patch that changes all occurrences of logfile/loglevelglobal variables to use the new qemu_log*() macros.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...