summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2013-01-02virtio-blk: Return UNSUPP for unknown request typesAlexey Zaytsev1-1/+5
Currently, all unknown requests are treated as VIRTIO_BLK_T_IN Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-02virtio-blk: add x-data-plane=on|off performance featureStefan Hajnoczi2-1/+46
The virtio-blk-data-plane feature is easy to integrate into hw/virtio-blk.c. The data plane can be started and stopped similar to vhost-net. Users can take advantage of the virtio-blk-data-plane feature using the new -device virtio-blk-pci,x-data-plane=on property. The x-data-plane name was chosen because at this stage the feature is experimental and likely to see changes in the future. If the VM configuration does not support virtio-blk-data-plane an error message is printed. Although we could fall back to regular virtio-blk, I prefer the explicit approach since it prompts the user to fix their configuration if they want the performance benefit of virtio-blk-data-plane. Limitations: * Only format=raw is supported * Live migration is not supported * Block jobs, hot unplug, and other operations fail with -EBUSY * I/O throttling limits are ignored * Only Linux hosts are supported due to Linux AIO usage Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-02dataplane: add virtio-blk data plane codeStefan Hajnoczi4-1/+496
virtio-blk-data-plane is a subset implementation of virtio-blk. It only handles read, write, and flush requests. It does this using a dedicated thread that executes an epoll(2)-based event loop and processes I/O using Linux AIO. This approach performs very well but can be used for raw image files only. The number of IOPS achieved has been reported to be several times higher than the existing virtio-blk implementation. Eventually it should be possible to unify virtio-blk-data-plane with the main body of QEMU code once the block layer and hardware emulation is able to run outside the global mutex. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-02virtio-blk: restore VirtIOBlkConf->config_wce flagStefan Hajnoczi3-2/+6
Two slightly different versions of a patch to conditionally set VIRTIO_BLK_F_CONFIG_WCE through the "config-wce" qdev property have been applied (ea776abca and eec7f96c2). David Gibson <david@gibson.dropbear.id.au> noticed that the "config-wce" property is broken as a result and fixed it recently. The fix sets the host_features VIRTIO_BLK_F_CONFIG_WCE bit from a qdev property. Unfortunately, the virtio device then has no chance to test for the presence of the feature bit during virtio_blk_init(). Therefore, reinstate the VirtIOBlkConf->config_wce flag. Drop the duplicate qdev property to set the host_features bit. The VirtIOBlkConf->config_wce flag will be used by virtio-blk-data-plane in a later patch. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-02dataplane: add Linux AIO request queueStefan Hajnoczi3-1/+175
The IOQueue has a pool of iocb structs and a function to add new read/write requests. Multiple requests can be added before calling the submit function to actually tell the host kernel to begin I/O. This allows callers to batch requests and submit them in one go. The actual I/O is performed using Linux AIO. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-02dataplane: add event loopStefan Hajnoczi3-1/+141
Outside the safety of the global mutex we need to poll on file descriptors. I found epoll(2) is a convenient way to do that, although other options could replace this module in the future (such as an AioContext-based loop or glib's GMainLoop). One important feature of this small event loop implementation is that the loop can be terminated in a thread-safe way. This allows QEMU to stop the data plane thread cleanly. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-02dataplane: add virtqueue vring codeStefan Hajnoczi3-1/+425
The virtio-blk-data-plane cannot access memory using the usual QEMU functions since it executes outside the global mutex and the memory APIs are this time are not thread-safe. This patch introduces a virtqueue module based on the kernel's vhost vring code. The trick is that we map guest memory ahead of time and access it cheaply outside the global mutex. Once the hardware emulation code can execute outside the global mutex it will be possible to drop this code. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-02dataplane: add host memory mapping codeStefan Hajnoczi4-1/+237
The data plane thread needs to map guest physical addresses to host pointers. Normally this is done with cpu_physical_memory_map() but the function assumes the global mutex is held. The data plane thread does not touch the global mutex and therefore needs a thread-safe memory mapping mechanism. Hostmem registers a MemoryListener similar to how vhost collects and pushes memory region information into the kernel. There is a fine-grained lock on the regions list which is held during lookup and when installing a new regions list. When the physical memory map changes the MemoryListener callbacks are invoked. They build up a new list of memory regions which is finally installed when the list has been completed. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-01pflash_cfi01: Suppress warning when Linux probes for AMD flashStefan Weil1-0/+3
There are several ARM and MIPS boards which are manufactured with either Intel (pflash_cfi01.c) or AMD (pflash_cfi02.c) flash memory. The Linux kernel supports both and first probes for AMD flash which resulted in one or two warnings from the Intel flash emulation: pflash_write: Unimplemented flash cmd sequence (offset 0000000000000000, wcycle 0x0 cmd 0x0 value 0xf000f0) pflash_write: Unimplemented flash cmd sequence (offset 0000000000000000, wcycle 0x0 cmd 0x0 value 0xf0) These warnings confuse users, so suppress them. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-12-28usb/redirect.c: unbreak compilation due to include/char/char.hAlon Levy1-0/+1
Broken since: commit 927d4878b0ff319ed87fed9363f314613b0a5ed9 Author: Paolo Bonzini <pbonzini@redhat.com> Date: Mon Dec 17 18:20:05 2012 +0100 softmmu: move remaining include files to include/ subdirectories Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-12-28Merge branch 'qom-cpu' of git://repo.or.cz/qemu/afaerberBlue Swirl21-469/+542
* 'qom-cpu' of git://repo.or.cz/qemu/afaerber: MAINTAINERS: Include X86CPU in CPU maintenance area cpu: Move kvm_run into CPUState cpu: Move kvm_state field into CPUState ppc_booke: Pass PowerPCCPU to ppc_booke_timers_init() ppc4xx_devs: Return PowerPCCPU from ppc4xx_init() ppc_booke: Pass PowerPCCPU to {decr,fit,wdt} timer callbacks ppc: Pass PowerPCCPU to [h]decr timer callbacks ppc: Pass PowerPCCPU to [h]decr callbacks ppc: Pass PowerPCCPU to ppc_set_irq() kvm: Pass CPUState to kvm_vcpu_ioctl() kvm: Pass CPUState to kvm_arch_* cpu: Move kvm_fd into CPUState qdev-properties.c: Separate core from the code used only by qemu-system-* qdev: Coding style fixes cpu: Introduce CPUListState struct target-alpha: Add support for -cpu ? target-alpha: Turn CPU definitions into subclasses target-alpha: Avoid leaking the alarm timer over reset alpha: Pass AlphaCPU array to Typhoon target-alpha: Let cpu_alpha_init() return AlphaCPU
2012-12-23tmp105: Create API for TMP105 temperature sensor.Alex Horn3-11/+76
* Define enum for TMP105 registers * Move tmp105_set() from I2C to TMP105 header * Document units and range of temperature as preconditions Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alex Horn <alex.horn@cs.ox.ac.uk> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-12-23Merge branch 'master' of git://git.qemu.org/qemu into qom-cpuAndreas Färber497-1337/+1527
Adapt header include paths. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19Merge remote-tracking branch 'bonzini/header-dirs' into stagingAnthony Liguori496-1334/+1523
* bonzini/header-dirs: (45 commits) janitor: move remaining public headers to include/ hw: move executable format header files to hw/ fpu: move public header file to include/fpu softmmu: move remaining include files to include/ subdirectories softmmu: move include files to include/sysemu/ misc: move include files to include/qemu/ qom: move include files to include/qom/ migration: move include files to include/migration/ monitor: move include files to include/monitor/ exec: move include files to include/exec/ block: move include files to include/block/ qapi: move include files to include/qobject/ janitor: add guards to headers qapi: make struct Visitor opaque qapi: remove qapi/qapi-types-core.h qapi: move inclusions of qemu-common.h from headers to .c files ui: move files to ui/ and include/ui/ qemu-ga: move qemu-ga files to qga/ net: reorganize headers net: move net.c to net/ ... Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-12-19ppc_booke: Pass PowerPCCPU to ppc_booke_timers_init()Andreas Färber6-8/+7
Cleans up after passing PowerPCCPU to timer callbacks. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19ppc4xx_devs: Return PowerPCCPU from ppc4xx_init()Andreas Färber3-9/+13
Prepares for passing PowerPCCPU to ppc_booke_timers_init(). Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19ppc_booke: Pass PowerPCCPU to {decr,fit,wdt} timer callbacksAndreas Färber1-13/+10
Cleans up after passing PowerPCCPU to booke_update_irq(). Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19ppc: Pass PowerPCCPU to [h]decr timer callbacksAndreas Färber1-8/+10
Cleans up after passing PowerPCCPU to [h]decr exception callbacks. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19ppc: Pass PowerPCCPU to [h]decr callbacksAndreas Färber1-27/+33
Cleans up after passing PowerPCCPU to ppc_set_irq(). Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19ppc: Pass PowerPCCPU to ppc_set_irq()Andreas Färber3-36/+60
Adapt static caller functions. This cleans up after passing PowerPCCPU to kvmppc_set_interrupt(). Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19kvm: Pass CPUState to kvm_vcpu_ioctl()Andreas Färber5-14/+14
Adapt helper functions to pass X86CPU / PowerPCCPU / S390CPU. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19qdev-properties.c: Separate core from the code used only by qemu-system-*Eduardo Habkost5-340/+360
This separates the qdev properties code in two parts: - qdev-properties.c, that contains most of the qdev properties code; - qdev-properties-system.c for code specific for qemu-system-*, containing: - Property types: drive, chr, netdev, vlan, that depend on code that won't be included on *-user - qemu_add_globals(), that depends on qemu-config.o. This change should help on two things: - Allowing DeviceState to be used by *-user without pulling dependencies that are specific for qemu-system-*; - Writing qdev unit tests without pulling too many dependencies. The copyright/license of qdev-properties.c isn't explicitly stated at the file, so add a simple copyright/license header pointing to the commit ID of the original file. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19qdev: Coding style fixesEduardo Habkost2-19/+37
Add missing braces and break lines larger than 80 chars. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19hw: move executable format header files to hw/Paolo Bonzini1-0/+158
Or delete a.out.h which is unused. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19softmmu: move remaining include files to include/ subdirectoriesPaolo Bonzini44-45/+45
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19softmmu: move include files to include/sysemu/Paolo Bonzini200-292/+292
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19misc: move include files to include/qemu/Paolo Bonzini215-263/+263
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19qom: move include files to include/qom/Paolo Bonzini2-2/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19migration: move include files to include/migration/Paolo Bonzini6-7/+7
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19monitor: move include files to include/monitor/Paolo Bonzini35-35/+35
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19exec: move include files to include/exec/Paolo Bonzini132-146/+146
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19block: move include files to include/block/Paolo Bonzini29-29/+29
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19qapi: move include files to include/qobject/Paolo Bonzini10-12/+12
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19janitor: add guards to headersPaolo Bonzini27-0/+127
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19ui: move files to ui/ and include/ui/Paolo Bonzini53-127/+70
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19net: reorganize headersPaolo Bonzini72-98/+71
Move public headers to include/net, and leave private headers in net/. Put the virtio headers in include/net/tap.h, removing the multiple copies that existed. Leave include/net/tap.h as the interface for NICs, and net/tap_int.h as the interface for OS-specific parts of the tap backend. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19net: do not include net.h everywherePaolo Bonzini13-12/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19net: move Bluetooth stuff out of net.hPaolo Bonzini4-4/+4
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19janitor: do not include qemu-char everywherePaolo Bonzini9-7/+3
Touching char/char.h basically causes the whole of QEMU to be rebuilt. Avoid this, it is usually unnecessary. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19janitor: do not rely on indirect inclusions of or from qemu-char.hPaolo Bonzini13-0/+14
Various header files rely on qemu-char.h including qemu-config.h or main-loop.h, but they really do not need qemu-char.h at all (particularly interesting is the case of the block layer!). Clean this up, and also add missing inclusions of qemu-char.h itself. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19build: kill libdis, move disassemblers to disas/Paolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19build: move rules from Makefile to */Makefile.objsPaolo Bonzini1-0/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19target-alpha: Avoid leaking the alarm timer over resetAndreas Färber1-2/+1
Move the timer from CPUAlphaState to AlphaCPU to avoid the pointer being zero'ed once we implement reset. Would cause a segfault in sys_helper.c:helper_set_alarm(). This also simplifies timer initialization in Typhoon. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Richard Henderson <rth@twiddle.net>
2012-12-19alpha: Pass AlphaCPU array to TyphoonAndreas Färber3-23/+26
Also store it in TyphoonCchip. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Richard Henderson <rth@twiddle.net>
2012-12-18Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori5-15/+15
* stefanha/trivial-patches: configure: Earlier pkg-config probe vmmouse_reset(): remove minimal code duplication linux-user/syscall.c: remove wrong forward decl of setgroups() fix build error on ARM due to wrong glibc check gitignore: Add virtfs-proxy-helper arm_gic: Add cpu nr to Raised IRQ message zynq_slcr: Compile time warning fixes. pflash_cfi0x: Send debug messages to stderr pflash_cfi01: qemu_log_mask "unimplemented" msg net, hub: fix the indent in the comments Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-12-18Merge remote-tracking branch 'amit/master' into stagingAnthony Liguori1-82/+113
* amit/master: virtio-serial-bus: assert port is non-null in remove_port() virtio-serial-bus: send_control_msg() should not deal with cpkts virtio-serial: delete timer if active during exit virtio-serial: allocate post_load only at load-time virtio-serial: move active ports loading to separate function virtio-serial: use uint32_t to count ports Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-12-18Merge remote-tracking branch 'spice/spice.v66' into stagingAnthony Liguori1-5/+6
* spice/spice.v66: docs: add spice-port-fqdn.txt spice-qemu-char: register spicevmc ports during qemu_spice_init() spice-qemu-char: keep a list of spice chardev spice-qemu-char: add spiceport chardev spice-qemu-char: factor out CharDriverState creation spice-qemu-char: write to chardev whatever amount it can read qxl+vnc: register a vm state change handler for dummy spice_server qxl: save qemu_create_displaysurface_from result Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-12-18vmmouse_reset(): remove minimal code duplicationLaszlo Ersek1-1/+0
Commit 069ab0eb added a vmmouse_disable() call to vmmouse_reset(). vmmouse_disable() resets the status already. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2012-12-18arm_gic: Add cpu nr to Raised IRQ messagePeter Crosthwaite1-1/+1
Add the relevant CPU nr to this debug message to make IRQ debugging more informative. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2012-12-18zynq_slcr: Compile time warning fixes.Peter Crosthwaite1-3/+4
Few warnings when compiled with debug printfs enabled. Fixed all. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>