aboutsummaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)Author
2013-01-16tmp105: Add temperature QOM propertyAndreas Färber
This obsoletes tmp105_set() and allows for better error handling. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16tmp105: QOM'ifyAndreas Färber
Introduce TYPE_ constant and cast macro. Move the state struct to the new header to allow for future embedding. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16tmp105: Fix I2C protocol bugAndreas Färber
An early length postincrement in the TMP105's I2C TX path led to transfers of more than one byte to place the second byte in the third byte's place within the buffer and the third byte to get discarded. Fix this by explictly incrementing the length after the checks but before the callback is called, which again checks the length. Adjust the Coding Style while at it. Signed-off-by: Alex Horn <alex.horn@cs.ox.ac.uk> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16tmp105: Split out I2C message constants from headerAndreas Färber
Allows value sharing with qtest. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16usb-storage: Drop useless null test in usb_msd_handle_data()Markus Armbruster
scsi_req_new() never returns null, and scsi_req_enqueue() dereferences the pointer, so checking for null is useless. Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16pseries: Replace non-portable asprintf by g_strdup_printfStefan Weil
g_strdup_printf already handles OOM errors, so some error handling in QEMU code can be removed. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16Add new DEFAULT_MACHINE_OPTIONS to q35 and ppc405Knut Omang
Without this default q35/ppc405 based machines would no longer boot after commit e4ada29e909787f629626660b1561f6a680187d3 Signed-off-by: Knut Omang <knut.omang@oracle.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15qdev: Prepare "realized" propertyAndreas Färber
Introduce the QOM realizefn suggested by Anthony. Detailed documentation is supplied in the qdev header. For now this implements a default DeviceClass::realize callback that just wraps DeviceClass::init, which it deprecates. Once all devices have been converted to DeviceClass::realize, DeviceClass::init is to be removed. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15qdev: Fold state enum into bool realizedAndreas Färber
Whether the device was initialized or not is QOM-level information and currently unused. Drop it from device. This leaves the boolean state of whether or not DeviceClass::init was called or not, a.k.a. "realized". Suggested-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15pseries: set no default boot orderAvik Sil
This patch removes the default boot order for pseries machine. This allows the machine to handle a NULL boot order in case no -boot option is provided. Thus it helps SLOF firmware to verify if boot order is specified in command line or not. If no boot order is provided SLOF tries to boot from the device set in the nvram. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15Make default boot order machine specificAvik Sil
This patch makes default boot order machine specific instead of set globally. The default boot order can be set per machine in QEMUMachine boot_order. This also allows a machine to receive a NULL boot order when -boot isn't used and take an appropriate action accordingly. This helps machine boots from the devices as set in guest's non-volatile memory location in case no boot order is provided by the user. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15Merge remote-tracking branch 'afaerber/memory-ioport' into stagingAnthony Liguori
* afaerber/memory-ioport: acpi_piix4: Do not use old_portio-style callbacks xen_platform: Do not use old_portio-style callbacks hw/dma.c: Fix conversion of ioport_register* to MemoryRegion Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15Merge remote-tracking branch 'stefanha/block' into stagingAnthony Liguori
* stefanha/block: block: Fix how mirror_run() frees its buffer win32-aio: Fix how win32_aio_process_completion() frees buffer scsi-disk: qemu_vfree(NULL) is fine, simplify w32: Make qemu_vfree() accept NULL like the POSIX implementation sheepdog: clean up sd_aio_setup() sheepdog: multiplex the rw FD to flush cache block: clear dirty bitmap when discarding ide: issue discard asynchronously but serialize the pieces ide: fix TRIM with empty range entry block: make discard asynchronous raw: support discard on block devices raw-posix: remember whether discard failed raw-posix: support discard on more filesystems block: fix initialization in bdrv_io_limits_enable() qcow2: Fix segfault on zero-length write Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15Merge remote-tracking branch 'afaerber/qom-cpu' into stagingAnthony Liguori
* afaerber/qom-cpu: target-i386: Use switch in check_hw_breakpoints() target-i386: Avoid goto in hw_breakpoint_insert() target-i386: Introduce hw_{local,global}_breakpoint_enabled() target-i386: Define DR7 bit field constants target-i386: Move kvm_check_features_against_host() check to realize time target-i386: cpu_x86_register() consolidate freeing resources target-i386: Move setting defaults out of cpu_x86_parse_featurestr() target-i386: check/enforce: Check all feature words target-i386/cpu.c: Add feature name array for ext4_features target-i386: kvm_check_features_against_host(): Use feature_word_info target-i386/cpu: Introduce FeatureWord typedefs target-i386: Disable kvm_mmu by default kvm: Add fake KVM constants to avoid #ifdefs on KVM-specific code exec: Return CPUState from qemu_get_cpu() xen: Simplify halting of first CPU kvm: Pass CPUState to kvm_init_vcpu() cpu: Move cpu_index field to CPUState cpu: Move numa_node field to CPUState target-mips: Clean up mips_cpu_map_tc() documentation cpu: Move nr_{cores,threads} fields to CPUState Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15Merge remote-tracking branch 'afaerber-or/prep-up' into stagingAnthony Liguori
* afaerber-or/prep-up: pc87312: Avoid define conflict on mingw32 pc87312: Replace register_ioport_*() with MemoryRegion Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15Merge remote-tracking branch 'sstabellini/xen-2013-01-14' into stagingAnthony Liguori
* sstabellini/xen-2013-01-14: xen_disk: implement BLKIF_OP_FLUSH_DISKCACHE, remove BLKIF_OP_WRITE_BARRIER xen_disk: add persistent grant support to xen_disk backend xen_disk: fix memory leak Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15acpi_piix4: Do not use old_portio-style callbacksHervé Poussineau
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> [AF: Used HWADDR_PRIx for hwaddr PIIX4_DPRINTF()] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-15xen_platform: Do not use old_portio-style callbacksHervé Poussineau
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-15hw/dma.c: Fix conversion of ioport_register* to MemoryRegionJulien Grall
The commit 582299336879504353e60c7937fbc70fea93f3da introduced a 1-shift for some offset in DMA emulation. Before the previous commit, which converted ioport_register_* to MemoryRegion, the DMA controller registered 8 ioports with the following formula: base + ((8 + i) << d->shift) where 0 <= i < 8 When an IO occured within a Memory Region, DMA callback receives an offset relative to the start address. Here the start address is: base + (8 << d->shift). The offset should be: (i << d->shift). After the shift is reverted, the offsets are 0..7 not 1..8. Fixes LP#1089996. Reported-by: Andreas Gustafsson <gson@gson.org> Signed-off-by: Julien Grall <julien.grall@citrix.com> Tested-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-15scsi-disk: qemu_vfree(NULL) is fine, simplifyMarkus Armbruster
Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-15ide: issue discard asynchronously but serialize the piecesPaolo Bonzini
Now that discard can take a long time, make it asynchronous. Each LBA range entry is processed separately because discard can be an expensive operation. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-15ide: fix TRIM with empty range entryPaolo Bonzini
ATA-ACS-3 says "If the two byte range length is zero, then the LBA Range Entry shall be discarded as padding." iovecs are used as if they are linearized, so it is incorrect to discard the rest of this iovec. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-15exec: Return CPUState from qemu_get_cpu()Andreas Färber
Move the declaration to qemu/cpu.h and add documentation. The implementation still depends on CPUArchState for CPU iteration. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-15cpu: Move cpu_index field to CPUStateAndreas Färber
Note that target-alpha accesses this field from TCG, now using a negative offset. Therefore the field is placed last in CPUState. Pass PowerPCCPU to [kvm]ppc_fixup_cpu() to facilitate this change. Move common parts of mips cpu_state_reset() to mips_cpu_reset(). Acked-by: Richard Henderson <rth@twiddle.net> (for alpha) [AF: Rebased onto ppc CPU subclasses and openpic changes] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-15cpu: Move numa_node field to CPUStateAndreas Färber
Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-15cpu: Move nr_{cores,threads} fields to CPUStateAndreas Färber
To facilitate the field movements, pass MIPSCPU to malta_mips_config(); avoid that for mips_cpu_map_tc() since callers only access MIPS Thread Contexts, inside TCG helpers. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-15pc87312: Avoid define conflict on mingw32Blue Swirl
Mingw32 headers define FAR, causing this warning: /src/qemu/hw/pc87312.c:38:0: warning: "FAR" redefined [enabled by default] In file included from /usr/local/lib/gcc/i686-mingw32msvc/4.7.0/../../../../i686-mingw32msvc/include/windows.h:48:0, from /src/qemu/include/sysemu/os-win32.h:29, from /src/qemu/include/qemu-common.h:46, from /src/qemu/include/exec/ioport.h:27, from /src/qemu/hw/isa.h:6, from /src/qemu/hw/pc87312.h:28, from /src/qemu/hw/pc87312.c:26: /usr/local/lib/gcc/i686-mingw32msvc/4.7.0/../../../../i686-mingw32msvc/include/windef.h:34:0: note: this is the location of the previous definition Avoid the warning by expanding the macros. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Acked-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Andreas Färber <andreas.faerber@web.de>
2013-01-15pc87312: Replace register_ioport_*() with MemoryRegionAndreas Färber
Prepare an instance_init function for the MemoryRegion init. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Tested-by: Hervé Poussineau <hpoussin@reactos.org>
2013-01-14virtio-9p: fix compilation error.KONRAD Frederic
Fix the compilation error introduced by msg new field. CC hw/9pfs/virtio-9p.o In file included from /home/konradf/Documents/safe/greensocs/virtio-project/x86-qemu/qemu/hw/9pfs/virtio-9p.c:17:0: /home/konradf/Documents/safe/greensocs/virtio-project/x86-qemu/qemu/hw/virtio-pci.h:30:16: erreur: field ‘msg’ has incomplete type make: *** [hw/9pfs/virtio-9p.o] Erreur 1 Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
2013-01-14dataplane: fix build breakage on set_guest_notifiers()Michael Roth
virtio_pci_set_guest_notifiers() now takes an additional argument to specify the number of virtqueues to assign a guest notifier for. This causes a build breakage for CONFIG_VIRTIO_BLK_DATA_PLANE builds: /home/mdroth/w/qemu2.git/hw/dataplane/virtio-blk.c: In function ‘virtio_blk_data_plane_start’: /home/mdroth/w/qemu2.git/hw/dataplane/virtio-blk.c:451:47: error: too few arguments to function ‘s->vdev->binding->set_guest_notifiers’ /home/mdroth/w/qemu2.git/hw/dataplane/virtio-blk.c: In function ‘virtio_blk_data_plane_stop’: /home/mdroth/w/qemu2.git/hw/dataplane/virtio-blk.c:511:5: error: too few arguments to function ‘s->vdev->binding->set_guest_notifiers’ make[1]: *** [hw/dataplane/virtio-blk.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [subdir-x86_64-softmmu] Error 2 Fix this by passing 1 as the number of virtqueues to assign notifiers for. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-14virtio-pci: build for uninitialized return value in vq_vector_unmaskMichael Roth
Fixes the following: /home/mdroth/w/qemu2.git/hw/virtio-pci.c: In function ‘kvm_virtio_pci_vector_unmask’: /home/mdroth/w/qemu2.git/hw/virtio-pci.c:673:12: error: ‘ret’ may be used uninitialized in this function [-Werror=uninitialized] cc1: all warnings being treated as errors make: *** [hw/virtio-pci.o] Error 1 make: *** Waiting for unfinished jobs.... Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-14Add GE IP-Octal 232 IndustryPack emulationAlberto Garcia
The GE IP-Octal 232 is an IndustryPack module that implements eight RS-232 serial ports, each one of which can be redirected to a character device in the host. Signed-off-by: Alberto Garcia <agarcia@igalia.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-14Add TEWS TPCI200 IndustryPack emulationAlberto Garcia
The TPCI200 is a PCI board that supports up to 4 IndustryPack modules. A new bus type called 'IndustryPack' has been created so any compatible module can be attached to this board. Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alberto Garcia <agarcia@igalia.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-14xen_disk: implement BLKIF_OP_FLUSH_DISKCACHE, remove BLKIF_OP_WRITE_BARRIERStefano Stabellini
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2013-01-14xen_disk: add persistent grant support to xen_disk backendRoger Pau Monne
This protocol extension reuses the same set of grant pages for all transactions between the front/back drivers, avoiding expensive tlb flushes, grant table lock contention and switches between userspace and kernel space. The full description of the protocol can be found in the public blkif.h header. http://xenbits.xen.org/gitweb/?p=xen.git;a=blob_plain;f=xen/include/public/io/blkif.h Speed improvement with 15 guests performing I/O is ~450%. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2013-01-14xen_disk: fix memory leakRoger Pau Monne
On ioreq_release the full ioreq was memset to 0, loosing all the data and memory allocations inside the QEMUIOVector, which leads to a memory leak. Create a new function to specifically reset ioreq. Reported-by: Maik Wessler <maik.wessler@yahoo.com> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2013-01-14Merge remote-tracking branch 'kraxel/usb.76' into stagingAnthony Liguori
* kraxel/usb.76: usb-host: Initialize dev->port the obviously safe way usb-host: Drop superfluous null test from usb_host_auto_scan() ehci: Assert state machine is sane w.r.t. EHCIQueue xhci: nuke transfe5rs on detach xhci: call xhci_detach_slot on root port detach too xhci: create xhci_detach_slot helper function Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-14Merge remote-tracking branch 'spice/spice.v67' into stagingAnthony Liguori
* spice/spice.v67: qxl: Don't drop client capability bits qxl: Fix SPICE_RING_PROD_ITEM(), SPICE_RING_CONS_ITEM() sanity check Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-14Merge remote-tracking branch 'kraxel/testdev.2' into stagingAnthony Liguori
* kraxel/testdev.2: pc-testdev: use typedefs Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-14Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori
* kwolf/for-anthony: dataplane: handle misaligned virtio-blk requests dataplane: extract virtio-blk read/write processing into do_rdwr_cmd() block: make qiov_is_aligned() public raw-posix: fix bdrv_aio_ioctl sheepdog: implement direct write semantics block: do not probe zero-sized disks Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-14Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori
pci,virtio This further optimizes MSIX handling in virtio-pci. Also included is pci cleanup by Paolo, and pci device assignment fix by Alex. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> * mst/tags/for_anthony: pci-assign: Enable MSIX on device to match guest pci: use constants for devices under the 1B36 device ID, document them ivshmem: use symbolic constant for PCI ID, add to pci-ids.txt virtio-9p: use symbolic constant, add to pci-ids.txt reorganize pci-ids.txt docs: move pci-ids.txt to docs/specs/ vhost: backend masking support vhost: set started flag while start is in progress virtio-net: set/clear vhost_started in reverse order virtio: backend virtqueue notifier masking virtio-pci: cache msix messages kvm: add stub for update msi route msix: add api to access msix message virtio: don't waste irqfds on control vqs
2013-01-14usb-host: Initialize dev->port the obviously safe wayMarkus Armbruster
Coverity worries the strcpy() could overrun the destination. It can't, because the source always points to usb_host_scan()'s auto port[], which has the same size. Use pstrcpy() anyway, to hush the checker. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-14usb-host: Drop superfluous null test from usb_host_auto_scan()Markus Armbruster
Coverity points out that port is later passed to usb_host_open(), which dereferences it. It actually can't be null: it always points to usb_host_scan()'s auto port[]. Drop the superfluous port == NULL test. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-14ehci: Assert state machine is sane w.r.t. EHCIQueueMarkus Armbruster
Coverity worries the EHCIQueue pointer could be null when we pass it to functions that reference it. The state machine ensures it can't be null then. Assert that, to hush the checker. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-14dataplane: handle misaligned virtio-blk requestsStefan Hajnoczi
O_DIRECT on Linux has alignment requirements on I/O buffers and misaligned requests result in -EINVAL. The Linux virtio_blk guest driver usually submits aligned requests so I forgot to handle misaligned requests. It turns out that virtio-win guest drivers submit misaligned requests. Handle them using a bounce buffer that meets alignment requirements. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-01-14dataplane: extract virtio-blk read/write processing into do_rdwr_cmd()Stefan Hajnoczi
Extract code for read/write command processing into do_rdwr_cmd(). This brings together pieces that are spread across process_request(). The real motivation is to set the stage for handling misaligned requests, which the next patch tackles. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-01-14xhci: nuke transfe5rs on detachGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-14xhci: call xhci_detach_slot on root port detach tooGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-14xhci: create xhci_detach_slot helper functionGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-14pc-testdev: use typedefsGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>