aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2008-11-19target-ppc: convert fp ops to TCGaurel326-636/+550
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5754 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-19kvm: de-register mem region for MMIO (Glauber Costa)aliguori1-1/+1
Besides unassigned memory, we also don't care about MMIO. So if we're giving an MMIO area that is already registered, wipe it out. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5753 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-19Fix media detection on emulated CDROM (Gary Grebus)aliguori1-1/+3
This patch tweaks the ATAPI CDROM emulation to fix an annoyance seen when running a variety of Linux guests: the desktop GUI shows a CDROM device as present, but is unable to automount the media and display its contents. The patch adds the PLAY_AUDIO capability bit to the data returned by MODE_SENSE commands. That convinces the guest kernel to determine what kind of media is present. Arguably Linux could be smarter about this, but it's my guess there are few (if any) hardware CDROM drives that don't set the bit, and there are a large number of Linux distros that exhibit this problem. Signed-off-by: Gary Grebus <ggrebus@virtualiron.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5752 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-19Only force inlining when optimizing.pbrook1-0/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5751 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18Add 40-bit DMA support to LSI scsi emulation (Ryan Harper)aliguori1-4/+32
This patch fixes Linux machines configured with > 4G of ram and using a SCSI device. Signed-off-by: Ryan Harper <ryanh@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5750 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18Fix Windows buildaliguori1-2/+2
ENOBUFS is not defined on Win32. Use ENOMEM instead which is more portable. This was reported by Hervé Poussineau. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5749 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18x86: Dump debug registers (Jan Kiszka)aliguori1-0/+7
As the debug registers are no longer dummies, let's include their current state into the 'info registers' output and other register dumps. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5748 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18x86: Debug register emulation (Jan Kiszka)aliguori5-42/+217
Built on top of previously enhanced breakpoint/watchpoint support, this patch adds full debug register emulation for the x86 architecture. Many corner cases were considered, and the result was successfully tested inside a Linux guest with gdb, but I won't be surprised if one or two scenarios still behave differently in reality. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5747 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18Introduce BP_CPU as a breakpoint type (Jan Kiszka)aliguori2-8/+39
Add another breakpoint/watchpoint type to BP_GDB: BP_CPU. This type is intended for hardware-assisted break/watchpoint emulations like the x86 architecture requires. To keep the highest priority for BP_GDB breakpoints, this type is always inserted at the head of break/watchpoint lists, thus is found first when looking up the origin of a debug interruption. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5746 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18Add debug exception hook (Jan Kiszka)aliguori2-0/+17
This patch allows to hook into the delivery of EXCP_DEBUG so that other use beyond guest debugging becomes possible. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5745 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18Introduce BP_WATCHPOINT_HIT flag (Jan Kiszka)aliguori3-15/+32
When one watchpoint is hit, others might have triggered as well. To support users of the watchpoint API which need to detect such cases, the BP_WATCHPOINT_HIT flag is introduced and maintained. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5744 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18gdbstub: manage CPUs as threads (Jan Kiszka)aliguori3-82/+196
This patch enhances QEMU's built-in debugger for SMP guest debugging. Using the thread support of the gdb remote protocol, each VCPU is mapped on a pseudo thread and exposed to the gdb frontend. This way you can easy switch the focus of gdb between the VCPUs and observe their states. On breakpoint hit, the focus is automatically adjusted just as for normal multi-threaded application under gdb control. Furthermore, the patch propagates breakpoint and watchpoint insertions or removals to all CPUs, not just the current one as it was the case so far. Without this, SMP guest debugging was practically unfeasible. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5743 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18Remove premature memop TB terminations (Jan Kiszka)aliguori3-16/+0
Now that we can properly restore the pc on watchpoint hits, there is no more need for prematurely terminating TBs if watchpoints are present. Remove all related bits. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5742 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18Restore pc on watchpoint hits (Jan Kiszka)aliguori2-2/+25
In order to provide accurate information about the triggering instruction, this patch adds the required bits to restore the pc if the access happened inside a TB. With the BP_STOP_BEFORE_ACCESS flag, the watchpoint user can control if the debug trap should be issued on or after the accessing instruction. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5741 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18Respect length of watchpoints (Jan Kiszka)aliguori1-10/+20
This adds length support for watchpoints. To keep things simple, only aligned watchpoints are accepted. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5740 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18Set mem_io_vaddr on io_read (Jan Kiszka)aliguori1-0/+1
Analogously to write accesses, we have to save the memory address also on read accesses in order to support read watchpoints. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5739 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18Refactor and enhance break/watchpoint API (Jan Kiszka)aliguori13-183/+267
This patch prepares the QEMU cpu_watchpoint/breakpoint API to allow the succeeding enhancements this series comes with. First of all, it overcomes MAX_BREAKPOINTS/MAX_WATCHPOINTS by switching to dynamically allocated data structures that are kept in linked lists. This also allows to return a stable reference to the related objects, required for later introduced x86 debug register support. Breakpoints and watchpoints are stored with their full information set and an additional flag field that makes them easily extensible for use beyond pure guest debugging. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5738 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18gdbstub: Return appropriate watch message to gdb (Jan Kiszka)aliguori1-2/+15
Return the appropriate type prefix (r, a, none) when reporting watchpoint hits to the gdb front-end. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5737 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18Refactor translation block CPU state handling (Jan Kiszka)aliguori11-95/+115
This patch refactors the way the CPU state is handled that is associated with a TB. The basic motivation is to move more arch specific code out of generic files. Specifically the long #ifdef clutter in tb_find_fast() has to be overcome in order to avoid duplicating it for the gdb watchpoint fixes (patch "Restore pc on watchpoint hits"). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5736 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18Convert CPU_PC_FROM_TB to static inline (Jan Kiszka)aliguori10-28/+59
as macros should be avoided when possible. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5735 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18Make KVM slot management more robustaliguori1-2/+40
KVM keeps track of physical memory based on slots in the kernel. The current code that translates QEMU memory mappings to slots work but is not robust in the fact of reregistering partial regions of memory. This patch does the right thing for reregistering partial regions of memory. It also prevents QEMU from using KVM private slots. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5734 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18target-ppc: fix regression introduced by commit 5729aurel321-1/+1
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5733 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18Preliminary AIX supportmalc7-4/+79
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5732 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18AIX's assembler does not support local labels, use relative addressing insteadmalc1-4/+3
(Laurent Vivier) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5731 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-18Use qemu_memalign instead of memalign in qemu_vmallocmalc1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5730 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-17TCG variable type checking.pbrook37-5832/+6267
Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5729 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-16target-i386: fix helper_pmovmskb_mmx helperaurel321-16/+16
(malc) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5728 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-16Attached patch fixes a series of this warningblueswir18-27/+43
when compiling on NetBSD: warning: array subscript has type 'char' Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5727 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-16Use correct trap for syscalls on Sparc32blueswir11-0/+4
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5726 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-16Fix warnings caused by timer_t, it is 32 bits on Sparc64blueswir11-3/+3
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5725 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-16Fix no_frame unused warning when SDL is disabledblueswir11-0/+2
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5724 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-15target-mips: avoid tcg internal error in mfc0/dmfc0aurel321-8/+11
Set t0 to 0 for unimplemented mfc0/dmfc0 instructions. This fixes a tcg internal error while booting mips linux. Noticed by Julia Longtin. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5723 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-14target-alpha: implement getxuid and getxgid syscallsaurel321-0/+24
This patch implemented the setxuid and setxgid syscalls for Alpha. These syscalls return two values, both uid/euid and gid/egid. In addition to returning the first value in $v0, the additional value is returned in the $a4 register. The syscalls are used instead of the separate syscalls for those values used on other architectures (this is probably because Alpha Linux started out syscall compatible with DEC/OSF/Tru64). With this patch, the perlbmk benchmarks from Spec2000 run properly. (Vince Weaver) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5722 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-14ppc-linux-user: handle EXCP_DEBUGaurel321-14/+13
Replace POWERPC_EXCP_DEBUG by EXCP_DEBUG as the former can not happen in user mode emulation, while the later can happen and should be handled. Noticed by Andrew Stubbs. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5721 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-13ETRAX-FS: Don't schedule DMA processing without active channels.edgar_igl1-14/+27
Avoid scheduling DMA processing when all channels are stopped or at end-of-list. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5720 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-13ETRAX-FS: Fix a segfault if pflash drive not found.edgar_igl1-1/+1
drive_get_index() returns -1 if a drive isn't found; don't use -1 to index drives_table. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5719 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-13x86: fix warning without CONFIG_KVM (Mark McLoughlin)aliguori1-2/+2
Warning is: target-i386/helper.c: In function `cpu_x86_cpuid': target-i386/helper.c:1373: warning: implicit declaration of function `host_cpuid' Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5718 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-13Fix CPUID ext2 features masking (Avi Kivity)aliguori1-1/+1
Typo. Exposes rdtscp which kills some guests. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5717 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-13block: make raw aio signaling non-blocking (Gerd Hoffman)aliguori1-7/+10
This patch switches the read handle of the signaling pipe into non-blocking mode. This avoids unwanted blocking reads and also allows to read all bytes out of the signaling pipe in case we got signaled more that once before the handler ran. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5716 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-13Define kvm_ioctl in the same way as ioctlaliguori3-14/+32
The third argument to ioctl is a ... which allows any value to be passed. In practice, glibc always treats the argument as a void *. Do the same thing for the kvm ioctls to keep things consistent with a traditional ioctl. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5715 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-13copyright & license for qemu_sockets.c (Gerd Hoffman)aliguori1-0/+14
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5714 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-12Fix brown-paper-bag bugs from live-migration patch (Charles Duffy)aliguori2-1/+2
In TCP migration, prevent an endless loop trying to retrieve error status. In exec migration, set the close pointer in the FdMigrationState structure. Color me embarrassed. Signed-off-by: Charles Duffy <charles_duffy@messageone.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5713 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-12Rename hz to hertz to keep AIX happymalc1-6/+6
The issue was first noticed/addressed by Laurent Vivier in his QEMU on AIX patches. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5712 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-12Rename misnamed BACK_CHAIN_OFFSET to LR_OFFSETmalc1-4/+4
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5711 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-12Avoid compiler warningmalc1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5710 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-12Don't use "hz" in identifiers to make AIX happy.balrog5-15/+15
malc found AIX headers leak "hz" and so it can't be used there. Change the occurences in hw/. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5709 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-12Include <strings.h> for ffs().balrog2-24/+25
ffs() is in <strings.h> although bsd compatible systems have it in <string.h> already. ffs() is used in omap1.c, omap2.c, omap_i2c.c, bt-sdp.c. These uses can be replaced with clz32() but ffs is more available. Problem was spotted by malc. Make host-utils.h formatting more consistent. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5708 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-12r5531 made x509 certs not loadable (original patch from Henrik Holst).balrog1-3/+1
The patch in r5531 which replaced a bunch of strncpy with pstrcpy causes the x509 credentials from the -vnc parameter to be one character shorter than entered meaning that there is currently no way to enter x509 certificates... git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5707 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-12Implement LSI53C895A quirks exposed by OpenServer (Justin Chevrier).balrog1-2/+22
After going through the debug log and scratching my head for quite some time. I found the following: The problem was with this block move: lsi_scsi: SCRIPTS dsp=0fae8e50 opcode 01000028 arg 00f63c40 lsi_scsi: DMA addr=0x00f63c40 len=36 The number of bytes to be transferred (len) should be 40 which corresponds to the block transfer of length 0x28 (from opcode 01000028). Instead we have a length of 36 (0x24). The code responsible for this is (in 'lsi_do_dma'): if (count > s->current_dma_len) count = s->current_dma_len; Basically we're overwriting the length 40 with the value 36 which I think we just left over in that variable from an earlier transfer. In my patch below I initialize s->current_dma_len to s->dbc before we begin the DMA transfer during Data In phase. The attached patch gets Openserver 5.0.5 past the hardware detection (and it lists the hard drive to boot, woohoo). It appears to stop a little while later (doesn't seem SCSI related), but it's been so long since I've booted Openserver I'm not sure what's supposted to happen after the HW detection using the boot/root disks. Props go to Craig Ringer for the initial post and the code that he posted some of which is in this patch. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5706 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-12fix some variable initizalization issues (Stefano Stabellini)aliguori2-1/+2
this patch fixes two variable initialization issues. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5705 c046a42c-6fe2-441c-8c8c-71466251a162