*-user: Fix typo in comment (ulocking -> unlocking)
Signed-off-by: Stefan Weil <sw@weilnetz.de>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
*-user: Improve documentation for lock_user function
Add a missing "function" and replace "and" by "any".BSD and Linux use the same documentation here, so fix both.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
gdbstub: Change gdb_handlesig() argument to CPUState
Prepares for changing GDBState::c_cpu to CPUState.
Signed-off-by: Andreas Färber <afaerber@suse.de>
bsd-user: Change thread_env to CPUState
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)...
bsd-user: OS-agnostic 64-bit SYSCTL types
Use existence of type as #ifdef condition rather than FreeBSD-specificversion check, as suggested by Patrick Welche.
Also handle the signed (CTLTYPE_S64) case identically to the unsigned(CTLTYPE_U64) case, per later patches in the FreeBSD ports tree...
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(),...
bsd-user: Track change in FreeBSD SYSCTL types
Originally from Garrett Cooper in FreeBSD PR ports/155558http://www.freebsd.org/cgi/query-pr.cgi?pr=155558
Signed-off-by: Ed Maste <emaste@freebsd.org>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
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...
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()....
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...
bsd-user: avoid conflict with qemu_vmalloc
Rename qemu_vmalloc() to bsd_vmalloc(), adjust the only user.
Remove #ifdeffery in oslib-posix.c.
Tested-by: Andreas Färber <andreas.faerber@web.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
exec: move include files to include/exec/
build: kill libdis, move disassemblers to disas/
user: Move *-user/qemu-types.h to main directory
The bsd-user/qemu-types.h and linux-user/qemu-types.h files are almostthe same, but linux-user has the additional definitions of tswapal().
This moves the linux-user file to the main directory, so the same file...
user: Rename qemu-types.h to qemu-user-types.h
The header file is specific for *-user, but I plan to introduce a moregeneric qemu-types.h file, so I'm renaming it.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
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...
build: move *-user/ objects to nested Makefile.objs
bsd-user: Use cpu_reset() in after cpu_init()
Eliminates cpu_state_reset() usage.
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Blue Swirl <blauwirbel@gmail.com>
bsd-user: fix compile failure
bsd-user doesn't actually support reserving a memory area for theguest address space, but we need to at least define the reserved_vaglobal so that cpu-all.h's RESERVED_VA macro will work correctly.
This fixes a compilation error introduced in commit 39879bb...
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>...
bsd-user: Don't overuse CPUState
Use CPU*State where applicable.
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....
elf: Improve symbol lookup (optimize, fix for bsd-user)
Coverity complained about local variable key which was only partiallyinitiated. Only key.st_value was set. As this was also the only partof key which was used in function symfind, the code could be optimized...
Merge remote-tracking branch 'stefanha/trivial-patches-next' into staging
Fix spelling in comments, documentation and messages
accidently->accidentallyannother->anotherchoosen->chosenconsideres->considersdecriptor->descriptordevelopement->developmentparamter->parameterpreceed->precedepreceeding->precedingpriviledge->privilege...
bsd_user: Fix potential null pointer dereference
This bug was spotted by cppcheck.
Using g_try_malloc0 (as does the linux-user code) fixes this.
v2:Use g_free in bsdload.c, too. Thanks to Peter Maydell for this hint.
Signed-off-by: Stefan Weil <sw@weilnetz.de>...
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...
user: Fix -d debug logging for usermode emulation
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
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>
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...
Fix compilation warning due to missing header for sigaction (followup)
This patch removes all references to signal.h when qemu-common.h is includedas they become redundant.
Signed-off-by: Alexandre Raymond <cerbere@gmail.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
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>
Fix typos in comments (neccessary -> necessary)
bsd-user: Fix possible memory leaks and wrong realloc call
These errors were reported by cppcheck:
[bsd-user/elfload.c:1108]: (error) Common realloc mistake: "syms" nulled but not freed upon failure[bsd-user/elfload.c:1076]: (error) Memory leak: s[bsd-user/elfload.c:1079]: (error) Memory leak: syms...
Remove dead code for ARM semihosting commandline handling
There are some bits in the code which were used to store the commandline forthe semihosting call. These bits are now write-only and can be removed.
Signed-off-by: Wolfgang Schildbach <wschi@dolby.com>...
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...
Replace most gcc format attributes by macro GCC_FMT_ATTR (format checking)
Since version 4.4.x, gcc supports additional format attributes. attribute ((format (gnu_printf, 1, 2)))should be used instead of attribute ((format (printf, 1, 2))...
rename CONFIG_QEMU_PREFIX
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>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.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix i386-bsd-user build
Fix bsd-user qemu_vmalloc() host page protection code
Just do the same as linux-user does.
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix bsd-user broken by commit b5ec5ce0e39d6e7ea707d5604a5f6d567dfd2f48
bsd/darwin-user: mmap_frag() users only check for -1 error
See also ee636500d6eab44b83f09cb730b67226b70423b1.
user: move CPU reset call to main.c for x86/PPC/Sparc
bsd-user: fix breakage by 78cfb07fe0dc556cae662a0fab5fe1bd33daabdb
bsd-user: FreeBSD update
basic FreeBSD sysarch(2) handlingfixed syscall errno return
bsd-user: fix "#if 0"'d printf()
Make an "#if 0"'d printf() in load_elf_binary() reflect what the actualcode does (see commit 3bc0bdcaadef1100ce2413af818d9c8e2f6319fc).
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
elfload: fix coding style nit
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>
BSD user: suppress a warning
BSD user: implement GUEST_BASE
Based on 379f6698d73f476de38682b3ff96ecb226728c43.
bsd-user: Add generic env variable handling
Based on 04a6dfebb6b52532a1e0bd637899f1eba14e94c6.
Adds support for qemu to modify target process environmentvariables using -E and -U commandline switches. This replaceseventually the -drop-ld-preload flag....
user: compile path.c only once
Also merge bsd-user/path.c and linux-user/path.c.
Fix Sparse warning about missing prototype
More NULL pointer fixes
rename USE_NPTL to CONFIG_USE_NPTL
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
rename HAVE_GPROF to TARGET_GPROF
Use was not consistent, in Makefile was TARGET_GPROF and in *h HAVE_GPROF
bsd-users: fix strace
Hi!
Attached patch fixes an unlock bug in strace.Catched by gcc due to an use of uninitialized variable.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
-----to satisfy European Law for business letters:Advanced Micro Devices GmbH...
fix build warnings
Attached patch fixes build warnings due to use of different pointersignedness.
-----to satisfy European Law for business letters:Advanced Micro Devices GmbHKarl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen...
Update to a hopefully more future proof FSF address
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>
Fix missing strnlen problems
Fix missing strnlen (a GNU extension) problems by using qemu_strnlenused for user emulators also for system emulators.
Avoid collision with system NGROUPS definition
BSD user: initial support for i386 and x86_64 targets
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7084 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....
Fix BSD user: there is no NPTL
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6745 c046a42c-6fe2-441c-8c8c-71466251a162
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.
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>...
Fix qemu_malloc.
make {linux,bsd}-user qemu_realloc handle ptr == NULL correctly.spotted by malc.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6466 c046a42c-6fe2-441c-8c8c-71466251a162
Fix bsd-user compile like r6412
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6434 c046a42c-6fe2-441c-8c8c-71466251a162
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>...
Get rid of user_mode_only
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6305 c046a42c-6fe2-441c-8c8c-71466251a162
Remove all traces of powerpc
According to $GCC/gcc/config/rs6000/rs6000-c.c _ARCH_PPC is theubiquitous define which should be used to test whether gcc targetsPowerPC, on 64bit platforms _ARCH_PPC64 will be also defined.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6301 c046a42c-6fe2-441c-8c8c-71466251a162
Fix more FSF addresses
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6192 c046a42c-6fe2-441c-8c8c-71466251a162
linux-user: Move abi_* typedefs into qemu-types.h
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5954 c046a42c-6fe2-441c-8c8c-71466251a162
Prepare for handling different BSD mmap() flags
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5809 c046a42c-6fe2-441c-8c8c-71466251a162
Fix BSD user compilation on other than OpenBSD
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5777 c046a42c-6fe2-441c-8c8c-71466251a162
Use correct trap for syscalls on Sparc32
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5726 c046a42c-6fe2-441c-8c8c-71466251a162
Sparc32 BSD user support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5655 c046a42c-6fe2-441c-8c8c-71466251a162
Preliminary BSD user emulator support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5544 c046a42c-6fe2-441c-8c8c-71466251a162