summaryrefslogtreecommitdiffstats
path: root/bsd-user
Commit message (Collapse)AuthorAgeFilesLines
* util: Use g_malloc/g_free in envlist.cSaurav Sachidanand2017-05-071-10/+4Star
| | | | | | | | | | | | | | | | | | | Change malloc/strdup/free to g_malloc/g_strdup/g_free in util/envlist.c. Remove NULL checks for pointers returned from g_malloc and g_strdup as they exit in case of failure. Also, update calls to envlist_create to reflect this. Free array and array contents returned by envlist_to_environ using g_free in bsd-user/main.c and linux-user/main.c. Update comments to reflect change in semantics. Signed-off-by: Saurav Sachidanand <sauravsachidanand@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* bsd-user: align use of mmap_lock to that of linux-userAlex Bennée2017-03-282-14/+1Star
| | | | | | | | | | | | | | The introduction of stricter mmap_lock checking in translate-all broke the BSD user build. The working mmap_lock functions were hidden behind CONFIG_USE_NPTL which is never defined. This patch brings them inline with linux-user. Despite the disapearence of the comment "We aren't threadsafe to start with..." this doesn't make bsd-user so. It will still need the rest of the fixes that have been done in linux-user ported over. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
* configure: remove CygwinPaolo Bonzini2017-03-201-5/+0Star
| | | | | | | | | | | | | The Cygwin target is really compiling for native Win32 with -mno-cygwin. Except, GCC 4.7.0 has finally removed the long deprecated -mno-cygwin option, and that happened about five years ago. Let it rest in peace. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Weil <sw@weilnetz.de> Message-id: 20170317160811.28370-1-pbonzini@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* translate-all: add DEBUG_LOCKING assertsAlex Bennée2016-10-311-0/+5
| | | | | | | | | | | | | | | | | | | | | This adds asserts to check the locking on the various translation engines structures. There are two sets of structures that are protected by locks. The first the l1map and PageDesc structures used to track which translation blocks are associated with which physical addresses. In user-mode this is covered by the mmap_lock. The second case are TB context related structures which are protected by tb_lock which is also user-mode only. Currently the asserts do nothing in SoftMMU mode but this will change for MTTCG. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Message-Id: <20161027151030.20863-4-alex.bennee@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Put the copyright information on a separate lineThomas Huth2016-10-241-1/+1
| | | | | | | | | | | | The output string QEMU with "--version" is very long, it does not fit into a normal line of a terminal window anymore. By putting the copyright information on a separate line instead, the output looks much nicer. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1475661284-30153-1-git-send-email-thuth@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* trace: provide mechanism for registering trace eventsDaniel P. Berrange2016-10-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the notion of there being a single global array of trace events, by introducing a method for registering groups of events. The module_call_init() needs to be invoked at the start of any program that wants to make use of the trace support. Currently this covers system emulators qemu-nbd, qemu-img and qemu-io. [Squashed the following fix from Daniel P. Berrange <berrange@redhat.com>: linux-user/bsd-user: initialize trace events subsystem The bsd-user/linux-user programs make use of the CPU emulation code and this now requires that the trace events subsystem is enabled, otherwise it'll crash trying to allocate an empty trace events bitmap for the CPU object. --Stefan] Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1475588159-30598-14-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* bsd-user: fix FreeBSD build after d148d90eEd Maste2016-10-071-0/+10
| | | | | | Signed-off-by: Ed Maste <emaste@freebsd.org> Message-id: 1475611369-74971-1-git-send-email-emaste@freebsd.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' ↵Peter Maydell2016-09-291-1/+0Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging # gpg: Signature made Wed 28 Sep 2016 22:30:45 BST # gpg: using RSA key 0x9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/tracing-pull-request: trace: Document the execution mode of guest events trace: Add event "guest_cpu_reset" trace: Add event "guest_cpu_enter" trace: Properly initialize dynamic event states in hot-plugged vCPUs trace: move hw/virtio/virtio-balloon.c trace points into correct file trace: move hw/mem/pc-dimm.c trace points into correct file trace: move util/qemu-coroutine*.c trace points into correct file trace: move util/buffer.c trace points into correct file Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * trace: Properly initialize dynamic event states in hot-plugged vCPUsLluís Vilanova2016-09-281-1/+0Star
| | | | | | | | | | | | | | | | | | | | Every time a vCPU is hot-plugged, it will "inherit" its tracing state from the global state array. That is, if *any* existing vCPU has an event enabled, new vCPUs will have too. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Message-id: 147428970768.15111.7664565956870423529.stgit@fimbulvetr.bsc.es Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* | cpus-common: move exclusive work infrastructure from linux-userPaolo Bonzini2016-09-271-17/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | This will serve as the base for async_safe_run_on_cpu. Because start_exclusive uses CPU_FOREACH, merge exclusive_lock with qemu_cpu_list_lock: together with a call to exclusive_idle (via cpu_exec_start/end) in cpu_list_add, this protects exclusive work against concurrent CPU addition and removal. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | cpus-common: move CPU work item management to common codeSergey Fedorov2016-09-271-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Make CPU work core functions common between system and user-mode emulation. User-mode does not use run_on_cpu, so do not implement it. Signed-off-by: Sergey Fedorov <serge.fdrv@gmail.com> Signed-off-by: Sergey Fedorov <sergey.fedorov@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <1470158864-17651-10-git-send-email-alex.bennee@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | cpus-common: move CPU list management to common codePaolo Bonzini2016-09-271-8/+1Star
|/ | | | | | | | | | Add a mutex for the CPU list to system emulation, as it will be used to manage safe work. Abstract manipulation of the CPU list in new functions cpu_list_add and cpu_list_remove. Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Fix bsd-user build after d915b7bbEd Maste2016-08-241-0/+1
| | | | | | | | Must include "qemu-version.h" for the QEMU_PKGVERSION definition. Signed-off-by: Ed Maste <emaste@freebsd.org> Message-id: 1471877833-52343-1-git-send-email-emaste@freebsd.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* Update ancient copyright string in -version outputPeter Maydell2016-08-111-1/+2
| | | | | | | | | | | | | | | | | Currently the -version command line argument prints a string ending with "Copyright (c) 2003-2008 Fabrice Bellard". This is now some eight years out of date; abstract it out of the several places that print the string and update it to: Copyright (c) 2003-2016 Fabrice Bellard and the QEMU Project developers to reflect the work by all the QEMU Project contributors over the last decade. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1470309276-5012-1-git-send-email-peter.maydell@linaro.org
* Fix bsd-user build errors after 8642c1b81e0418df066a7960a7426d85a923a253Sean Bruno2016-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | LINK sparc-bsd-user/qemu-sparc bsd-user/main.o: In function `cpu_loop': /home/sbruno/bsd/qemu/bsd-user/main.c:515: undefined reference to `cpu_sparc_exec' c++: error: linker command failed with exit code 1 (use -v to see invocation) gmake[1]: *** [Makefile:197: qemu-sparc] Error 1 gmake: *** [Makefile:204: subdir-sparc-bsd-user] Error 2 LINK i386-bsd-user/qemu-i386 bsd-user/main.o: In function `cpu_loop': /home/sbruno/bsd/qemu/bsd-user/main.c:174: undefined reference to `cpu_x86_exec' c++: error: linker command failed with exit code 1 (use -v to see invocation) gmake[1]: *** [Makefile:197: qemu-i386] Error 1 gmake: *** [Makefile:204: subdir-i386-bsd-user] Error 2 Signed-off-by: Sean Bruno <sbruno@freebsd.org> Message-id: 20160729160235.64525-1-sbruno@freebsd.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* exec: Reduce CONFIG_USER_ONLY ifdeffeneryIgor Mammedov2016-07-261-2/+0Star
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
* Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell2016-07-191-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * two old patches from prospective GSoC students * i386 -kernel device tree support * Coverity fix * memory usage improvement from Peter * checkpatch fix * g_path_get_dirname cleanup * caching of block status for iSCSI # gpg: Signature made Tue 19 Jul 2016 07:43:41 BST # gpg: using RSA key 0xBFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: target-i386: Remove redundant HF_SOFTMMU_MASK block/iscsi: allow caching of the allocation map block/iscsi: fix rounding in iscsi_allocationmap_set Move README to markdown cpu-exec: Move down some declarations in cpu_exec() exec: avoid realloc in phys_map_node_reserve checkpatch: consider git extended headers valid patches megasas: remove useless check for cmd->frame compiler: never omit assertions if using a static analysis tool hw/i386: add device tree support Changed malloc to g_malloc, free to g_free in bsd-user/qemu.h use g_path_get_dirname instead of dirname Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * Changed malloc to g_malloc, free to g_free in bsd-user/qemu.hMd Haris Iqbal2016-07-171-2/+2
| | | | | | | | | | | | | | Signed-off-by: Md Haris Iqbal <haris.phnx@gmail.com> Message-Id: <1459861743-4514-1-git-send-email-haris.phnx@gmail.com> Reviewed-by: Sean Bruno <sbruno@freebsd.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | trace: Add per-vCPU tracing states for events with the 'vcpu' propertyLluís Vilanova2016-07-181-0/+1
| | | | | | | | | | | | | | | | Each vCPU gets a 'trace_dstate' bitmap to control the per-vCPU dynamic tracing state of events with the 'vcpu' property. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* | trace: [bsd-user] Commandline arguments to control tracingLluís Vilanova2016-07-181-3/+18
|/ | | | | | | | | | | | | | | [Changed const char *trace_file to char *trace_file since it's a heap-allocated string that needs to be freed. This type is also returned by trace_opt_parse() and used in vl.c. Also fixed coding style on for(;;) and else statement as suggested by Eric Blake <eblake@redhat.com> since the patch modifies these lines or close enough. --Stefan] Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Message-id: 146860252322.30668.18276041739086338328.stgit@fimbulvetr.bsc.es Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* Clean up decorations and whitespace around header guardsMarkus Armbruster2016-07-124-4/+4
| | | | | | | Cleaned up with scripts/clean-header-guards.pl. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
* trace: [*-user] Add events to trace guest syscalls in syscall emulation modeLluís Vilanova2016-06-281-0/+9
| | | | | | | | | | | | | | Adds two events to trace syscalls in syscall emulation mode (*-user): * guest_user_syscall: Emitted before the syscall is emulated; contains the syscall number and arguments. * guest_user_syscall_ret: Emitted after the syscall is emulated; contains the syscall number and return value. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Message-id: 146651712411.12388.10024905980452504938.stgit@fimbulvetr.bsc.es Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* log: Fix qemu_set_log_filename() error handlingMarkus Armbruster2016-06-201-1/+2
| | | | | | | | | | | | | | | | | | | When qemu_set_log_filename() detects an invalid file name, it reports an error, closes the log file (if any), and starts logging to stderr (unless daemonized or nothing is being logged). This is wrong. Asking for an invalid log file on the command line should be fatal. Asking for one in the monitor should fail without messing up an existing logfile. Fix by converting qemu_set_log_filename() to Error. Pass it &error_fatal, except for hmp_logfile report errors. This also permits testing without a subprocess, so do that. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1466011636-6112-4-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
* os-posix: include sys/mman.hPaolo Bonzini2016-06-164-4/+0Star
| | | | | | | | | qemu/osdep.h checks whether MAP_ANONYMOUS is defined, but this check is bogus without a previous inclusion of sys/mman.h. Include it in sysemu/os-posix.h and remove it from everywhere else. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* cpu: Eliminate cpudef_init(), cpudef_setup()Eduardo Habkost2016-05-241-3/+0Star
| | | | | | | x86_cpudef_init() doesn't do anything anymore, cpudef_init(), cpudef_setup(), and x86_cpudef_init() can be finally removed. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
* cpu: move exec-all.h inclusion out of cpu.hPaolo Bonzini2016-05-192-0/+2
| | | | | | | | | | exec-all.h contains TCG-specific definitions. It is not needed outside TCG-specific files such as translate.c, exec.c or *helper.c. One generic function had snuck into include/exec/exec-all.h; move it to include/qom/cpu.h. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* log: do not use CONFIG_USER_ONLYPaolo Bonzini2016-05-191-0/+1
| | | | | | | This decouples logging further from config-target.h Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* bsd-user: Suppress gcc 4.x -Wpointer-sign (included in -Wall) warningEd Maste2016-04-051-1/+1
| | | | | | | | This is the same change as b55266b5 in linux-user. Signed-off-by: Ed Maste <emaste@freebsd.org> Message-id: 1459867593-72017-1-git-send-email-emaste@freebsd.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* bsd-user: add qemu/cutils.h include after f348b6dEd Maste2016-04-051-0/+1
| | | | | | Signed-off-by: Ed Maste <emaste@freebsd.org> Message-id: 1459864881-71319-1-git-send-email-emaste@freebsd.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* bsd-user: add necessary includes to fix warningsEd Maste2016-04-041-0/+2
| | | | | | Signed-off-by: Ed Maste <emaste@freebsd.org> Message-id: 1459781903-64465-1-git-send-email-emaste@freebsd.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* util: move declarations out of qemu-common.hVeronia Bahaa2016-03-222-1/+3
| | | | | | | | | | Move declarations out of qemu-common.h for functions declared in utils/ files: e.g. include/qemu/path.h for utils/path.c. Move inline functions out of qemu-common.h and into new files (e.g. include/qemu/bcd.h) Signed-off-by: Veronia Bahaa <veroniabahaa@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* build: [bsd-user] Rename "syscall.h" to "target_syscall.h" in target directoriesLluís Vilanova2016-02-255-1/+20
| | | | | | | | | This fixes double-definitions in bsd-user builds when using the UST tracing backend (which indirectly includes the system's "syscall.h"). Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* all: Clean up includesPeter Maydell2016-02-231-3/+0Star
| | | | | | | | | | Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com>
* bsd-user: Clean up includesPeter Maydell2016-02-048-51/+8Star
| | | | | | | | | | Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1454089805-5470-4-git-send-email-peter.maydell@linaro.org
* log: do not unnecessarily include qom/cpu.hPaolo Bonzini2016-02-031-0/+1
| | | | | | | | | | Split the bits that require it to exec/log.h. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-id: 1452174932-28657-8-git-send-email-den@openvz.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* linux-user: convert DEBUG_SIGNAL logging to tracepointsPaolo Bonzini2015-12-171-2/+0Star
| | | | | | | "Unimplemented" messages go to stderr, everything else goes to tracepoints Reviewed-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* user: introduce "-d page"Paolo Bonzini2015-12-171-2/+2
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* translate-all: ensure host page mask is always extended with 1'sPaolo Bonzini2015-12-021-2/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | Anthony reported that >4GB guests on Xen with 32bit QEMU broke after commit 4ed023c ("Round up RAMBlock sizes to host page sizes", 2015-11-05). In that patch sizes are masked against qemu_host_page_size/mask which are uintptr_t, and thus 32bit on a 32bit QEMU, even though the ram space might be bigger than 4GB on Xen. Since ram_addr_t is not available on user-mode emulation targets, ensure that we get a sign extension when masking away the low bits of the address. Remove the ~10 year old scary comment that the type of these variables is probably wrong, with another equally scary comment. The new comment however does not have "???" in it, which is arguably an improvement. For completeness use the alignment macros in linux-user and bsd-user instead of manually doing an &. linux-user and bsd-user are not affected by the Xen issue, however. Reviewed-by: Juan Quintela <quintela@redhat.com> Reported-by: Anthony PERARD <anthony.perard@citrix.com> Fixes: 4ed023ce2a39ab5812d33cf4d819def168965a7f Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* s/cpu_get_real_ticks/cpu_get_host_ticks/Christopher Covington2015-10-081-1/+1
| | | | | | | | | | | This should help clarify the purpose of the function that returns the host system's CPU cycle count. Signed-off-by: Christopher Covington <cov@codeaurora.org> Acked-by: Paolo Bonzini <pbonzini@redhat.com> ppc portion Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell2015-09-141-2/+0Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support for jemalloc * qemu_mutex_lock_iothread "No such process" fix * cutils: qemu_strto* wrappers * iohandler.c simplification * Many other fixes and misc patches. And some MTTCG work (with Emilio's fixes squashed): * Signal-free TCG kick * Removing spinlock in favor of QemuMutex * User-mode emulation multi-threading fixes/docs # gpg: Signature made Thu 10 Sep 2015 09:03:07 BST using RSA key ID 78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" * remotes/bonzini/tags/for-upstream: (44 commits) cutils: work around platform differences in strto{l,ul,ll,ull} cpu-exec: fix lock hierarchy for user-mode emulation exec: make mmap_lock/mmap_unlock globally available tcg: comment on which functions have to be called with mmap_lock held tcg: add memory barriers in page_find_alloc accesses remove unused spinlock. replace spinlock by QemuMutex. cpus: remove tcg_halt_cond and tcg_cpu_thread globals cpus: protect work list with work_mutex scripts/dump-guest-memory.py: fix after RAMBlock change configure: Add support for jemalloc add macro file for coccinelle configure: factor out adding disas configure vhost-scsi: fix wrong vhost-scsi firmware path checkpatch: remove tests that are not relevant outside the kernel checkpatch: adapt some tests to QEMU CODING_STYLE: update mixed declaration rules qmp: Add example usage of strto*l() qemu wrapper cutils: Add qemu_strtoull() wrapper cutils: Add qemu_strtoll() wrapper ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * exec: make mmap_lock/mmap_unlock globally availablePaolo Bonzini2015-09-091-2/+0Star
| | | | | | | | | | | | | | | | | | There is some iffy lock hierarchy going on in translate-all.c. To fix it, we need to take the mmap_lock in cpu-exec.c. Make the functions globally available. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | maint: avoid useless "if (foo) free(foo)" patternDaniel P. Berrange2015-09-111-3/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | The free() and g_free() functions both happily accept NULL on any platform QEMU builds on. As such putting a conditional 'if (foo)' check before calls to 'free(foo)' merely serves to bloat the lines of code. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* | maint: remove unused include for signal.hDaniel P. Berrange2015-09-111-1/+0Star
|/ | | | | | | | | A number of files were including signal.h but not using any of the functions it provides Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* linux-user: remove --enable-guest-base/--disable-guest-baseLaurent Vivier2015-08-243-16/+0Star
| | | | | | | | | | | | | | | | | | All tcg host architectures now support the guest base and as there is no real performance lost, it can be always enabled. Anyway, guest base use can be disabled lively by setting guest base to 0. CONFIG_USE_GUEST_BASE is defined as (USE_GUEST_BASE && USER_ONLY), it should have to be replaced by CONFIG_USER_ONLY in non CONFIG_USER_ONLY parts, but as some other parts are using !CONFIG_SOFTMMU I have chosen to use !CONFIG_SOFTMMU instead. Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <1440373328-9788-2-git-send-email-laurent@vivier.eu> Signed-off-by: Richard Henderson <rth@twiddle.net>
* bsd-user: Fix operand to cpu_x86_execRichard Henderson2015-07-301-1/+1
| | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1438195252-21968-1-git-send-email-rth@twiddle.net Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* cpu-exec: Purge all uses of ENV_GET_CPU()Peter Crosthwaite2015-07-091-1/+3
| | | | | | | | | | | | | | | | Remove un-needed usages of ENV_GET_CPU() by converting the APIs to use CPUState pointers and retrieving the env_ptr as minimally needed. Scripted conversion for target-* change: for I in target-*/cpu.h; do sed -i \ 's/\(^int cpu_[^_]*_exec(\)[^ ][^ ]* \*s);$/\1CPUState *cpu);/' \ $I; done Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* gdbstub: Change gdbserver_fork() to accept cpu instead of envPeter Crosthwaite2015-07-091-1/+1
| | | | | | | | | | | | | All callsites to this function navigate the cpu->env_ptr only for the function to take the env ptr back to the original cpu ptr. Change the function to just pass in the CPU pointer instead. Removes a core code usage of ENV_GET_CPU() (in gdbstub.c). Cc: Riku Voipio <riku.voipio@iki.fi> Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: use memory API to implement SMRAMPaolo Bonzini2015-06-051-4/+0Star
| | | | | | | | | Remove cpu_smm_register and cpu_smm_update. Instead, each CPU address space gets an extra region which is an alias of /machine/smram. This extra region is enabled or disabled as the CPU enters/exits SMM. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* linux-user, bsd-user: Remove two calls to cpu_exec_init_allFam Zheng2015-04-271-1/+0Star
| | | | | | | | The function is a nop for user mode, so just remove them. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1426496617-10702-3-git-send-email-famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* cpu: Make cpu_init() return QOM CPUState objectEduardo Habkost2015-03-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of making cpu_init() return CPUArchState, return CPUState. Changes were made using the Coccinelle semantic patch below. @@ typedef CPUState; identifier e; expression args; type CPUArchState; @@ - e = + cpu = cpu_init(args); - if (!e) { + if (!cpu) { ... } - cpu = ENV_GET_CPU(env); + e = cpu->env_ptr; @@ identifier new_env, new_cpu, env, cpu; type CPUArchState; expression args; @@ -{ - CPUState *cpu = ENV_GET_CPU(env); - CPUArchState *new_env = cpu_init(args); - CPUState *new_cpu = ENV_GET_CPU(new_env); +{ + CPUState *cpu = ENV_GET_CPU(env); + CPUState *new_cpu = cpu_init(args); + CPUArchState *new_env = new_cpu->env_ptr; ... } @@ identifier c, cpu_init_func, cpu_model; type StateType, CPUType; @@ -static inline StateType* cpu_init(const char *cpu_model) -{ - CPUType *c = cpu_init_func(cpu_model); ( - if (c == NULL) { - return NULL; - } - return &c->env; | - if (c) { - return &c->env; - } - return NULL; ) -} +#define cpu_init(cpu_model) CPU(cpu_init_func(cpu_model)) @@ identifier cpu_init_func; identifier model; @@ -#define cpu_init(model) (&cpu_init_func(model)->env) +#define cpu_init(model) CPU(cpu_init_func(model)) Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Cc: Riku Voipio <riku.voipio@iki.fi> Cc: Richard Henderson <rth@twiddle.net> Cc: Peter Maydell <peter.maydell@linaro.org> Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Michael Walle <michael@walle.cc> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Leon Alrae <leon.alrae@imgtec.com> Cc: Anthony Green <green@moxielogic.com> Cc: Jia Liu <proljc@gmail.com> Cc: Alexander Graf <agraf@suse.de> Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Cc: Max Filippov <jcmvbkbc@gmail.com> [AF: Fixed up cpu_copy() manually] Signed-off-by: Andreas Färber <afaerber@suse.de>