summaryrefslogtreecommitdiffstats
path: root/bsd-user
Commit message (Collapse)AuthorAgeFilesLines
* *-user: Improve documentation for lock_user functionStefan Weil2013-09-201-2/+2
| | | | | | | | | 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> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* *-user: Fix typo in comment (ulocking -> unlocking)Stefan Weil2013-09-201-1/+1
| | | | | | 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>
* gdbstub: Change gdb_handlesig() argument to CPUStateAndreas Färber2013-07-231-4/+6
| | | | | | Prepares for changing GDBState::c_cpu to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
* bsd-user: Change thread_env to CPUStateAndreas Färber2013-07-093-6/+8
| | | | Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Turn cpu_dump_{state,statistics}() into CPUState hooksAndreas Färber2013-06-281-1/+2
| | | | | | | | | Make cpustats monitor command available unconditionally. Prepares for changing kvm_handle_internal_error() and kvm_cpu_exec() arguments to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
* main: use TARGET_ARCH only for the target-specific #definePaolo Bonzini2013-06-141-3/+3
| | | | | | | | | | | | | | | | | | | Everything else needs to match the executable name, which is TARGET_NAME. Before: $ sh4eb-linux-user/qemu-sh4eb --help usage: qemu-sh4 [options] program [arguments...] Linux CPU emulator (compiled for sh4 emulation) After: $ sh4eb-linux-user/qemu-sh4eb --help usage: qemu-sh4eb [options] program [arguments...] Linux CPU emulator (compiled for sh4eb emulation) Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1370349928-20419-5-git-send-email-pbonzini@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* bsd-user: OS-agnostic 64-bit SYSCTL typesEd Maste2013-05-121-3/+4
| | | | | | | | | | | | Use existence of type as #ifdef condition rather than FreeBSD-specific version 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 (emulators/qemu-devel/files/patch-z-arm-bsd-user-001). Signed-off-by: Ed Maste <emaste@freebsd.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* target-i386: Replace cpuid_*features fields with a feature word arrayEduardo Habkost2013-05-022-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | This replaces the feature-bit fields on both X86CPU and x86_def_t structs with an array. With this, we will be able to simplify code that simply does the same operation on all feature words (e.g. kvm_check_features_against_host(), filter_features_for_kvm(), add_flagname_to_bitmaps(), CPU feature-bit property lookup/registration, and the proposed "feature-words" property) The following field replacements were made on X86CPU and x86_def_t: (cpuid_)features -> features[FEAT_1_EDX] (cpuid_)ext_features -> features[FEAT_1_ECX] (cpuid_)ext2_features -> features[FEAT_8000_0001_EDX] (cpuid_)ext3_features -> features[FEAT_8000_0001_ECX] (cpuid_)ext4_features -> features[FEAT_C000_0001_EDX] (cpuid_)kvm_features -> features[FEAT_KVM] (cpuid_)svm_features -> features[FEAT_SVM] (cpuid_)7_0_ebx_features -> features[FEAT_7_0_EBX] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* bsd-user: Track change in FreeBSD SYSCTL(9) typesEd Maste2013-04-261-0/+4
| | | | | | | | Originally from Garrett Cooper in FreeBSD PR ports/155558 http://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 outputPeter Maydell2013-02-261-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Switch the default for qemu_log logging output from "/tmp/qemu.log" to stderr. This is an incompatible change in some sense, but logging is mostly used for debugging purposes so it shouldn't affect production use. The previous behaviour can be obtained by adding "-D /tmp/qemu.log" to the command line. This change requires us to: * update all the documentation/help text (we take the opportunity to smooth out minor inconsistencies between the phrasing in linux-user/bsd-user/system help messages) * make linux-user and bsd-user defer to qemu-log for the default logging destination rather than overriding it themselves * ensure that all logfile closing is done via qemu_log_close() and that that function doesn't close stderr as well as the obvious change to the behaviour of do_qemu_set_log() when no logfile name has been specified. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: 1361901160-28729-1-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu-log: Rename the public-facing cpu_set_log function to qemu_set_logPeter Maydell2013-02-161-1/+1
| | | | | | | | | | Rename the public-facing function cpu_set_log to qemu_set_log. This requires us to rename the internal-only qemu_set_log() to do_qemu_set_log(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qemu-log: Rename cpu_str_to_log_mask to qemu_str_to_log_maskPeter Maydell2013-02-161-1/+1
| | | | | | | | | | Rename cpu_str_to_log_mask() to qemu_str_to_log_mask(), since the qemu_log functionality is no longer restricted to TCG CPU debug logging. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qemu-log: Abstract out "print usage message about valid log categories"Peter Maydell2013-02-161-5/+1
| | | | | | | | | | | | Abstract out the "print a human readable list of all the valid log categories" functionality which is currently duplicated in three separate places. (We leave the monitor.c help_cmd() implementation as-is since it wants to send the message to the monitor and add its own information.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qemu-log: Unify {cpu_set,set_cpu}_log_filename as qemu_set_log_filenamePeter Maydell2013-02-161-1/+1
| | | | | | | | | | 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 the pointless wrapper set_cpu_log_filename(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* linux-user: bsd-user: Don't reset X86CPU twiceAndreas Färber2013-02-011-1/+1
| | | | | | | | | | | | | Since commit 65dee38052597b6285eb208125369f01b29ba6c1 (target-i386: move cpu_reset and reset callback to cpu.c) the x86 CPU is reset through cpu_init() but was still reset immediately after in linux-user and bsd-user. Clean this up. Similarly in linux-user/syscall.c it is also reset after cpu_copy(). But that's a bug of its own, fixing which poses a semantic change. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
* bsd-user: avoid conflict with qemu_vmallocBlue Swirl2013-01-261-2/+2
| | | | | | | | | 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/Paolo Bonzini2012-12-192-3/+3
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* exec: move include files to include/exec/Paolo Bonzini2012-12-191-2/+2
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* build: kill libdis, move disassemblers to disas/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* user: Rename qemu-types.h to qemu-user-types.hEduardo Habkost2012-12-061-1/+1
| | | | | | | | The header file is specific for *-user, but I plan to introduce a more generic 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>
* user: Move *-user/qemu-types.h to main directoryEduardo Habkost2012-12-061-24/+0
| | | | | | | | | | | The bsd-user/qemu-types.h and linux-user/qemu-types.h files are almost the same, but linux-user has the additional definitions of tswapal(). This moves the linux-user file to the main directory, so the same file can be used by linux-user and bsd-user. 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 optionsPeter Maydell2012-08-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | For command line options which permit '?' meaning 'please list the permitted values', add support for 'help' as a synonym, by abstracting the check out into a helper function. This change means that in some cases where we were being lazy in our string parsing, "?junk" will now be rejected as an invalid option rather than being (undocumentedly) treated the same way as "?". Update the documentation to use 'help' rather than '?', since '?' is a shell metacharacter and thus prone to fail confusingly if there is a single character filename in the current working directory and the '?' has not been escaped. It's therefore better to steer users towards 'help', though '?' is retained for backwards compatibility. We do not, however, update the output of the system emulator's -help (or any documentation autogenerated from the qemu-options.hx which is the source of the -help text) because libvirt parses our -help output and will break. At a later date when QEMU provides a better interface so libvirt can avoid having to do this, we can update the -help text too. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* build: move *-user/ objects to nested Makefile.objsPaolo Bonzini2012-06-071-0/+2
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* bsd-user: Use cpu_reset() in after cpu_init()Andreas Färber2012-06-041-1/+1
| | | | | | | 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 failurePeter Maydell2012-04-131-0/+1
| | | | | | | | | | | | | | bsd-user doesn't actually support reserving a memory area for the guest address space, but we need to at least define the reserved_va global so that cpu-all.h's RESERVED_VA macro will work correctly. This fixes a compilation error introduced in commit 39879bb which added a use of RESERVED_VA to h2g_valid(). Reported-by: Brad Smith <brad@comstyle.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* Rename CPUState -> CPUArchStateAndreas Färber2012-03-143-11/+11
| | | | | | | | | | | | | 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 All occurrences of CPUArchState are expected to be replaced by QOM CPUState, once all targets are QOM'ified and common fields have been extracted. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
* bsd-user: Don't overuse CPUStateAndreas Färber2012-03-141-2/+2
| | | | | | Use CPU*State where applicable. Signed-off-by: Andreas Färber <afaerber@suse.de>
* Rename cpu_reset() to cpu_state_reset()Andreas Färber2012-03-141-1/+1
| | | | | | | | | | Frees the identifier cpu_reset for QOM CPUs (manual rename). Don't hide the parameter type behind explicit casts, use static functions with strongly typed argument to indirect. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
* qom: Add QOM support to user emulatorsAndreas Färber2012-03-131-0/+2
| | | | | | | | | | | | Link the Object base class and the module infrastructure for class registration. Introduce $(universal-obj-y) for objects that are more common than $(common-obj-y), so that those only get built once. Call QOM module init for type registration. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* elf: Improve symbol lookup (optimize, fix for bsd-user)Stefan Weil2012-01-101-7/+4
| | | | | | | | | | | | | | Coverity complained about local variable key which was only partially initiated. Only key.st_value was set. As this was also the only part of key which was used in function symfind, the code could be optimized by directly passing a pointer to orig_addr. In bsd-user/elfload.c, fix ec822001a2f26eef8701194714f6482b6d852de2 was missing. This was a simple replacement of > by >= in symfind, so I fixed it here without creating an additional patch. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
* Merge remote-tracking branch 'stefanha/trivial-patches-next' into stagingAnthony Liguori2011-12-141-1/+1
|\
| * Fix spelling in comments, documentation and messagesStefan Weil2011-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | accidently->accidentally annother->another choosen->chosen consideres->considers decriptor->descriptor developement->development paramter->parameter preceed->precede preceeding->preceding priviledge->privilege propogation->propagation substraction->subtraction throught->through upto->up to usefull->useful Fix also grammar in posix-aio-compat.c Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* | bsd_user: Fix potential null pointer dereferenceStefan Weil2011-12-102-4/+3
|/ | | | | | | | | | | | 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> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Use glib memory allocation and free functionsAnthony Liguori2011-08-202-10/+10
| | | | | | 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 modeJan Kiszka2011-08-051-1/+2
| | | | | | | | | Do not allocate TCG-only resources like the translation buffer when running over KVM or XEN. Saves a "few" bytes in the qemu address space and is also conceptually cleaner. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* user: Restore debug usage message for '-d ?' in user mode emulationPeter Maydell2011-07-301-3/+5
| | | | | | | | | | | The code which prints the debug usage message on '-d ?' for *-user has to come before the check for "not enough arguments", so that "qemu-foo -d ?" prints the list of possible debug log items rather than the generic usage message. (This was inadvertently broken in commit c235d73.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
* user: Fix -d debug logging for usermode emulationEdgar E. Iglesias2011-06-281-1/+1
| | | | Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* Remove exec-all.h include directivesBlue Swirl2011-06-261-1/+1
| | | | | | 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 locationMatthew Fernandez2011-06-151-18/+28
| | | | | | | | | | | 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 to the hard-coded path /tmp/qemu.log. This patch adds support for writing the log to a different location by passing the -D option. Signed-off-by: Matthew Fernandez <matthew.fernandez@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix compilation warning due to missing header for sigaction (followup)Alexandre Raymond2011-06-081-1/+0
| | | | | | | | This patch removes all references to signal.h when qemu-common.h is included as 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)Stefan Weil2011-05-081-1/+1
| | | | | 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)Stefan Weil2011-05-081-1/+1
| | | | | Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* bsd-user: Fix possible memory leaks and wrong realloc callStefan Weil2011-01-171-6/+31
| | | | | | | | | | | | | | | | 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 v2: * The previous fix for memory leaks was incomplete (thanks to Peter Maydell for te hint). * Fix wrong realloc usage, too. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Remove dead code for ARM semihosting commandline handlingWolfgang Schildbach2011-01-072-3/+0
| | | | | | | | | There are some bits in the code which were used to store the commandline for the semihosting call. These bits are now write-only and can be removed. Signed-off-by: Wolfgang Schildbach <wschi@dolby.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* Add new user mode option -ignore-environmentStefan Weil2010-10-051-0/+6
| | | | | | | | | | | 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 environment related options. Signed-off-by: Stefan Weil <weil@mail.berlios.de>
* Replace most gcc format attributes by macro GCC_FMT_ATTR (format checking)Stefan Weil2010-10-031-1/+1
| | | | | | | | | | | | | | | | | 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)) because QEMU always uses standard format strings (even with mingw32). The patch replaces format attribute printf / __printf__ by macro GCC_FMT_ATTR which uses gnu_printf if supported. It also removes an #ifdef __GNUC__ (not needed any longer). Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* rename CONFIG_QEMU_PREFIXPaolo Bonzini2010-06-101-1/+1
| | | | | 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.Richard Henderson2010-05-211-1/+8
| | | | | | | | This will allow backends to make intelligent choices about how to implement GUEST_BASE. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Fix i386-bsd-user buildBlue Swirl2010-03-301-1/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix bsd-user qemu_vmalloc() host page protection codeJuergen Lock2010-03-301-3/+2
| | | | | | | 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>
OpenPOWER on IntegriCloud