summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-12-07ARM: Return correct result for float-to-integer conversion of NaNPeter Maydell1-0/+27
The ARM architecture mandates that converting a NaN value to integer gives zero (if Invalid Operation FP exceptions are not being trapped). This isn't the behaviour of the SoftFloat library, so NaNs must be special-cased. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
2010-12-07softfloat: Add float*_is_any_nan() functionsPeter Maydell1-0/+10
Add float*_is_any_nan() functions which return true if the argument is a NaN of any kind (quiet or signalling). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
2010-12-07ARM: Fix sense of to_integer bit in Neon VCVT float/int conversionPeter Maydell1-4/+4
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
2010-12-07ARM: Fix decoding of Neon forms of VCVT between float and fixed pointPeter Maydell1-2/+6
Fix errors in the decoding of the Neon forms of fixed-point VCVT: * fixed-point VCVT is op 14 and 15, not 15 and 16 * the fbits immediate field was being misinterpreted * the sense of the to_fixed bit was inverted Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
2010-12-07ARM: Fix decoding of VFP forms of VCVT between float and int/fixedPeter Maydell1-7/+12
Correct the decoding of source and destination registers for the VFP forms of the VCVT instructions which convert between floating point and integer or fixed-point. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
2010-12-07ARM: fix ldrexd/strexdPeter Maydell2-4/+6
Correct ldrexd and strexd code to always read and write the high word of the 64-bit value from addr+4. Also make ldrexd and strexd agree that for a 64 bit value the address in env->exclusive_addr is that of the low word. This fixes the issues reported in https://bugs.launchpad.net/qemu/+bug/670883 Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
2010-12-07target-arm: Handle 'smc' as an undefined instructionAdam Lackorzynski1-1/+8
Refine check on bkpt so that smc and undefined instruction encodings are handled as an undefined instruction and trap. Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
2010-12-07target-arm: Fix mixup in decoding of saturating add and subJohan Bengtsson1-2/+2
The thumb2 decoder contained a mixup between the bit controlling doubling and the bit controlling if the operation was an add or a sub. Signed-off-by: Johan Bengtsson <teofrastius@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
2010-12-07target-arm: Add support for PKHxx in thumb2Johan Bengtsson1-18/+45
The PKHxx instructions were not recognized by the thumb2 decoder. The solution provided in this changeset is identical to the arm-mode implementation. Signed-off-by: Johan Bengtsson <teofrastius@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
2010-12-05Speedup 'tb_find_slow' by using the same heuristic as during memory page lookupKirill Batuzov1-0/+6
Move the last found TB to the head of the list so it will be found more quickly next time it will be looked for. Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru> Signed-off-by: Pavel Yushchenko <pau@ispras.ru> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-04Remove unused spin_trylock() functionPeter Maydell1-10/+0
Remove the spin_trylock() function, as it is not used anywhere, and is not even implemented if CONFIG_USE_NPTL is defined. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-04darwin-user: Use GCC_FMT_ATTR (format checking)Stefan Weil2-2/+2
The redundant forward declaration of qerror in machload.c is removed because it should be taken from qemu.h. Please note that this patch is untested because I have no matching environment to compile it. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-04audio: Use GCC_FMT_ATTR (format checking)Stefan Weil1-1/+2
Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-04target-sparc: Use fprintf_function (format checking)Stefan Weil1-2/+2
This change was missing in commit 9a78eead0c74333a394c0f7bbfc4423ac746fcd5. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-04*-dis: Replace fprintf_ftype by fprintf_function (format checking)Stefan Weil7-30/+19
This patch adds more printf format checking. Additional modifications were needed for this code change: * alpha-dis.c: The local definition of MAX conflicts with a previous definition from osdep.h, so add an #undef. * dis-asm.h: Add include for fprintf_function (qemu-common.h). The standard (now redundant) includes are removed. * mis-dis.c: The definition of ARRAY_SIZE is no longer needed and must be removed (conflict with previous definition from qemu-common.h). * sh4-dis.c: Remove some unneeded forward declarations. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-04Fix mingw32 and OpenBSD warningsBlue Swirl1-1/+1
ffsl() is not universally available, so there are these warnings on both mingw32 and OpenBSD: /src/qemu/hw/pcie_aer.c: In function 'pcie_aer_update_log': /src/qemu/hw/pcie_aer.c:399: warning: implicit declaration of function 'ffsl' Since status field in PCIEAERErr is uint32_t, we can just use ffs() instead. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-04Merge branch 'linux-user-for-upstream' of git://gitorious.org/qemu-maemo/qemuEdgar E. Iglesias14-95/+292
* 'linux-user-for-upstream' of git://gitorious.org/qemu-maemo/qemu: linux-user: fix mips and ppc to use UID16 update binfmt conf linux-user: fix compiler error on nptl ARM: linux-user: Restore iWMMXT state from ucontext on sigreturn ARM: linux-user: Expose iWMMXT registers to signal handlers ARM: linux-user: Restore VFP state from ucontext on sigreturn ARM: linux-user: Expose VFP registers to signal handlers ARM: Expose vfp_get_fpscr() and vfp_set_fpscr() to C code ARM: linux-user: Correct size of padding in target_ucontext_v2 target-sparc: remove unused functions cpu_lock(), cpu_unlock() ARM: enable XScale/iWMMXT in linux-user mode linux-user: Translate getsockopt level option linux-user: remove unnecessary local from __get_user(), __put_user() linux-user: fix memory leaks with NPTL emulation linux-user: mmap_reserve() not controlled by RESERVED_VA [PATCH] target-arm: remove unused functions cpu_lock(), cpu_unlock()
2010-12-03exec: Remove debugging fprintf() that slipped into qemu_ram_alloc_from_ptr()Stefan Hajnoczi1-1/+0
Remove the debugging fprintf() slipped in via the following commit: commit b2e0a138e77245290428a7d599a929e2e1bfe510 Author: Michael S. Tsirkin <mst@redhat.com> Date: Mon Nov 22 19:52:34 2010 +0200 migration: stable ram block ordering Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-12-03linux-user: fix mips and ppc to use UID16Martin Mohring3-35/+35
Signed-off-by: Martin Mohring <martin.mohring@5edatasoft.com> Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org> Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2010-12-03update binfmt confRiku Voipio1-2/+6
1) dont register i386 qemu on x86_64 host 2) widen sparc and arm match 3) add sh4, based on patch by David Kozub <zub@linux.fjfi.cvut.cz> Rest based on patch by Jan-Simon Möller <jsmoeller@linuxfoundation.org>
2010-12-03linux-user: fix compiler error on nptlRiku Voipio1-1/+2
Some compilers detect that new_stack isnt used after dd75d784 Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2010-12-03ARM: linux-user: Restore iWMMXT state from ucontext on sigreturnPeter Maydell1-0/+30
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2010-12-03ARM: linux-user: Expose iWMMXT registers to signal handlersPeter Maydell1-0/+37
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2010-12-03ARM: linux-user: Restore VFP state from ucontext on sigreturnPeter Maydell1-0/+40
Restore the VFP registers from the ucontext on return from a signal handler in linux-user mode. This means that signal handlers cannot accidentally corrupt the interrupted code's VFP state, and allows them to deliberately modify the state via the ucontext structure. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2010-12-03ARM: linux-user: Expose VFP registers to signal handlersPeter Maydell1-1/+46
For ARM linux-user mode signal handlers, fill in the ucontext with VFP register contents in the same way that the kernel does. We only do this for v2 format sigframe (2.6.12 and above); this is actually bug-for-bug compatible with the older kernels, which don't save and restore VFP registers either. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2010-12-03ARM: Expose vfp_get_fpscr() and vfp_set_fpscr() to C codePeter Maydell2-0/+14
Expose the vfp_get_fpscr() and vfp_set_fpscr() functions to C code as well as generated code, so we can use them to read and write the FPSCR when saving and restoring VFP registers across signal handlers in linux-user mode. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2010-12-03ARM: linux-user: Correct size of padding in target_ucontext_v2Peter Maydell1-1/+1
The padding in the target_ucontext_v2 is defined by the size of the target's sigset_t type, not the host's. (This bug only causes problems when we start using the uc_regspace[] array to expose VFP registers to userspace signal handlers.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2010-12-03target-sparc: remove unused functions cpu_lock(), cpu_unlock()Peter Maydell2-16/+0
2010-12-03ARM: enable XScale/iWMMXT in linux-user modePeter Maydell1-0/+6
In linux-user mode, the XScale/iWMMXT coprocessors must be enabled at reset so that we can run code that uses these instructions. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2010-12-03linux-user: Translate getsockopt level optionJamie Lentin1-10/+61
n setsockopt, the socket level options are translated to the hosts' architecture before the real syscall is called, e.g. TARGET_SO_TYPE -> SO_TYPE. This patch does the same with getsockopt. Tested on a x86 host emulating MIPS. Without it:- $ grep getsockopt host.strace 31311 getsockopt(3, SOL_SOCKET, 0x1007 /* SO_??? */, 0xbff17208, 0xbff17204) = -1 ENOPROTOOPT (Protocol not available) With:- $ grep getsockopt host.strace 25706 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0 Whitespace cleanup: Riku Voipio Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2010-12-03linux-user: remove unnecessary local from __get_user(), __put_user()Peter Maydell1-4/+2
Remove an unnecessary local variable from the __get_user() and __put_user() macros. This avoids confusing compilation failures if the name of the local variable ('size') happens to be the same as the variable the macro user is trying to read/write. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2010-12-03linux-user: fix memory leaks with NPTL emulationNathan Froyd3-8/+9
Running programs that create large numbers of threads, such as this snippet from libstdc++'s pthread7-rope.cc: const int max_thread_count = 4; const int max_loop_count = 10000; ... for (int j = 0; j < max_loop_count; j++) { ... for (int i = 0; i < max_thread_count; i++) pthread_create (&tid[i], NULL, thread_main, 0); for (int i = 0; i < max_thread_count; i++) pthread_join (tid[i], NULL); } in user-mode emulation will quickly run out of memory. This is caused by a failure to free memory in do_syscall prior to thread exit: /* TODO: Free CPU state. */ pthread_exit(NULL); The first step in fixing this is to make all TaskStates used by QEMU dynamically allocated. The TaskState used by the initial thread was not, as it was allocated on main's stack. So fix that, free the cpu_env, free the TaskState, and we're home free, right? Not exactly. When we create a thread, we do: ts = qemu_mallocz(sizeof(TaskState) + NEW_STACK_SIZE); ... new_stack = ts->stack; ... ret = pthread_attr_setstack(&attr, new_stack, NEW_STACK_SIZE); If we blindly free the TaskState, then, we yank the current (host) thread's stack out from underneath it while it still has things to do, like calling pthread_exit. That causes problems, as you might expect. The solution adopted here is to let the C library allocate the thread's stack (so the C library can properly clean it up at pthread_exit) and provide a hint that we want NEW_STACK_SIZE bytes of stack. With those two changes, we're done, right? Well, almost. You see, we're creating all these host threads and their parent threads never bother to check that their children are finished. There's no good place for the parent threads to do so. Therefore, we need to create the threads in a detached state so the parent thread doesn't have to call pthread_join on the child to release the child's resources; the child does so automatically. With those three major changes, we can comfortably run programs like the above without exhausting memory. We do need to delete 'stack' from the TaskState structure. Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2010-12-03linux-user: mmap_reserve() not controlled by RESERVED_VAamateur1-1/+3
mmap_reserve() should be called only when RESERVED_VA is enabled. Otherwise, unmaped virtual address space will never be reusable. This bug will exhaust virtual address space in extreme conditions. Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2010-12-03[PATCH] target-arm: remove unused functions cpu_lock(), cpu_unlock()Peter Maydell2-16/+0
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2010-12-02Fix buildAnthony Liguori1-1/+0
msix.o and msi.o get pulled into the build unconditionally for QMP. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-12-02Merge remote branch 'mst/for_anthony' into stagingAnthony Liguori36-110/+1446
2010-12-02vhost: Fix address calculation in vhost_dev_sync_region()Jason Wang1-0/+1
We still need advance address even we find there's no dirty pages in current chunk. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-12-02migration: allow rate > 4gMichael S. Tsirkin4-11/+16
I'd like to disable bandwidth limit or make it very high, Use int64_t all over to make values >= 4g work. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Jason Wang <jasowang@redhat.com>
2010-12-02migration: stable ram block orderingMichael S. Tsirkin4-3/+61
This makes ram block ordering under migration stable, ordered by offset. This is especially useful for migration to exec, for debugging. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Jason Wang <jasowang@redhat.com>
2010-12-01tcg-ia64: Fix warning in qemu_ld.Richard Henderson1-2/+1
The usermode version of qemu_ld doesn't used mem_index, leading to set-but-not-used warnings. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2010-12-01tcg-ia64: Fix address compilation in qemu_st.Richard Henderson1-1/+1
A typo in the usermode address calculation path; R3 used where R2 needed. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2010-12-01tcg-ia64: Fix tlb read error for 32-bit targets.Richard Henderson1-1/+3
Use ld4 not ld8 for reading the tlb of 32-bit targets. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2010-12-01tcg-ia64: Implement qemu_ld32.Richard Henderson1-0/+1
The port was not properly merged following 86feb1c860dc38e9c89e787c5210e8191800385e Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2010-12-01tcg-ia64: Provide default GUEST_BASE.Richard Henderson1-0/+3
Fix compilation error when GUEST_BASE is not defined. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2010-12-01tcg: Fix default definition of divu_i32 and remu_i32.Richard Henderson1-2/+2
The arguments to tcg_gen_helper32 for these functions were not updated correctly in rev 2bece2c88331f024a46527634e3dd91c71d22141. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2010-12-01Merge remote branch 'origin/master' into pciMichael S. Tsirkin123-1194/+2979
Conflicts: Makefile.objs hw/virtio.c
2010-11-30Merge remote branch 'kwolf/for-anthony' into stagingAnthony Liguori23-245/+234
2010-11-30Merge remote branch 'qmp/for-anthony' into stagingAnthony Liguori8-122/+481
2010-11-30Use a Linux-style MAINTAINERS fileAnthony Liguori1-77/+417
I make no claims that this is accurate or exhaustive but I think it's a reasonable place to start. As the file mentions, the purpose of this file is to give contributors information about who they can go to with questions about a particular piece of code or who they can ask for review. If you sign up for a piece of code and indicate that it's Maintained or Supported, please be prepared to be responsive to questions about that subsystem. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- v1 -> v2 - Sort alphabetically - Copy in instructions from linux MAINTAINERS - Fix entries based on review feedback
2010-11-29ide: Reset current_addr after stopping DMAKevin Wolf1-1/+1
Whenever SSBM is reset in the command register all state information is lost. Restarting DMA means that current_addr must be reset to the base address of the PRD table. The OS is not required to change the base address register before starting a DMA operation, it can reuse the value it wrote for an earlier request. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>