History | View | Annotate | Download (136.3 kB)
linux-user: AArch64: Fix exclusive store of the zero register
Signed-off-by: Janne Grunau <j@jannau.net>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target-arm: Widen exclusive-access support struct fields to 64 bits
In preparation for adding support for A64 load/store exclusive instructions,widen the fields in the CPU state struct that deal with address and data valuesfor exclusives from 32 to 64 bits. Although in practice AArch64 and AArch32...
target-arm: A64: support for ld/st/cl exclusive
This implement exclusive loads/stores for aarch64 along the lines ofarm32 and ppc implementations. The exclusive load remembers the addressand loaded value. The exclusive store throws an an exception which uses...
target-arm: Widen thread-local register state fields to 64 bits
The common pattern for system registers in a 64-bit capable ARMCPU is that when in AArch32 the cp15 register is a view of thebottom 32 bits of the 64-bit AArch64 system register; writes in...
linux-user: Use qemu_getauxval for AT_EXECFD
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Richard Henderson <rth@twiddle.net>
util: Use qemu_getauxval in linux qemu_cache_utils_init
With this we no longer pass down envp, and thus all systems can havethe same void prototype. So also eliminate a useless thunk.
osdep: Create qemu_getauxval and qemu_init_auxval
Abstract away dependence on a system implementation of getauxval.
Signed-off-by: Richard Henderson <rth@twiddle.net>
cpu: Drop cpu_model_str from CPU_COMMON
Since this is only read in cpu_copy() and linux-user has a globalcpu_model, drop the field from generic code.
Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Move cpu_copy() into linux-user
It is only used there and is deemed very fragile if not incorrect in itscurrent memcpy() form. Moving it into linux-user will allow to moveparts into target_cpu.h headers and only copy what the ABI mandates.
linux-user: add support of binfmt_misc 'O' flag
The binfmt_misc module can calculate the credentials and securitytoken according to the binary instead of to the interpreter if the'C' flag is enabled.
To be able to execute non-readable binaries, this flag implies 'O'...
linux-user: Check type of microMIPS break instruction
microMIPS instructions that cause breakpoint exceptions come in16-bit and 32-bit variants. When handling exceptions caused bysuch instructions, the instruction type needs to be taken intoaccount when extracting the break code....
mips-linux-user: Adjust names in mips_syscall_args
The name field of MIPS_SYS isn't actually used; it's just documentation.But adjust the umount entries to match mips/syscall_nr.h anyway.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user: Allow targets to specify a minimum uname release
For newer target architectures, glibc can be picky about the kernelversion: for example, it will not run on an aarch64 system unlessthe kernel reports itself as at least 3.8.0. Accommodate this by...
linux-user: Add AArch64 support
This patch adds support for AArch64 in all the small corners oflinux-user (primarily in image loading and startup code).
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: John Rigby <john.rigby@linaro.org>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
linux-user: Add cpu loop for AArch64
Add the main linux-user cpu loop for AArch64. Since AArch64has a different system call interface, doesn't need to worryabout FPA emulation and may in the future keep the prefetch/dataabort information in different system registers, it's simplest...
cpu: Use QTAILQ for CPU list
Introduce CPU_FOREACH(), CPU_FOREACH_SAFE() and CPU_NEXT() shorthandmacros.
linux-user: correct argument number for sys_mremap and sys_splice
sys_mremap missed 5th argument (new_address), which caused examples thatremap to a specific address to fail.sys_splice missed 5th and 6th argument which caused different examples tofail....
linux-user: Avoid redundant ENV_GET_CPU()
This fixes a mismerge in 874ec3c5b3821bb964f9f37b2f930f2a9ce51652.
Acked-by: Riku Voipio <riku.voipio@iki.fi>Signed-off-by: Andreas Färber <afaerber@suse.de>
Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging
linux-user: Handle compressed ISA encodings when processing MIPS exceptions
Decode trap instructions during the handling of an EXCP_BREAK or EXCP_TRAPaccording to the current ISA mode.
Signed-off-by: Kwok Cheung Yeung <kcy@codesourcery.com>Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
gdbstub: Change gdb_handlesig() argument to CPUState
Prepares for changing GDBState::c_cpu to CPUState.
linux-user: Avoid conditional cpu_reset()
Some CPUs reset as part of cpu_init(), some others were resetafterwards, some not at all. While some targets didn't implement acpu_[state_]reset() function, QOM cpu_reset() is always available.There's nothing wrong with resetting twice on startup, so drop...
configure: Make NPTL non-optional
Now all linux-user targets support building with NPTL, we can make itmandatory. This is a good idea because: * NPTL is no longer new and experimental; it is completely standard * in practice, linux-user without NPTL is nearly useless for...
linux-user: declare sys_futex to have 6 arguments
sys_futex has 6 arguments, and all of these need to be copied. Fix incorrectdeclaration in the mips_syscall_args array.
This change fixes the cases where the 5th and 6th arguments have non-zerovalue and have importance. An example is a Linux implementation of...
log: Change log_cpu_state[_mask]() argument to CPUState
Since commit 878096eeb278a8ac1ccd6667af73e026f29b4cf5 (cpu: Turncpu_dump_{state,statistics}() into CPUState hooks) CPUArchState is nolonger needed.
Add documentation and make the functions available through qemu/log.h...
linux-user: Change thread_env to CPUState
cpu: Make first_cpu and next_cpu CPUState
Move next_cpu from CPU_COMMON to CPUState.Move first_cpu variable to qom/cpu.h.
gdbstub needs to use CPUState::env_ptr for now.cpu_copy() no longer needs to save and restore cpu_next.
Acked-by: Paolo Bonzini <pbonzini@redhat.com>...
cpu: Change cpu_exit() argument to CPUState
It no longer depends on CPUArchState, so move it to qom/cpu.c.
cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks
Make cpustats monitor command available unconditionally.
Prepares for changing kvm_handle_internal_error() and kvm_cpu_exec()arguments to CPUState.
main: use TARGET_ARCH only for the target-specific #define
Everything else needs to match the executable name, which isTARGET_NAME.
Before: $ sh4eb-linux-user/qemu-sh4eb --help usage: qemu-sh4 [options] program [arguments...] Linux CPU emulator (compiled for sh4 emulation)...
target-i386: Replace cpuid_*features fields with a feature word array
This replaces the feature-bit fields on both X86CPU and x86_def_tstructs with an array.
With this, we will be able to simplify code that simply does the sameoperation on all feature words (e.g. kvm_check_features_against_host(),...
linux-user: Fix layout of usage table to account for option text
The linux-user usage message attempts to line up the columns inits table by calculating the maximum width of any item in them.However for the 'Argument' column it was only accounting for the...
mips-linux-user: Fix n32 and n64 syscalls
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-mips: Translate breaks and traps into the appropriate signal
GCC and GAS are capable of generating traps or breaks to check fordivision by zero. Additionally, GAS is capable of generating trapsor breaks to check for overflow on certain division and multiplication...
qemu-log: default to stderr for logging output
Switch the default for qemu_log logging output from "/tmp/qemu.log" to stderr. This is an incompatible change in some sense, but loggingis mostly used for debugging purposes so it shouldn't affect production...
cpu: Move running field to CPUState
Pass CPUState to cpu_exec_{start,end}() functions.
qemu-log: Rename the public-facing cpu_set_log function to qemu_set_log
Rename the public-facing function cpu_set_log to qemu_set_log. Thisrequires us to rename the internal-only qemu_set_log() todo_qemu_set_log().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
qemu-log: Rename cpu_str_to_log_mask to qemu_str_to_log_mask
Rename cpu_str_to_log_mask() to qemu_str_to_log_mask(), sincethe qemu_log functionality is no longer restricted to TCG CPUdebug logging.
qemu-log: Abstract out "print usage message about valid log categories"
Abstract out the "print a human readable list of all thevalid log categories" functionality which is currently duplicatedin three separate places. (We leave the monitor.c help_cmd()...
qemu-log: Unify {cpu_set,set_cpu}_log_filename as qemu_set_log_filename
The qemu_log() functionality is no longer specific to TCG CPU debug logs.Rename cpu_set_log_filename() to qemu_set_log_filename() and drop thepointless wrapper set_cpu_log_filename()....
TCG: Move translation block variables to new context inside tcg_ctx: tb_ctx
It's worth to clean-up translation blocks variables and move theminto one context as was suggested by Swirl.Also if we use this context directly inside tcg_ctx, then itspeeds up code generation a bit....
linux-user: bsd-user: Don't reset X86CPU twice
Since commit 65dee38052597b6285eb208125369f01b29ba6c1 (target-i386:move cpu_reset and reset callback to cpu.c) the x86 CPU is reset throughcpu_init() but was still reset immediately after in linux-user and...
Merge branch 's390-reorg' of git://repo.or.cz/qemu/rth
linux-user: fix mips 32-on-64 prealloc case
MIPS only supports 31 bits of virtual address space for user space, so let'smake sure we stay within that limit with our preallocated memory block.
This fixes the MIPS user space targets when executed without command line...
target-s390: Reorg exception handling
Make the user path more like the system path. Prepare for more kindsof runtime exceptions. Rename ILC to ILEN to make it clear that wewant to pass around a full instruction length, rather than a "code" that happens to be stored one bit left in a larger field....
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target-mips: Add ASE DSP resources access check
Add MIPS ASE DSP resources access check.
Signed-off-by: Jia Liu <proljc@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Merge branch 'linux-user-for-upstream' of git://git.linaro.org/people/rikuvoipio/qemu
microblaze: Update PC before simulating syscall
Fixes a clone() emulation bug were the new thread startsat the point of the syscall and thus clones in a loop.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
target-sparc: Don't compute full flags value so often
Avoid speculatively computing flags before every potentially trappingoperation and instead do the flags computation when a trap actuallyoccurs. This gives approximately 30% speedup in emulation.
Signed-off-by: Richard Henderson <rth@twiddle.net>...
linux-user: If loading fails, print error as string, not number
If the attempt to load the guest executable fails, print theerror message as a string, not a number. This requires us tofix a couple of places in loader_exec() where we were returning-1 instead of a valid negative errno....
Drop cpu_list_id macro
Since the only user of the extended cpu_list_id() formatwas the x86 ?model/?dump/?cpuid output, we can drop itcompletely.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>...
linux-user: Remove #if 0'd cpu_get_real_ticks() definition
Remove the cpu_get_real_ticks() definition from linux-user/main.c.This has been disabled via #if 0 and unused since commit 1dce7c3c22in 2006; the definitions we actually use are in qemu-timer.h....
linux-user: Clarify "Unable to reserve guest address space" error
Now that we default to reserving nearly 4GB of RAM for the guestaddress space when running a 32 bit linux-user guest on 64 bithosts, users are much more likely to run into it. Reword the...
linux-user: arg_table need not have global scope
Declare arg_table to be "static const", and adjust the two usersto also be const.
Signed-off-by: Jim Meyering <meyering@redhat.com>Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user: ARM: Ignore immediate value for svc in thumb mode
When running in thumb mode, Linux doesn't evaluate the immediate valueof the svc instruction, but instead just always assumes the syscall numberto be in r7.
This fixes executing go_bootstrap while building go for me....
linux-user: Use init_guest_space when -R and -B are specified
Roll the code used to initialize the guest memory space when -Ror -B is used into 'init_guest_space' and then call 'init_guest_space'from the driver. This way the reserved guest memory space can...
unicore32-softmmu: Make UniCore32 cpuid & exceptions correct and runable
This patch initializes the cpuid to exactly correct value becauselinux kernel will check it.In addition, the exception types are specified in proper situations.Then it could make exceptions generated correctly and timely....
alpha-linux-user: Fix a3 error return with v0 error bypass.
We were failing to initialize a3 for syscalls that bypass thenegative return value error check.
alpha-linux-user: Fix signal handling
Proper signal numbers were not defined, and EXCP_INTERRUPTwas unhandled, leading to all sorts of subtle confusion.
Support 'help' as a synonym for '?' in command line options
For command line options which permit '?' meaning 'please list thepermitted values', add support for 'help' as a synonym, by abstractingthe check out into a helper function.
This change means that in some cases where we were being lazy in...
target-or32: Add linux user support
Add QEMU OpenRISC linux user support.
Signed-off-by: Jia Liu <proljc@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qemu-log: cleanup
Don't use global variables directly but via accessor functions. Rename globals.
Convert macros to functions, add GCC format attributes.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
linux-user: Use cpu_reset() after cpu_init() / cpu_copy()
Eliminates cpu_state_reset() usage.
Userspace ARM BE8 support
Add support for ARM BE8 userspace binaries.i.e. big-endian data and little-endian code.In principle LE8 mode is also possible, but AFAIK has never actuallybeen implemented/used.
System emulation doesn't have any useable big-endian board models,...
linux-user: resolve reserved_va vma downwards
After consulting with Paul Brook, we concluded that it's best to searchthe VMA space downwards, so that we don't even get the chance to conflictwith the brk range.
This patch resolves a bunch of allocation conflicts when using -R....
linux-user: reserve 4GB of vmem for 32-on-64
When running 32-on-64 bit guests, we should always reserve as muchvirtual memory as we possibly can for the guest process, so it cannever overlap with QEMU address space.
Fortunately we already have the infrastructure for that. All that's...
linux-user: target_argv is placed on ts->bprm->argv and can't be freed()
TaskState contains linux_bprm struct which encapsulates argv amongother things.argv might be used around the code and is expected to contain validdata. Before this patch, ts->bprm->argv was NULL due to it being...
Rename CPUState -> CPUArchState
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...
Rename cpu_reset() to cpu_state_reset()
Frees the identifier cpu_reset for QOM CPUs (manual rename).
Don't hide the parameter type behind explicit casts, use staticfunctions with strongly typed argument to indirect.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
linux-user: Don't overuse CPUState
In target-specific code use CPU*State.
While at it, fix indentation on those lines.
qom: Add QOM support to user emulators
Link the Object base class and the module infrastructure for classregistration. Introduce $(universal-obj-y) for objects that are morecommon than $(common-obj-y), so that those only get built once.
Call QOM module init for type registration....
linux-user/main.c: Add option to user-mode emulation so that user can specify log file name
QEMU linux user-mode's default log file name is "/tmp/qemu.log". In order tochange the log file name, user need to modify the source code then recompileQEMU. This patch allow user use "-D logfile" option to specify the log file...
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.
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
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
Remove exec-all.h include directives
Most exec-all.h include directives are now useless, remove them.
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....