summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Allow qemu_devtree_setprop() to take arbitrary valuesDavid Gibson2011-04-012-2/+2
| | | | | | | | | | | | Currently qemu_devtree_setprop() expects the new property value to be given as a uint32_t *. While property values consisting of u32s are common, in general they can have any bytestring value. Therefore, this patch alters the function to take a void * instead, allowing callers to easily give anything as the property value. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
* Clean up PowerPC SLB handling codeDavid Gibson2011-04-014-136/+79
| | | | | | | | | | | | | | | | | | | | Currently the SLB information when emulating a PowerPC 970 is storeed in a structure with the unhelpfully named fields 'tmp' and 'tmp64'. While the layout in these fields does match the description of the SLB in the architecture document, it is not convenient either for looking up the SLB, or for emulating the slbmte instruction. This patch, therefore, reorganizes the SLB entry structure to be divided in the the "ESID related" and "VSID related" fields as they are divided in instructions accessing the SLB. In addition to making the code smaller and more readable, this will make it easier to implement for the 1TB segments used in more recent PowerPC chips. Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* target-ppc: ext32u instead of andi with constantAurelien Jarno2011-04-011-4/+4
| | | | | | Cc: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Alexander Graf <agraf@suse.de>
* lm32: use lookup table for opcodesMichael Walle2011-03-312-140/+18
| | | | | | | Instead of a for loop use a faster lookup table. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* lm32: rename raise opcode to scallMichael Walle2011-03-312-3/+3
| | | | | | | To be consistent with the new reference manual. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* add a service to reap zombies, use it in SLIRPPaolo Bonzini2011-03-294-10/+69
| | | | | | | | | | | | | SLIRP -smb support wants to fork a process and forget about reaping it. To please it, add a generic service to register a process id and let QEMU reap it. In the future it could be enhanced to pass a status, but this would be unused. With this in place, the SIGCHLD signal handler would not stomp on pclose anymore. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* extract I/O handler lists to iohandler.cPaolo Bonzini2011-03-294-102/+138
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vhost: fix dirty page handlingMichael S. Tsirkin2011-03-281-1/+3
| | | | | | | | | | vhost was passing a physical address to cpu_physical_memory_set_dirty, which is wrong: we need to translate to ram address first. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Note: this lead to crashes during migration, so the patch is needed on the stable branch too.
* virtio-serial: don't crash on invalid inputMichael S. Tsirkin2011-03-281-0/+3
| | | | | | | Fix crash on invalid input in virtio-serial. Discovered by code review, untested. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* e1000: check buffer availabilityMichael S. Tsirkin2011-03-281-8/+8
| | | | | | | | Reduce spurious packet drops on RX ring empty by verifying that we have at least 1 buffer ahead of the time. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* virtio-pci: fix bus master work around on loadMichael S. Tsirkin2011-03-282-7/+7
| | | | | | | | | | | | | | | | | Commit c81131db15dd1844d0db1d51f3cd7a105cfd2cf3 detects old guests by comparing virtio and PCI status. It attempts to do this on load, as well, but load_config callback in a binding is invoked too early and so the virtio status isn't set yet. We could add yet another callback to the binding, to invoke after load, but it seems easier to reuse the existing vmstate callback. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Cc: Alexander Graf <agraf@suse.de>
* pci: use uint8_t for devfn_minIsaku Yamahata2011-03-283-7/+7
| | | | | | | use uint8_t for devfn_min instead of int. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: use PCI_DEVFN in pci_get_bus_devfn()Isaku Yamahata2011-03-281-1/+1
| | | | | | | Replace hardcoded logic by a common macro. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: use devfn for pci_find_device() instead of (slot, fn) pairIsaku Yamahata2011-03-285-8/+8
| | | | | | | | (slot, fn) pair is somewhat confusing because of ARI. So use devfn for pci_find_device() instead of (slot, fn). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: replace the magic, 256, for the maximum of devfnIsaku Yamahata2011-03-282-1/+2
| | | | | | | | Introduce symbol PCI_SLOT_MAX for the # of slots, and replace the magic, 256. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* report that QEMU process was killed by a signalGleb Natapov2011-03-263-4/+25
| | | | | | | | | Currently when rogue script kills QEMU process (using TERM/INT/HUP signal) it looks indistinguishable from system shutdown. Lets report that QEMU was killed and leave some clues about the killer identity. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* rtl8139: add vlan tag insertionBenjamin Poirier2011-03-261-15/+60
| | | | | | | | | | | | Add support to the emulated hardware to insert vlan tags in packets going from the guest to the network. Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com> Cc: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* rtl8139: add vlan tag extractionBenjamin Poirier2011-03-261-14/+52
| | | | | | | | | | | | | | | | | | | Add support to the emulated hardware to extract vlan tags in packets going from the network to the guest. Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com> Cc: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Blue Swirl <blauwirbel@gmail.com> -- AFAIK, extraction is optional to get vlans working. The driver requests rx detagging but should not assume that it was done. Under Linux, the mac layer will catch the vlan ethertype. I only added this part for completeness (to emulate the hardware more truthfully...) Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* rtl8139: cleanup FCS calculationBenjamin Poirier2011-03-261-17/+3
| | | | | | | | | | | clean out ifdef's around ethernet checksum calculation Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com> Acked-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* severe memory leak caused by broken palette_destroy() functionUlrich Obergfell2011-03-251-3/+1
| | | | | | | | | | | | | | | | | | | | | The following commit breaks the code of the function palette_destroy(). http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=commit;h=e31e3694afef58ba191cbcc6875ec243e5971268 The broken code causes a severe memory leak of 'VncPalette' structures because it never frees anything: 70 void palette_destroy(VncPalette *palette) 71 { 72 if (palette == NULL) { 73 qemu_free(palette); 74 } 75 } Version 2 of the patch calls qemu_free() unconditionally. Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vl.c: Fix compilation failure if CONFIG_SDL isn't definedPeter Maydell2011-03-251-6/+7
| | | | | | | | Fix a compilation failure if CONFIG_SDL isn't defined (gcc complained that the label 'invalid_display' wasn't used). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote branch 'amit/for-anthony' into stagingAnthony Liguori2011-03-248-27/+52
|\
| * char: Prevent multiple devices opening same chardevAmit Shah2011-03-213-1/+11
| | | | | | | | | | | | | | | | | | | | | | Prevent: -chardev socket,path=/tmp/foo,server,nowait,id=c0 \ -device virtserialport,chardev=c0,id=vs0 \ -device virtserialport,chardev=c0,id=vs1 Reported-by: Mike Cao <bcao@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
| * virtio-console: Keep chardev open for other users after hot-unplugAmit Shah2011-03-211-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | After a hot-unplug operation, the previous behaviour was to close the chardev. That meant the chardev couldn't be re-used. Also, since chardev hot-plug isn't possible so far, this means virtio-console hot-plug isn't feasible as well. With this change, the chardev is kept around. A new virtio-console channel can then be hot-plugged with the same chardev and things will continue to work. Signed-off-by: Amit Shah <amit.shah@redhat.com>
| * virtio-serial: Don't clear ->have_data() pointer after unplugAmit Shah2011-03-211-1/+0
| | | | | | | | | | | | | | | | | | After a port unplug operation, the port->info->have_data() pointer was set to NULL. The problem is, the ->info struct is shared by all ports, effectively disabling writes to other ports. Reported-by: juzhang <juzhang@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
| * virtio-serial-bus: Simplify handle_output() functionAmit Shah2011-03-211-9/+3
| | | | | | | | | | | | | | | | There's no code change, just re-arrangement to simplify the function after recent modifications. Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
| * virtio-serial: Enable ioeventfdAmit Shah2011-03-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | Enable ioeventfd for virtio-serial devices by default. Commit 25db9ebe15125deb32958c6df74996f745edf1f9 lists the benefits of using ioeventfd. Copying a file from guest to host over a virtio-serial channel didn't show much difference in time or io_exit rate. Signed-off-by: Amit Shah <amit.shah@redhat.com>
| * virtio-serial: Disallow generic ports at id 0Amit Shah2011-03-211-0/+9
| | | | | | | | | | | | | | | | | | | | | | Port 0 is reserved for virtconsole devices for backward compatibility with the old -virtioconsole (from qemu 0.12) device type. libvirt prior to commit 8e28c5d40200b4c5d483bd585d237b9d870372e5 used port 0 for generic ports. libvirt will no longer do that, but disallow instantiating generic ports at id 0 from qemu as well. Signed-off-by: Amit Shah <amit.shah@redhat.com>
| * virtio-serial: Use a struct to pass config information from proxyAmit Shah2011-03-214-15/+21
| | | | | | | | | | | | | | | | Instead of using a single variable to pass to the virtio_serial_init function, use a struct so that expanding the number of variables to be passed on later is easier. Signed-off-by: Amit Shah <amit.shah@redhat.com>
* | tcg/arm: Support host code being compiled for ThumbPeter Maydell2011-03-241-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Although the TCG generated code is always in ARM mode, it is possible that the host code was compiled by gcc in Thumb mode (this is often the default for Linux distributions targeting ARM v7 only). Handle this by using BLX imm when doing a call from ARM into Thumb mode. Since BLX imm is not a conditionalisable instruction, we make tcg_out_call() no longer take a condition code; we were only ever using it with COND_AL anyway. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
* | Revert "x86: Save/restore PAT MSR"Anthony Liguori2011-03-221-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c995b495b9d6e60ab1e390bd398a22425d0b3c8c. From Jan Kiszka: Ouch, indeed. Moreover, CPU_SAVE_VERSION was not updated (likely the reason for the breakage). Thanks for debugging this! Anthony (or whoever), please revert this unneeded commit in qemu.git. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | vnc: fix build error from VNC_DIRTY_WORDSAnthony Liguori2011-03-221-1/+1
| | | | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | fix vnc regressionWen Congyang2011-03-221-2/+6
| | | | | | | | | | | | | | | | This patch fix the following regression: 1. we should use bitmap_set() and bitmap_clear() to replace vnc_set_bits(). Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | qmp-commands.hx: Clean up mess of client_migrate_infoJes Sorensen2011-03-221-34/+34
| | | | | | | | | | | | | | | | | | | | client_migrate_info was put into qmp-commands.hx in the middle of migrate_set_speed, between the command and it's description. In addition client_migrate_info put the description before the command itself, which is the wrong order. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Make VNC support optionalJes Sorensen2011-03-227-43/+104
| | | | | | | | | | | | | | Per default VNC is enabled. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | error message if user specifies curses on cmd line when curses is disabledJes Sorensen2011-03-222-4/+5
| | | | | | | | | | Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | error message if user specifies SDL cmd line option when SDL is disabledJes Sorensen2011-03-222-10/+8
| | | | | | | | | | Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Add support for -display vncJes Sorensen2011-03-222-1/+18
| | | | | | | | | | Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Introduce -display noneJes Sorensen2011-03-223-1/+10
| | | | | | | | | | | | | | | | | | New option -display none. This option differs from -nographic by not trying to take control of stdio etc. but instead behaves as if a graphics display is enabled, except that it doesn't show one. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Introduce -display argumentJes Sorensen2011-03-222-0/+97
| | | | | | | | | | | | | | | | | | This patch introduces a -display argument which consolidates the setting of the display mode. Valid options are: sdl/curses/default Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Consolidate DisplaySurface allocation in qemu_alloc_display()Jes Sorensen2011-03-223-34/+34
| | | | | | | | | | | | | | This removes various code duplication from console.e and sdl.c Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | target-arm: use make_float32() to make constant floats for VRSQRTSPeter Maydell2011-03-221-6/+5
| | | | | | | | | | | | | | | | | | The preferred way to create a constant floating point value is to use make_float32() rather than doing a runtime int32_to_float32(). Convert the code in the VRSQRTS helper to work this way. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | target-arm: Fix VRECPS edge cases handlingPeter Maydell2011-03-221-3/+8
| | | | | | | | | | | | | | | | | | Correct the handling of edge cases for the VRECPS instruction: * this is a Neon instruction so uses the "standard FPSCR value" * (zero, inf) is a special case which returns 2.0 Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | target-arm: Fix TCG temporary leaks for scalar VMULLPeter Maydell2011-03-221-0/+2
| | | | | | | | | | | | | | Fix a TCG temporary leak when translating 32-bit scalar VMULL. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | target-arm: Set Q bit for overflow in SMUAD and SMLADPeter Maydell2011-03-221-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | SMUAD and SMLAD are supposed to set the Q bit if the addition of the two 16x16 multiply products and optional accumulator overflows considered as a signed value. However we were only doing this check for the addition of the accumulator, not when adding the products, with the effect that we were mishandling the edge case where both inputs are 0x80008000. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | target-arm: Fix GE bits for v6media signed modulo arithmeticPeter Maydell2011-03-221-2/+2
| | | | | | | | | | | | | | | | | | | | Fix the signed modulo arithmetic helpers for the v6media instructions (SADD8, SSUB8, SADD16, SSUB16, SASX, SSAX) to set the GE bits correctly (based on the result of the add or subtract before it is truncated to 16 bits, not after). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | target-arm: Fix UNDEF cases in Thumb load/storePeter Maydell2011-03-221-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Decode of Thumb load/store was merging together the cases of 'bit 11==0' (reg+reg LSL imm) and 'bit 11==1' (reg+imm). This happens to work for valid instruction patterns but meant that we would not UNDEF for the cases the architecture mandates that we must. Make the decode actually look at bit 11 as well as [10..8] so that we UNDEF in the right places. This change also removes what was a spurious unreachable 'case 8', and correctly frees TCG temporaries on the illegal-insn codepaths. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | linux-user: Fix unlock_user() call in return from poll()Peter Maydell2011-03-221-3/+1
| | | | | | | | | | | | | | | | | | | | | | Correct the broken attempt to calculate the third argument to unlock_user() in the code path which unlocked the pollfd array on return from poll() and ppoll() emulation. (This only caused a problem if unlock_user() wasn't a no-op, eg if DEBUG_REMAP is defined.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | vmmouse: Register vmstate via qdevJan Kiszka2011-03-221-1/+1
| | | | | | | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | vmmouse: Fix initializationJan Kiszka2011-03-221-0/+1
| | | | | | | | | | | | | | | | Latest refactorings left vmmouse nonfunctional behind. Fix it by adding the required device initialization. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
OpenPOWER on IntegriCloud