summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
...
| * target-sparc: Extract float128 move to a function.Richard Henderson2011-10-261-32/+18
| | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * target-sparc: Extract common code for floating-point operations.Richard Henderson2011-10-261-454/+381
| | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * target-sparc: Make FPU/VIS helpers const when possible.Richard Henderson2011-10-264-92/+78
| | | | | | | | | | | | This also removes the unused ENV parameter from these helpers. Signed-off-by: Richard Henderson <rth@twiddle.net>
| * target-sparc: Pass float64 parameters instead of dt0/1 temporaries.Richard Henderson2011-10-266-449/+381
| | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * target-sparc: Add accessors for double-precision fpr access.Richard Henderson2011-10-261-112/+130
| | | | | | | | | | | | | | | | | | Begin using i64 quantities to manipulate double-precision values. On a 64-bit host this will, for the moment, generate less efficient code; on a 32-bit host code quality should be largely unchanged. Code quality for 64-bit will be adjusted with a subsequent patch. Signed-off-by: Richard Henderson <rth@twiddle.net>
| * target-sparc: Mark fprs dirty in store accessor.Richard Henderson2011-10-261-46/+8
| | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net>
| * target-sparc: Add accessors for single-precision fpr access.Richard Henderson2011-10-261-195/+337
| | | | | | | | | | | | | | | | | | | | | | | | | | Load, store, and "create destination". This version attempts to change the behaviour of the translator as little as possible. We previously used cpu_tmp32 as the temporary destination, and we continue to use that. This will eventually allow a change in representation of the fprs. Change the name of the cpu_fpr array to make certain that all instances are converted. Signed-off-by: Richard Henderson <rth@twiddle.net>
* | Merge branch 'target-arm.for-upstream' of ↵Andrzej Zaborowski2011-10-278-12/+760
|\ \ | |/ |/| | | git://git.linaro.org/people/pmaydell/qemu-arm
| * target-arm: Fix use of free() in cpu_arm_close()Andreas Färber2011-10-201-1/+1
| | | | | | | | | | | | | | env is allocated in cpu_arm_init() with g_malloc0(), so free with g_free(). Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * target-arm/machine.c: Restore VFP registers correctlyDmitry Koshelev2011-10-191-1/+1
| | | | | | | | | | | | | | | | | | Fix the restoring of VFP registers on vmload. Signed-off-by: Dmitry Koshelev <karaghiozis@gmail.com> Reviewed-by: Juan Quintela <quintela@redhat.com> [peter.maydell: improved commit message a little] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * target-arm: Implement VFPv4 fused multiply-accumulate insnsPeter Maydell2011-10-194-0/+90
| | | | | | | | | | | | | | Implement the fused multiply-accumulate instructions (VFMA, VFMS, VFNMA, VFNMS) which are new in VFPv4. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * softfloat: Implement fused multiply-addPeter Maydell2011-10-193-0/+619
| | | | | | | | | | | | | | | | Implement fused multiply-add as a softfloat primitive. This implements "a+b*c" as a single step without any intermediate rounding; it is specified in IEEE 754-2008 and implemented in a number of CPUs. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * target-arm: Add ARM UDIV/SDIV supportPeter Maydell2011-10-193-1/+24
| | | | | | | | | | | | | | | | Add support for UDIV and SDIV in ARM mode. This is a new optional feature for A profile cores (Thumb mode has had UDIV and SDIV for M profile cores for some time). Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * target-arm: Rename ARM_FEATURE_DIV to _THUMB_DIVPeter Maydell2011-10-193-4/+5
| | | | | | | | | | | | | | | | | | | | Rename the ARM_FEATURE_DIV feature bit to _THUMB_DIV, to make room for a new feature switch enabling DIV in the ARM encoding. (Cores may implement either (a) no divide insns (b) divide insns in Thumb encodings only (c) divide insns in both ARM and Thumb encodings.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * target-arm: v6 media multiply space: UNDEF on unassigned encodingsPeter Maydell2011-10-191-4/+20
| | | | | | | | | | | | | | | | Clean up the decoding of the v6 media multiply space so that we UNDEF on unassigned encodings rather than randomly interpreting them as some instruction in this space. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * rsqrte_f32: No need to copy sign bit.Christophe LYON2011-10-191-2/+1
| | | | | | | | | | | | | | Indeed, the result is known to be always positive. Signed-off-by: Christophe Lyon <christophe.lyon@st.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* | Sparc: split load and store op helpersBlue Swirl2011-10-263-2418/+2437
| | | | | | | | | | | | | | Move load and store op helpers top ldst_helper.c. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Sparc: convert win_helper to trace frameworkBlue Swirl2011-10-262-22/+16
| | | | | | | | | | Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Sparc: convert interrupt helpers to trace frameworkBlue Swirl2011-10-263-26/+23
| | | | | | | | | | Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Sparc: convert mmu_helper to trace frameworkBlue Swirl2011-10-262-44/+30
| | | | | | | | | | Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Sparc: split MMU helpersBlue Swirl2011-10-264-861/+880
| | | | | | | | | | | | | | Move MMU helpers to mmu_helper.c. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Sparc: fix coding style in helper.cBlue Swirl2011-10-261-43/+52
| | | | | | | | | | | | | | Before the next patch, fix coding style of the areas affected. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Sparc: avoid AREG0 for division op helpersBlue Swirl2011-10-264-82/+88
| | | | | | | | | | | | | | | | Make [su]div{,cc} helpers take a parameter for CPUState instead of relying on global env. Move the functions to helper.c. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Sparc: avoid AREG0 for softint op helpers and Leon cache controlBlue Swirl2011-10-266-107/+117
| | | | | | | | | | | | | | | | | | Make softint op helpers and Leon cache irq manager take a parameter for CPUState instead of relying on global env. Move the functions to int{32,64}_helper.c. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Sparc: avoid AREG0 for CWP and PSTATE helpersBlue Swirl2011-10-264-201/+90
| | | | | | | | | | | | | | | | Make CWP and PSTATE helpers take a parameter for CPUState instead of relying on global env. Remove wrapper functions. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2011-10-2636-292/+524
|\ \
| * | block: change discard to co_discardPaolo Bonzini2011-10-214-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since coroutine operation is now mandatory, convert both bdrv_discard implementations to coroutines. For qcow2, this means taking the lock around the operation. raw-posix remains synchronous. The bdrv_discard callback is then unused and can be eliminated. Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | block: change flush to co_flushPaolo Bonzini2011-10-2110-33/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since coroutine operation is now mandatory, convert all bdrv_flush implementations to coroutines. For qcow2, this means taking the lock. Other implementations are simpler and just forward bdrv_flush to the underlying protocol, so they can avoid the lock. The bdrv_flush callback is then unused and can be eliminated. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | block: take lock around bdrv_write implementationsPaolo Bonzini2011-10-215-5/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This does the first part of the conversion to coroutines, by wrapping bdrv_write implementations to take the mutex. Drivers that implement bdrv_write rather than bdrv_co_writev can then benefit from asynchronous operation (at least if the underlying protocol supports it, which is not the case for raw-win32), even though they still operate with a bounce buffer. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | block: take lock around bdrv_read implementationsPaolo Bonzini2011-10-219-9/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This does the first part of the conversion to coroutines, by wrapping bdrv_read implementations to take the mutex. Drivers that implement bdrv_read rather than bdrv_co_readv can then benefit from asynchronous operation (at least if the underlying protocol supports it, which is not the case for raw-win32), even though they still operate with a bounce buffer. raw-win32 does not need the lock, because it cannot yield. nbd also doesn't probably, but better be safe. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | block: add a CoMutex to synchronous read driversPaolo Bonzini2011-10-219-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The big conversion of bdrv_read/write to coroutines caused the two homonymous callbacks in BlockDriver to become reentrant. It goes like this: 1) bdrv_read is now called in a coroutine, and calls bdrv_read or bdrv_pread. 2) the nested bdrv_read goes through the fast path in bdrv_rw_co_entry; 3) in the common case when the protocol is file, bdrv_co_do_readv calls bdrv_co_readv_em (and from here goes to bdrv_co_io_em), which yields until the AIO operation is complete; 4) if bdrv_read had been called from a bottom half, the main loop is free to iterate again: a device model or another bottom half can then come and call bdrv_read again. This applies to all four of read/write/flush/discard. It would also apply to is_allocated, but it is not used from within coroutines: besides qemu-img.c and qemu-io.c, which operate synchronously, the only user is the monitor. Copy-on-read will introduce a use in the block layer, and will require converting it. The solution is "simply" to convert all drivers to coroutines! We just need to add a CoMutex that is taken around affected operations. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | vmdk: clean up openPaolo Bonzini2011-10-211-22/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move vmdk_parent_open to vmdk_open. There's another path how vmdk_parent_open can be reached: vmdk_parse_extents() -> vmdk_open_sparse() -> vmdk_open_vmdk4() -> vmdk_open_desc_file(). If that can happen, however, the code is bogus. vmdk_parent_open reads from bs->file: if (bdrv_pread(bs->file, s->desc_offset, desc, DESC_SIZE) != DESC_SIZE) { but it is always called with s->desc_offset == 0 and with the same bs->file. So the data that vmdk_parent_open reads comes always from the same place, and anyway there is only one place where it can write it, namely bs->backing_file. So, if it cannot happen, the patched code is okay. It is also possible that the recursive call can happen, but only once. In that case there would still be a bug in vmdk_open_desc_file setting s->desc_offset = 0, but the patched code is okay. Finally, in the case where multiple recursive calls can happen the code would need to be rewritten anyway. It is likely that this would anyway involve adding several parameters to vmdk_parent_open, and calling it from vmdk_open_vmdk4. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | vmdk: fix return values of vmdk_parent_openPaolo Bonzini2011-10-211-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | While vmdk_open_desc_file (touched by the patch) correctly changed -1 to -EINVAL, vmdk_open did not. Fix it directly in vmdk_parent_open. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | pc: Fix floppy drives with if=noneKevin Wolf2011-10-215-16/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 63ffb564 broke floppy devices specified on the command line like -drive file=...,if=none,id=floppy -global isa-fdc.driveA=floppy because it relies on drive_get() which works only with -fda/-drive if=floppy. This patch resembles what we're already doing for IDE, i.e. remember the floppy device that was created and use that to extract the BlockDriverStates where needed. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
| * | qcow2: Fix bdrv_write_compressed error handlingKevin Wolf2011-10-212-13/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If during allocation of compressed clusters the cluster was already allocated uncompressed, fail and properly release the l2_table (the latter avoids a failed assertion). While at it, make it return some real error numbers instead of -1. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
| * | qemu-img: Don't allow preallocation and compression at the same timeKevin Wolf2011-10-211-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | Only qcow and qcow2 can do compression at all, and they require unallocated clusters when writing the compressed data. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
| * | fdc: Fix floppy port I/OKevin Wolf2011-10-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The floppy device was broken by commit 212ec7ba (fdc: Convert to isa_register_portio_list). While the old interface provided the port number relative to the floppy drive's io_base, the new one provides the real port number, so we need to apply a bitmask now to get the register number. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | block: add bdrv_co_discard and bdrv_aio_discard supportPaolo Bonzini2011-10-215-17/+109
| | | | | | | | | | | | | | | | | | | | | This similarly adds support for coroutine and asynchronous discard. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | block: drop redundant bdrv_flush implementationStefan Hajnoczi2011-10-217-74/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Block drivers now only need to provide either of .bdrv_co_flush, .bdrv_aio_flush() or for legacy drivers .bdrv_flush(). Remove the redundant .bdrv_flush() implementations. [Paolo Bonzini: change raw driver to bdrv_co_flush] Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | block: unify flush implementationsPaolo Bonzini2011-10-213-90/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add coroutine support for flush and apply the same emulation that we already do for read/write. bdrv_aio_flush is simplified to always go through a coroutine. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | xen_disk: Always set feature-barrier = 1Kevin Wolf2011-10-211-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | The synchronous .bdrv_flush callback doesn't exist any more and a device really shouldn't poke into the block layer internals anyway. All drivers are supposed to have a correctly working bdrv_flush, so let's just hard-code this. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | fix memory leak in aio_write_fAlex Jia2011-10-211-0/+1
| | | | | | | | | | | | | | | | | | | | | Haven't released memory of 'ctx' before return. Signed-off-by: Alex Jia <ajia@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | block: rename bdrv_co_rw_bhPaolo Bonzini2011-10-211-2/+2
| | | | | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | add socket_set_blockPaolo Bonzini2011-10-213-0/+14
| | | | | | | | | | | | | | | | | | Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | sheepdog: add coroutine_fn markersPaolo Bonzini2011-10-211-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | This makes the following patch easier to review. Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | | main-loop: Add missing include fileStefan Weil2011-10-251-25/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stdint.h defines the POSIX data types and is needed for MinGW-w64 (and maybe other hosts). v2: Instead of adding stdint.h directly, qemu-common.h is now included and duplicate include statements were removed. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | target-sparc: Fix use of g_new0 / g_freeStefan Weil2011-10-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | g_malloc0 needs g_free instead of free. While fixing this, I also replaced g_malloc0 by g_new0 as was suggested by Stuart Brady. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | | target-sparc: Fix order of function parametersStefan Weil2011-10-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MinGW-w64 gcc complains about wrong parameters for gen_helper_fpadd16_s and three other functions. gen_helper_fpadd16_s is declared like this (hidden in lots of macros): static inline void gen_helper_fpadd16s(TCGv_i32 retval, TCGv_ptr arg1, TCGv_i32 arg2, TCGv_i32 arg3); So it looks like cpu_env should be the 2nd parameter. Please review this patch as I have no environment to test it (maybe the 1st parameter should be cpu_dst?). Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | | hda: do not mix output and input stream states, RHBZ #740493Marc-André Lureau2011-10-253-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows 7 may use the same stream number for input and output. Current code will confuse streams. Changes since v1: - keep running_compat[] for migration version 1 - add running_real[] for migration version 2 Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
* | | hda: do not mix output and input streams, RHBZ #740493Marc-André Lureau2011-10-251-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows 7 may use the same stream number for input and output. That will result in lot of garbage on playback. The hardcoded value of 4 needs to be in sync with GCAP streams description and IN/OUT registers. Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com> Signed-off-by: malc <av1474@comtv.ru>