summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-03-07tcg: Add support for debugging leakage of temporariesPeter Maydell2-0/+49
Add support (if CONFIG_DEBUG_TCG is defined) for debugging leakage of temporary variables. Generally any temporaries created by a target while it is translating an instruction should be freed by the end of that instruction; otherwise carefully crafted guest code could cause TCG to run out of temporaries and assert. By calling tcg_check_temp_count() after each instruction we can check that we are not leaking temporaries in this way. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06target-arm: Integrate secondary CPU reset in arm_bootAdam Lackorzynski2-22/+15
Integrate secondary CPU reset into arm_boot, removing it from realview.c. On non-Linux systems secondary CPUs start with the same entry as the boot CPU. Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06target-arm: Implement cp15 VA->PA translationAdam Lackorzynski3-3/+50
Implement VA->PA translations by cp15-c7 that went through unchanged previously. Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06target-arm: Fix soft interrupt in GIC distributorAdam Lackorzynski1-2/+2
Fix selection of target list filter mode. Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06target-arm: Set carry flag correctly for Thumb2 ORNSPeter Maydell1-2/+1
The code for Thumb2 ORNS (or negated and set flags) was trashing a TCG input register which was needed later for use in calculating flags, with the effect that the carry flag was always set with the wrong sense. Fix this by using the TCG orc op instead of separate not and or ops. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06ioport: Improve error outputAndreas Färber1-2/+4
When failing due to conflicting I/O port registrations, include the offending I/O port address in the message. Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06tracetool: Add optional argument to specify dtrace probe namesJes Sorensen1-6/+13
Optional feature allowing a user to generate the probe list to match the name of the binary, in case they wish to install qemu under a different name than qemu-{system,user},<arch> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Stefan Hajnoczi <stefaha@linux.vnet.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06target-arm: Handle VMOV between two core and VFP single regsPeter Maydell1-5/+5
Fix two bugs in the translation of the instructions VMOV sa,sb,rx,ry and VMOV rx,ry,sa,sb (which copy between a pair of ARM core registers and a pair of VFP single precision registers): * An incorrect condition meant these instruction patterns were being treated as load/store multiple, which resulted in the generation of bad code and a runtime segfault * The order of the core register pair was reversed so the values would go to the wrong registers Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06w32: Add support for cursesStefan Weil1-1/+5
MinGW optionally includes pdcurses, so add support for it. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06target-arm: Don't decode old cp15 WFI instructions on v7 coresPeter Maydell1-5/+30
In v7 of the ARM architecture, WFI (wait for interrupt) is a first-class instruction, but in previous versions this functionality was provided via a cp15 coprocessor register. Add correct feature checks to the decoding of the cp15 WFI instructions so that they behave correctly for newer cores. In particular, the old 0,c7,c8,2 encoding used on ARM940 has been reused for VA-to-PA translation in v6 and v7. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06net: Add the missing option declaration of "vhostforce"Jason Wang1-1/+5
Signed-off-by: Jason Wang <jasowang@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06gt64xxx: remove savevm supportJuan Quintela1-21/+0
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06vmstate: remove uninorth savevm codeJuan Quintela1-21/+0
It was migrating the wrong structures, no way it would work Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06vmstate: remove grackle_pci savevm codeJuan Quintela1-19/+0
It was migrating the wrong structures, no way it would work Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06net: remove parse_host_src_port() functionJuan Quintela2-44/+0
It was deprecated, and it has no users. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06hw/sd.c: fix sd_set_cb() crash when bdrv == NULLAurelien Jarno1-2/+2
sd_set_cb() calls bdrv_is_read_only() and bdrv_is_inserted() even if no block driver is associated with the card reader. This patch fixes the issues by not setting the irq in this case, this fixes ARM versatile crash. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06net: Use iov helper functionsBenjamin Poirier1-22/+6
Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06docs: Update stderr and simple backend, add systemtap backendStefan Hajnoczi1-4/+26
The following additions to the tracing documentation are included: 1. Move "stderr" backend documentation to top-level and out of "simple" backend. Include hints on when this backend is useful. 2. Document the "simple" backend thread-safety limitation. 3. Document the "dtrace" backend for SystemTap. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06simpletrace: Make simpletrace.py a Python moduleStefan Hajnoczi1-33/+90
The simpletrace.py script pretty-prints a binary trace file. Most of the code can be reused by trace file analysis scripts, so turn it into a module. Here is an example script that uses the new simpletrace module: #!/usr/bin/env python # Print virtqueue elements that were never returned to the guest. import simpletrace class VirtqueueRequestTracker(simpletrace.Analyzer): def __init__(self): self.elems = set() def virtqueue_pop(self, vq, elem, in_num, out_num): self.elems.add(elem) def virtqueue_fill(self, vq, elem, length, idx): self.elems.remove(elem) def end(self): for elem in self.elems: print hex(elem) simpletrace.run(VirtqueueRequestTracker()) The simpletrace API is based around the Analyzer class. Users implement an analyzer subclass and add methods for trace events they want to process. A catchall() method is invoked for trace events which do not have dedicated methods. Finally, there are also begin() and end() methods like in sed that can be used to perform setup or print statistics at the end. A binary trace file is processed either with: simpletrace.run(analyzer) # uses command-line args or with: simpletrace.process('path/to/trace-events', 'path/to/trace-file', analyzer) Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06linux-user: Fix large seeks by 32 bit guest on 64 bit hostPeter Maydell1-6/+10
When emulating a 32 bit Linux user-mode program on a 64 bit target we implement the llseek syscall in terms of lseek. Correct a bug which meant we were silently casting the result of host lseek() to a 32 bit integer as it passed through get_errno() and thus throwing away the top half. We also don't try to store the result back to userspace unless the seek succeeded; this matches the kernel behaviour. Thanks to Eoghan Sherry for identifying the problem and suggesting a solution. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06hw/realview: Wire up the MMC card statusPeter Maydell1-3/+26
Instantiate the three PL061 GPIO modules the realview boards have. Connect the MMC card status outputs of the PL181 MMC controller to both the system registers and the GPIO module which handles internal devices. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06hw/irq: Add qemu_irq_split() so one GPIO output can feed two inputsPeter Maydell2-0/+18
Add a qemu_irq_split() function which allows a board to wire a single GPIO output up to two GPIO inputs. This is needed for realview boards, where the MMC card status is visible both in a system register and via a PL061 GPIO module. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06hw/pl061.c: Implement ARM PL061 as well as Luminary onePeter Maydell2-5/+20
ARM's PL061 has a different set of ID registers to the one in the Luminary Stellaris; implement this so that the Linux driver can identify the Realview PBX PL061 correctly. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06hw/arm_sysctl.c: Wire MCI register MMC card status bits to GPIO inputsPeter Maydell2-1/+50
Implement some GPIO inputs which a board can connect up to set the MMC card status bits in the MCI register. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06hw/pl181: Implement GPIO output pins for card statusPeter Maydell1-0/+6
Add two GPIO output pins to the PL181 model to indicate the card present and readonly status information. On ARM boards these usually are reflected in a system register. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06lsi53c895a: Update dnad when skipping MSGOUT bytesStefan Hajnoczi1-2/+9
Update not only dbc but also dnad when skipping bytes during the MSGOUT phase. Previously only dbc was updated which is probably wrong and could lead to bogus message codes being read. Tested on Linux and Windows Server 2003. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06WIN32: Add missing include for 'struct timeval', used in vnc.hHervé Poussineau1-0/+1
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-03-05hw/pcnet.c: Fix EPROM contents to suit AMD netware driversGerhard Wiesinger1-0/+16
bugfix under DOS for AMD netware driver: AMD PCNTNW Ethernet MLID v3.10 (960115), network card not found bugfix works well under DOS with: 1.) AMD NDIS driver v2.0.1 2.) AMD PCNTNW Ethernet MLID v3.10 (960115) 3.) Knoppix 6.2 Signed-off-by: Gerhard Wiesinger <lists@wiesinger.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-03-05net: fix qemu_can_send_packet logicVincent Palatin1-3/+3
If any of the clients is not ready to receive (ie it has a can_receive callback and can_receive() returns false), we don't want to start sending, else this client may miss/discard the packet. I got this behaviour with the following setup : the emulated machine is using an USB-ethernet adapter, it is connected to the network using SLIRP and I'm dumping the traffic in a .pcap file. As per the following command line : -net nic,model=usb,vlan=1 -net user,vlan=1 -net dump,vlan=1,file=/tmp/pkt.pcap Every time that two packets are coming in a row from the host, the usb-net code will receive the first one, then returns 0 to can_receive call since it has a 1 packet long queue. But as the dump code is always ready to receive, qemu_can_send_packet will return true and the next packet will discard the previous one in the usb-net code. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-03-05net: fix trace when debug is activated in slirpVincent Palatin1-1/+1
make the code compile correctly when DEBUG is activated. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-03-03linux-user: fix compile failure if !CONFIG_USE_GUEST_BASEPeter Maydell1-0/+4
If CONFIG_USE_GUEST_BASE is not defined, gcc complains: linux-user/mmap.c:235: error: comparison of unsigned expression >= 0 is always true because RESERVED_VA is #defined to 0. Since mmap_find_vma_reserved() will never be called anyway if RESERVED_VA is always 0, fix this by simply #ifdef'ing away the function and its callsite. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-03virtio-net: Fix lduw_p() pointer argument of wrong sizeStefan Hajnoczi1-2/+2
A pointer to a size_t variable was passed as the void * pointer to lduw_p() in virtio_net_receive(). Instead of acting on the 16-bit value this caused failure on big-endian hosts. Avoid this issue in the future by using stw_p() instead. In general we should use ld*_p() for loading from target memory and st*_p() for storing to target memory anyway, not the other way around. Also tighten up a correct use of lduw_p() when stw_p() should be used instead in virtio_net_get_config(). Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-03target-sh4: move intr_at_halt out of cpu_halted()Aurelien Jarno4-4/+4
All targets except SH4 have the same cpu_halted() routine, and it has only one caller. It is therefore a good candidate for inlining. The difference is the handling of the intr_at_halt, which is necessary to ignore SR.BL when sleeping. Move intr_at_halt handling out of it, by setting this variable while executing the sleep instruction, and clearing it when the CPU has been woken-up by an interrupt, whatever the state of SR.BL. Also rename this variable in_sleep. Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-03pxa2xx: port pxa2xx_rtc to using qdev/vmstateAndrzej Zaborowski2-101/+100
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-03pxa2xx_dma: Get rid of a forward declaration.Andrzej Zaborowski1-26/+24
2011-03-03pxa2xx_dma: port to qdev/vmstateAndrzej Zaborowski4-111/+152
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-03vmstate: move VMSTATE_PCIE_AER_ERRS to hw/hw.hDmitry Eremin-Solenikov2-11/+21
VMSTATE_PCIE_AER_ERRS is indeed useful for other emulation drivers. Move it to hw/hw.h under the name of VMSTATE_STRUCT_VARRAY_POINTER_UINT16. Also add VMSTATE_STRUCT_VARRAY_POINTER_INT32 which is more or less the same as _UINT16 macro, except the fact it uses int32_t internally. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-03pxa2xx_dma: drop unused pxa2xx_dma_handler_t/handler fieldDmitry Eremin-Solenikov1-5/+0
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-03pxa2xx_timer: Store relevant irq line in each timer.Andrzej Zaborowski1-7/+8
2011-03-03pxa2xx_timer: switch to using qdev/vmstateDmitry Eremin-Solenikov3-109/+154
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-03pxa2xx_timer: change info struct name to comply with guidelinesDmitry Eremin-Solenikov1-14/+14
It should be PXA2xxTimerInfo, not pxa2xx_timer_info. Replace all occurences of old name with the new one. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-03pxa2xx_pic: Set base address for sysbus device.Andrzej Zaborowski1-0/+2
Thid device's registration was broken since e1f8c729fa890c67bb4532f22c22ace6fb0e1aaf, this should fix it.
2011-03-03vmstate: add VMSTATE_STRUCT_ARRAY_TESTDmitry Eremin-Solenikov1-8/+13
This is a _TEST variant of VMSTATE_STRUCT_ARRAY, necessary e.g. for future patch changing pxa2xx_timer to use vmstate. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-01microblaze: Correct copy+paste:o in defconfigsEdgar E. Iglesias2-2/+2
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-02-25HACKING: Update status of format checkingStefan Weil1-3/+0
Hopefully all functions with printf like arguments now use format checking. This was tested with default build configuration on linux and windows hosts (including some cross compilations), so chances are good that there remain few (if any) functions without format checking. Therefore the last comment in HACKING is no longer valid but misleading. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-02-25vnc: fix a memory leak in threaded vnc serverCorentin Chary1-0/+2
VncJobQueue's buffer is intended to be used for as the output buffer for all operations in this queue, but unfortunatly. vnc_async_encoding_start() is in charge of setting this buffer as the current output buffer, but vnc_async_encoding_end() was not writting the changes back to VncJobQueue, resulting in a big and ugly memleak. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-02-25Use sigwait instead of sigwaitinfo.Tristan Gingold1-18/+18
Fix compilation failure on Darwin. Signed-off-by: Tristan Gingold <gingold@adacore.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-25bitops: fix error on OpenBSD and mingw32Blue Swirl1-1/+1
Fix this error: CC bitops.o In file included from /src/qemu/bitops.c:14: /src/qemu/bitops.h:69: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'unsigned' Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-25bitops: fix test_and_change_bit()Corentin Chary1-1/+1
./bitops.h:192: warning: ‘old’ is used uninitialized in this function Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-25slirp: Remove some type casts caused by bad declaration of x.tp_bufStefan Weil2-8/+8
x.tp_buf was declared as a uint8_t array, but always used as a char array (which needed a lot of type casts). The patch includes these changes: * Fix declaration of x.tp_buf and remove all type casts. * Use offsetof() to get the offset of x.tp_buf. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>