summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2015-12-02virtio-pci: Set the QEMU_PCI_CAP_EXPRESS capability early in its DeviceClass ↵Shmulik Ladkani2-5/+26
realize method In 1811e64 'hw/virtio: Add PCIe capability to virtio devices', the QEMU_PCI_CAP_EXPRESS capability was added to virtio's pci_dev, within 'virtio_pci_realize' - the pci device object realization method. This occurs to late, as 'pci_qdev_realize' (DeviceClass.realize of TYPE_PCI_DEVICE) has already been called, without knowing that the device instance is indeed an "express" instance, thus allocating insufficient pci config space. As a result, device may crash upon attempt to write to the PCIE config space. Fix, by arming the QEMU_PCI_CAP_EXPRESS capability early in virtio-pci's own DeviceClass realize method. This also makes code cleaner, as 'virtio_pci_realize' may now access the 'pci_is_express' predicate when needed. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Tested-by: Marcel Apfelbaum <marcel@redhat.com>
2015-12-02virtio: handle non-virtio-1-capable backend for ccwCornelia Huck2-0/+15
If you run a qemu advertising VERSION_1 with an old kernel where vhost did not yet support VERSION_1, you'll end up with a device that is {modern pci|ccw revision 1} but does not advertise VERSION_1. This is not a sensible configuration and is rejected by the Linux guest drivers. To fix this, add a ->post_plugged() callback invoked after features have been queried that can handle the VERSION_1 bit being withdrawn and change ccw to fall back to revision 0 if VERSION_1 is gone. Note that pci is _not_ fixed; we'll need to rethink the approach for the next release but at least for pci it's not a regression. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-12-01Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20151201' into stagingPeter Maydell4-8/+36
Last round of s390x fixes for 2.5: - The bios should be built for the first z machine, so that newer instructions don't creep in. - Silence annoying message when running make check. - Fix a problem with the pci iommu exposed by recent changes. # gpg: Signature made Tue 01 Dec 2015 08:59:42 GMT using RSA key ID C6F02FAF # gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>" # gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>" * remotes/cohuck/tags/s390x-20151201: s390x/pci: fix up IOMMU size s390x: no deprecation warning while testing pc-bios/s390-ccw: rebuild image pc-bios/s390-ccw: build for z900 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-12-01s390x/pci: fix up IOMMU sizeYi Min Zhao3-5/+30
Present code uses @size==UINT64_MAX to initialize IOMMU. It infers that it can map any 64-bit IOVA whatsoever. But in fact, the largest DMA range for each PCI Device on s390x is from ZPCI_SDMA_ADDR to ZPCI_EDMA_ADDR. The largest value is returned from hardware, which is to indicate the largest range hardware can support. But the real IOMMU size for specific PCI Device is obtained once qemu intercepts mpcifc instruction that guest is requesting a DMA range for that PCI Device. Therefore, before intercepting mpcifc instruction, qemu cannot be aware of the size of IOMMU region that guest will use. Moreover, iommu replay during device initialization for the whole region in 4k steps takes a very long time. In conclusion, this patch intializes IOMMU region for each PCI Device when intercept mpcifc instruction which is to register DMA range for the PCI Device. And then, destroy IOMMU region when guest wants to deregister IOAT. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-12-01s390x: no deprecation warning while testingCornelia Huck1-3/+6
'make check' tries to start all available machines; the deprecation message for the s390-virtio machine is both useless and annoying there. Silence it while testing. Reported-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-30Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into stagingPeter Maydell3-68/+15
Two fixes for virtfs/9p from Paolo. # gpg: Signature made Mon 30 Nov 2015 14:10:47 GMT using DSA key ID 0101DBC2 # gpg: Good signature from "Greg Kurz <gkurz@fr.ibm.com>" # gpg: aka "Greg Kurz <groug@free.fr>" # gpg: aka "Greg Kurz <gkurz@linux.vnet.ibm.com>" # gpg: aka "Gregory Kurz (Groug) <groug@free.fr>" # gpg: aka "Gregory Kurz (Cimai Technology) <gkurz@cimai.com>" # gpg: aka "Gregory Kurz (Meiosys Technology) <gkurz@meiosys.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 2BD4 3B44 535E C0A7 9894 DBA2 02FC 3AEB 0101 DBC2 * remotes/gkurz/tags/for-upstream: virtio-9p: use QEMU thread pool fsdev-proxy-helper: avoid TOC/TOU race Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-30virtio-9p: use QEMU thread poolPaolo Bonzini3-68/+15
The QEMU thread pool already has a mechanism to invoke callbacks in the main thread. It does not need an EventNotifier and it is more efficient too. Use it instead of GAsyncQueue + GThreadPool + glue. As a side effect, it silences Coverity's complaint about an unchecked return value for event_notifier_init. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com> (removed no more needed #include <glib.h> from virtio-9p-coth.h) Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
2015-11-30hw/ppc/ppc405_boards: Fix infinite recursion by converting taihu_cpld from ↵Peter Maydell1-44/+8
old_mmio The taihu_cpld_writel() function had an obvious typo that meant that if it was ever called it would go into an infinite recursion. Newer versions of clang will detect and warn about this: hw/ppc/ppc405_boards.c:481:1: warning: all paths through this function will call itself [-Winfinite-recursion] Fix this by converting taihu_cpld from the legacy old_mmio accessors to new-style ones, with an impl {} declaration to cause the core memory code to do the splitting of 16 bit and 32 bit accesses into multiple 8-bit accesses. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-11-30hw/ppc/spapr: Remove duplicated "pseries" aliasThomas Huth1-2/+0
The "pseries" alias is currently set twice, one time for the pseries-2.4 machine and one time for the "pseries-2.5" machine. To avoid confusion with the alias, let's remove the one from the older machine class. And while we're at it, also remove the "is_default = 0" there since the is_default variable should be set to zero by default already. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-11-30mac_dbdma: always initialize channel field in DBDMA_channelHervé Poussineau1-1/+1
dbdma_from_ch() uses channel field to return the right DBDMA object. Previous code was working if guest OS was only using registered DMA channels. However, it lead to QEMU crashes if guest OS was using unregistered DMA channels. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-11-27eepro100: Prevent two endless loopsStefan Weil1-0/+16
http://lists.nongnu.org/archive/html/qemu-devel/2015-11/msg04592.html shows an example how an endless loop in function action_command can be achieved. During my code review, I noticed a 2nd case which can result in an endless loop. Reported-by: Qinghao Tang <luodalongde@gmail.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Jason Wang <jasowang@redhat.com>
2015-11-26Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell5-11/+2
vhost, pc: fixes for 2.5 Minor vhost fixes. HW version tweak for PC. Documentation and test updates. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Thu 26 Nov 2015 16:40:25 GMT using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: vhost-user-test: fix migration overlap test Fix memory leak on error Revert "vhost: send SET_VRING_ENABLE at start/stop" tests/vhost-user-bridge: read command line arguments tests/vhost-user-bridge: propose GUEST_ANNOUNCE feature vhost-user: clarify start and enable vhost-user: set link down when the char device is closed pc: Don't set hw_version on pc-*-2.5 osdep: Change default value of qemu_hw_version() to "2.5+" Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-26Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell1-1/+1
Small patches, without the one that introduces -fwrapv. # gpg: Signature made Thu 26 Nov 2015 15:48:53 GMT using RSA key ID 78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" * remotes/bonzini/tags/for-upstream: target-i386: kvm: Print warning when clearing mcg_cap bits target-i386: kvm: Use env->mcg_cap when setting up MCE target-i386: kvm: Abort if MCE bank count is not supported by host virtio-scsi: don't crash without a valid device target-sparc: fix 32-bit truncation in fpackfix exec: remove warning about mempath and hugetlbfs Revert "exec: silence hugetlbfs warning under qtest" call bdrv_drain_all() even if the vm is stopped MAINTAINERS: Update TCG CPU cores section Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-26virtio-scsi: don't crash without a valid deviceEugene (jno) Dvurechenski1-1/+1
Make sure that we actually have a device when checking the aio context. Otherwise guests could trigger QEMU crashes. Signed-off-by: "Eugene (jno) Dvurechenski" <jno@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Message-Id: <1448549135-6582-2-git-send-email-jno@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-11-26Fix memory leak on errorStefano Dong (董兴水)2-0/+2
hw/ppc/spapr.c: Fix memory leak on error, it was introduced in bc09e0611 hw/acpi/memory_hotplug.c: Fix memory leak on error, it was introduced in 34f2af3d Signed-off-by: Stefano Dong (董兴水) <opensource.dxs@aliyun.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-26Revert "vhost: send SET_VRING_ENABLE at start/stop"Michael S. Tsirkin1-9/+0
This reverts commit 3a12f32229a046f4d4ab0a3a52fb01d2d5a1ab76. In case of live migration several queues can be enabled and not only the first one. So informing backend that only the first queue is enabled is wrong. Reported-by: Thibaut Collet <thibaut.collet@6wind.com> Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2015-11-26Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into stagingPeter Maydell1-3/+5
# gpg: Signature made Wed 25 Nov 2015 20:25:21 GMT using RSA key ID AAFC390E # gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>" * remotes/jnsnow/tags/ide-pull-request: ide-test: fix timeouts atapi: Fix code indentation atapi: Account for failed and invalid operations in cd_read_sector() ide-test: cdrom_pio_impl fixup Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-25Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell1-1/+1
Block layer patches # gpg: Signature made Wed 25 Nov 2015 13:33:14 GMT using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: qemu-iotests: Add -nographic when starting QEMU in 119 and 120 block/qapi: Plug memory leak on query-block error path raw-posix.c: Make GetBSDPath() handle caching options nand: fix flash erase when oob is in memory test-aio: Fix event notifier cleanup tests/Makefile: Add more dependencies for test-timed-average Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-25nand: fix flash erase when oob is in memoryRicard Wanderlof1-1/+1
For the "main area on file, oob in memory" case, fix the shifts so that we erase the correct number of pages. Signed-off-by: Ricard Wanderlöf <ricardw@axis.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-25Merge remote-tracking branch 'remotes/sstabellini/tags/xen-20151125' into ↵Peter Maydell2-9/+1
staging Xen 2015/11/25 # gpg: Signature made Wed 25 Nov 2015 11:19:26 GMT using RSA key ID 70E1AE90 # gpg: Good signature from "Stefano Stabellini <stefano.stabellini@eu.citrix.com>" * remotes/sstabellini/tags/xen-20151125: xen_disk: Remove ioreq.postsync xen: fix usage of xc_domain_create in domain builder Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-25pc: Don't set hw_version on pc-*-2.5Eduardo Habkost2-2/+0
Now that qemu_hw_version() returns a fixed "2.5+" string instead of QEMU_VERSION, we don't need to set hw_version on pc-*-2.5 explicitly. Suggested-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-25xen_disk: Remove ioreq.postsyncAlberto Garcia1-8/+0
This code has been dead for three years (since commit 7e7b7cba1). Signed-off-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2015-11-25ivshmem: Rename property memdev to x-memdev for 2.5Markus Armbruster1-5/+3
The device's guest interface and its QEMU user interface are flawed^Whotly debated. We'll resolve that in the next development cycle, probably by deprecating the device in favour of a cleaned up, but not quite compatible revision. To avoid adding more baggage to the soon-to-be-deprecated interface, mark property "memdev" as experimental, by renaming it to "x-memdev". It's the only recent user interface change. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1448384789-14830-6-git-send-email-armbru@redhat.com> [Update of qemu-doc.texi squashed in] Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2015-11-25ivshmem: Mark questionable socket type test FIXMEMarkus Armbruster1-0/+1
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2015-11-24atapi: Fix code indentationAlberto Garcia1-1/+1
This was accidentally changed by commit 5f81724d Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 93fb43522e3b8dddb6c709d568919347d9a5ba3f.1448367341.git.berto@igalia.com Signed-off-by: John Snow <jsnow@redhat.com>
2015-11-24atapi: Account for failed and invalid operations in cd_read_sector()Alberto Garcia1-2/+4
Commit 5f81724d made PIO read requests async but didn't add the relevant block_acct_failed() and block_acct_invalid() calls. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 9b87e09d61019c128139b6c999ed0c07f0674170.1448367341.git.berto@igalia.com Signed-off-by: John Snow <jsnow@redhat.com>
2015-11-24xlnx-ep108: Fix minimum RAM checkAlistair Francis1-1/+1
The minimum RAM check logic for the Xiilnx EP108 was off by one, which caused a false positive. Correct the logic to only print warnings when the RAM is below 0x8000000. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Message-id: fba8112ca7b01efd72553332b8045ecf107b7662.1448021100.git.alistair.francis@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-24virtio-blk: Move resetting of req->mr_next to virtio_blk_handle_rw_errorFam Zheng1-4/+3
"werror=report" would free the req in virtio_blk_handle_rw_error, we mustn't write to it in that case. Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1448239280-15025-1-git-send-email-famz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-11-19Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' ↵Peter Maydell1-1/+4
into staging QOM infrastructure fixes and device conversions * Fix for properties on objects > 4 GiB * Performance improvements for QOM property handling * Assertion cleanups * MAINTAINERS additions # gpg: Signature made Thu 19 Nov 2015 14:32:16 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/qom-devices-for-peter: MAINTAINERS: Add check-qom-{interface,proplist} to QOM qom: Clean up assertions to display values on failure qom: Replace object property list with GHashTable qom: Add a test case for complex property finalization net: Convert net filter code to use object property iterators ppc: Convert spapr code to use object property iterators vl: Convert machine help code to use object property iterators qmp: Convert QMP code to use object property iterators qom: Introduce ObjectPropertyIterator struct for iteration qdev: Change Property::offset field to ptrdiff_t type Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-19Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell6-31/+28
vhost, pc: fixes for 2.5 Fixes all over the place. This also re-enables a test we disabled in 2.5 cycle now that there's a way not to get a warning from it. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Thu 19 Nov 2015 13:27:43 GMT using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: exec: silence hugetlbfs warning under qtest tests: re-enable vhost-user-test acpi: fix buffer overrun on migration vhost-user: fix log size vhost-user: ignore qemu-only features specs/vhost-user: fix spec to match reality tests/vhost-user-bridge: implement logging of dirty pages i440fx: print an error message if user tries to enable iommu q35: Check propery to determine if iommu is set vhost-user: start/stop all rings vhost-user: print original request on error vhost-user-test: support VHOST_USER_SET_VRING_ENABLE vhost-user: update spec description vhost: don't send RESET_OWNER at stop vhost: let SET_VRING_ENABLE message depends on protocol feature Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-19acpi: fix buffer overrun on migrationMichael S. Tsirkin1-2/+6
ich calls acpi_gpe_init with length ICH9_PMIO_GPE0_LEN so ICH9_PMIO_GPE0_LEN/2 bytes are allocated, but then the full ICH9_PMIO_GPE0_LEN bytes are migrated. As a quick work-around, allocate twice the memory. We'll probably want to tweak code to avoid migrating the extra ICH9_PMIO_GPE0_LEN/2 bytes, but that is a bit trickier to do without breaking migration compatibility. Tested-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com> Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com> Cc: qemu-stable@nongnu.org Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-19hw/arm_gic: Correctly restore nested irq priorityFrançois Baldassari1-2/+2
Upon activating an interrupt, set the corresponding priority bit in the APR/NSAPR registers without touching the currently set bits. In the event of nested interrupts, the GIC will then have the information it needs to restore the priority of the pre-empted interrupt once the higher priority interrupt finishes execution. Signed-off-by: François Baldassari <francois@pebble.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-18ppc: Convert spapr code to use object property iteratorsDaniel P. Berrange1-1/+4
Stop directly accessing the Object::properties field data structure and instead use the formal object property iterator APIs. This insulates the code from future data structure changes in the Object struct. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Tested-by: Pavel Fedin <p.fedin@samsung.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-11-18vhost-user: fix log sizeMichael S. Tsirkin1-1/+1
commit 2b8819c6eee517c1582983773f8555bb3f9ed645 ("vhost-user: modify SET_LOG_BASE to pass mmap size and offset") passes log size in units of 4 byte chunks instead of the expected size in bytes. Fix this up. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-18vhost-user: ignore qemu-only featuresMichael S. Tsirkin1-7/+1
Some features (such as ctrl vq) are supported by qemu without need to communicate with the backend. Drop them from the feature mask so we set them unconditionally. Reported-by: Victor Kaplansky <vkaplans@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-18nand: fix address overflowRabin Vincent1-2/+2
The shifts of the address mask and value shift beyond 32 bits when there are 5 address cycles. Cc: qemu-stable@nongnu.org Signed-off-by: Rabin Vincent <rabin.vincent@axis.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-17ide: enable buffered requests for PIO read requestsPeter Lieven1-2/+2
Signed-off-by: Peter Lieven <pl@kamp.de> Reviewed-by: Fam Zheng <famz@redhat.com> Message-id: 1447345846-15624-7-git-send-email-pl@kamp.de Signed-off-by: John Snow <jsnow@redhat.com>
2015-11-17ide: enable buffered requests for ATAPI devicesPeter Lieven1-5/+5
Signed-off-by: Peter Lieven <pl@kamp.de> Reviewed-by: Fam Zheng <famz@redhat.com> Message-id: 1447345846-15624-6-git-send-email-pl@kamp.de Signed-off-by: John Snow <jsnow@redhat.com>
2015-11-17ide: orphan all buffered requests on DMA cancelPeter Lieven1-0/+19
If the guests canceles a DMA request we can prematurely invoke all callbacks of buffered requests and flag all them as orphaned. Ideally this avoids the need for draining all requests. For CDROM devices this works in 100% of all cases. Signed-off-by: Peter Lieven <pl@kamp.de> Reviewed-by: Fam Zheng <famz@redhat.com> Message-id: 1447345846-15624-5-git-send-email-pl@kamp.de Signed-off-by: John Snow <jsnow@redhat.com>
2015-11-17ide: add support for IDEBufferedRequestPeter Lieven2-0/+61
this patch adds a new aio readv compatible function which copies all data through a bounce buffer. These buffered requests can be flagged as orphaned which means that their original callback has already been invoked and the request has just not been completed by the backend storage. The bounce buffer guarantees that guest memory corruption is avoided when such a orphaned request is completed by the backend at a later stage. This trick only works for read requests as a write request completed at a later stage might corrupt data as there is no way to control if and what data has already been written to the storage. Signed-off-by: Peter Lieven <pl@kamp.de> Reviewed-by: Fam Zheng <famz@redhat.com> Message-id: 1447345846-15624-4-git-send-email-pl@kamp.de Signed-off-by: John Snow <jsnow@redhat.com>
2015-11-17ide/atapi: make PIO read requests asyncPeter Lieven1-13/+82
PIO read requests on the ATAPI interface used to be sync blk requests. This has two significant drawbacks. First the main loop hangs util an I/O request is completed and secondly if the I/O request does not complete (e.g. due to an unresponsive storage) Qemu hangs completely. Note: Due to possible race conditions requests during an ongoing elementary transfer are still sync. Signed-off-by: Peter Lieven <pl@kamp.de> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 1447345846-15624-2-git-send-email-pl@kamp.de Signed-off-by: John Snow <jsnow@redhat.com>
2015-11-17i440fx: print an error message if user tries to enable iommuBandan Das1-0/+5
There's no indication of any sort that i440fx doesn't support "iommu=on" Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Bandan Das <bsd@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Bandan Das <bsd@redhat.com>
2015-11-17q35: Check propery to determine if iommu is setBandan Das2-6/+1
The helper function machine_iommu() isn't necesary. We can directly check for the property. Signed-off-by: Bandan Das <bsd@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Bandan Das <bsd@redhat.com>
2015-11-17virtio-blk: Fix double completion for werror=stopFam Zheng1-0/+4
When a request R is absorbed by request M, it is appended to the "mr_next" queue led by M, and is completed together with the completion of M, in virtio_blk_rw_complete. During DMA restart in virtio_blk_dma_restart_bh, requests in s->rq are parsed and submitted again, possibly with a stale req->mr_next. It could be a problem if the request merging in virtio_blk_handle_request hasn't refreshed every mr_next pointer, in which case, virtio_blk_rw_complete could walk through unexpected requests following the stale pointers. Fix this by unsetting the pointer in virtio_blk_rw_complete. It is safe because this req is either completed and freed right away, or it will be restarted and parsed from scratch out of the vq later. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-11-17tpm: avoid clang shifting negative signed warningStefan Hajnoczi1-1/+1
clang 3.7.0 on x86_64 warns about the following: hw/tpm/tpm_tis.c:1000:36: warning: shifting a negative signed value is undefined [-Wshift-negative-value] tis->loc[c].iface_id = TPM_TIS_IFACE_ID_SUPPORTED_FLAGS1_3; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ hw/tpm/tpm_tis.c:144:10: note: expanded from macro 'TPM_TIS_IFACE_ID_SUPPORTED_FLAGS1_3' (~0 << 4)/* all of it is don't care */) ~~ ^ Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-11-16vhost-user: start/stop all ringsMichael S. Tsirkin1-6/+11
We are currently only sending VRING_ENABLE message for the first ring, that's wrong: we must start/stop them all. Reported-by: Victor Kaplansky <victork@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-16vhost-user: print original request on errorMichael S. Tsirkin1-2/+2
When we get an unexpected response, print out the original request. Helps debug protocol errors tremendously. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-16vhost: don't send RESET_OWNER at stopYuanhan Liu1-6/+0
First of all, RESET_OWNER message is sent incorrectly, as it's sent before GET_VRING_BASE. And the reset message would let the later call get nothing correct. And, sending SET_VRING_ENABLE at stop, which has already been done, makes more sense than RESET_OWNER. Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-16vhost: let SET_VRING_ENABLE message depends on protocol featureYuanhan Liu1-1/+1
But not depend on PROTOCOL_F_MQ feature bit. So that we could use SET_VRING_ENABLE to sign the backend on stop, even if MQ is disabled. That's reasonable, since we will have one queue pair at least. Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-13atapi: Prioritize unknown cmd error over BCL errorJohn Snow1-10/+10
If we don't know about the command at all, we need to prioritize that failure above the zero byte-count-limit failure. This fixes a failure in the sparc64 NetBSD 7.0 installer bootup. Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: John Snow <jsnow@redhat.com> Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Message-id: 1447095959-10046-3-git-send-email-jsnow@redhat.com