summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2013-01-24Revert "serial: fix retry logic"Michael Tokarev1-3/+1
This reverts commit 67c5322d7000fd105a926eec44bc1765b7d70bdd: I'm not sure if the retry logic has ever worked when not using FIFO mode. I found this while writing a test case although code inspection confirms it is definitely broken. The TSR retry logic will never actually happen because it is guarded by an 'if (s->tsr_rety > 0)' but this is the only place that can ever make the variable greater than zero. That effectively makes the retry logic an 'if (0) I believe this is a typo and the intention was >= 0. Once this is fixed thoug I see double transmits with my test case. This is because in the non FIFO case, serial_xmit may get invoked while LSR.THRE is still high because the character was processed but the retransmit timer was still active. We can handle this by simply checking for LSR.THRE and returning early. It's possible that the FIFO paths also need some attention. Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Even if the previous logic was never worked, new logic breaks stuff - namely, qemu -enable-kvm -nographic -kernel /boot/vmlinuz-$(uname -r) -append console=ttyS0 -serial pty the above command will cause the virtual machine to stuck at startup using 100% CPU till one connects to the pty and sends any char to it. Note this is rather typical invocation for various headless virtual machines by libvirt. So revert this change for now, till a better solution will be found. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-24trivial: etraxfs_eth: Eliminate checkpatch errorsGrant Likely1-456/+466
This is a trivial patch to harmonize the coding style on hw/etraxfs_eth.c. This is in preparation to split off the bitbang mdio code into a separate file. Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Paul Brook <paul@codesourcery.com> Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com> Cc: Anthony Liguori <aliguori@us.ibm.com> Cc: Andreas Färber <afaerber@suse.de> Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-01-23Merge remote-tracking branch 'bonzini/scsi-next' into stagingAnthony Liguori3-9/+4
# By Peter Lieven (3) and others # Via Paolo Bonzini * bonzini/scsi-next: scsi: Drop useless null test in scsi_unit_attention() lsi: use qbus_reset_all to reset SCSI bus scsi: fix segfault with 0-byte disk iscsi: add support for iSCSI NOPs [v2] iscsi: partly avoid iovec linearization in iscsi_aio_writev iscsi: add iscsi_create support
2013-01-23Merge remote-tracking branch 'kraxel/usb.77' into stagingAnthony Liguori2-16/+81
# By Gerd Hoffmann # Via Gerd Hoffmann * kraxel/usb.77: usb: add usb-bot device (scsi bulk-only transport). ohci: add missing break Revert "usb-storage: Drop useless null test in usb_msd_handle_data()"
2013-01-22scsi: Drop useless null test in scsi_unit_attention()Markus Armbruster1-1/+1
req was created by scsi_req_alloc(), which initializes req->dev to a value it dereferences. req->dev isn't changed anywhere else. Therefore, req->dev can't be null. Drop the useless null test; it spooks Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com>
2013-01-22lsi: use qbus_reset_all to reset SCSI busPaolo Bonzini1-6/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-22scsi: fix segfault with 0-byte diskPaolo Bonzini1-2/+2
When a 0-sized disk is found, READ CAPACITY will return a LUN NOT READY error. However, because it returns -1 instead of zero, the HBA will call scsi_req_continue. This will typically cause a segmentation fault or an assertion failure. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-22usb: add usb-bot device (scsi bulk-only transport).Gerd Hoffmann1-15/+79
Basically the same as usb-storage, but without automatic scsi device setup. Also features support for up to 16 LUNs. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-22ohci: add missing breakGerd Hoffmann1-0/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-22qxl: change rom size to 8192Alon Levy1-6/+7
This is a simpler solution to 869981, where migration breaks since qxl's rom bar size has changed. Instead of ignoring fields in QXLRom, which is what has actually changed, we remove some of the modes, a mechanism already accounted for by the guest. The modes left allow for portrait and landscape only modes, corresponding to orientations 0 and 1. Orientations 2 and 3 are dropped. Added assert so that rom size will fit the future QXLRom increases via spice-protocol changes. This patch has been tested with 6.1.0.10015. With the newer 6.1.0.10016 there are problems with both "(flipped)" modes prior to the patch, and the patch loses the ability to set "Portrait" modes. But this is a separate bug to be fixed in the driver, and besides the patch doesn't affect the new arbitrary mode setting functionality. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-22Revert "usb-storage: Drop useless null test in usb_msd_handle_data()"Gerd Hoffmann1-1/+1
This reverts commit a1cbfd554e11bb8af38c2f3e1f1574bf4c563cd2. Test isn't useless. scsi_req_enqueue() may finish the request (will actually happen for requests which don't trigger any I/O such as INQUIRY), then call usb_msd_command_complete() which in turn will set s->req to NULL after unref'ing it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-22qxl: stop using non revision 4 rom fields for revision < 4Alon Levy1-0/+11
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-21sysbus: Drop sysbus_from_qdev() cast macroAndreas Färber75-214/+213
Replace by SYS_BUS_DEVICE() QOM cast macro using a scripted conversion. Avoids the old macro creeping into new code. Resolve a Coding Style warning in openpic code. 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-21virtio-s390-device: create a virtio-s390-bus during init.KONRAD Frederic2-0/+3
A virtio-s390-bus is created during the init. So one VirtIODevice can be connected on the virtio-s390-device through this bus. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-21virtio-s390-bus: add virtio-s390-bus.KONRAD Frederic2-0/+46
This add the virtio-s390-bus which extends virtio-bus. So one VirtIODevice can be connected on this bus. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-21virtio-pci: refactor virtio-pci device.KONRAD Frederic2-2/+139
Create the virtio-pci device which is abstract. This transport device will create a virtio-pci-bus, so one VirtIODevice can be connected. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-21virtio-pci-bus: introduce virtio-pci-bus.KONRAD Frederic2-0/+52
Introduce virtio-pci-bus, which extends virtio-bus. It is used with virtio-pci transport device. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-21virtio-device: refactor virtio-device.KONRAD Frederic4-12/+130
Create the virtio-device which is abstract. All the virtio-device can extend this class. It also add some functions to virtio-bus. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-21virtio-bus: introduce virtio-busKONRAD Frederic3-0/+217
Introduce virtio-bus. Refactored transport device will create a bus which extends virtio-bus. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-21qdev: add a maximum device allowed field for the bus.KONRAD Frederic2-0/+14
Add a max_dev field to BusClass to specify the maximum amount of devices allowed on the bus (has no effect if max_dev=0) Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-21hw/tpci200: Fix compiler warning (redefined symbol with MinGW)Stefan Weil1-3/+3
STATUS_TIMEOUT is defined in winnt.h: CC hw/tpci200.o hw/tpci200.c:34:0: warning: "STATUS_TIMEOUT" redefined [enabled by default] /usr/lib/gcc/x86_64-w64-mingw32/4.6/../../../../x86_64-w64-mingw32/include/winnt.h:1036:0: note: this is the location of the previous definition Use STATUS_TIME instead of STATUS_TIMEOUT as suggested by Alberto Garcia. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-21acpitable: open the data file in binary modeMichael Tokarev1-1/+1
-acpitable {file|data}=file reads the content of file, but it is in binary form, so the file should be opened usin O_BINARY flag. On *nix it is a no-op, but on windows and other weird platform it is really needed. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-21hw: Spelling fix in log messageStefan Weil1-1/+1
defineition -> definition Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Andreas F=E4rber <afaerber@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-20Merge remote-tracking branch 'stefanha/block' into stagingAnthony Liguori3-5/+8
# By Kevin Wolf (4) and others # Via Stefan Hajnoczi * stefanha/block: dataplane: support viostor virtio-pci status bit setting dataplane: avoid reentrancy during virtio_blk_data_plane_stop() win32-aio: use iov utility functions instead of open-coding them win32-aio: Fix memory leak win32-aio: Fix vectored reads aio: Fix return value of aio_poll() ide: Remove wrong assertion block: fix null-pointer bug on error case in block commit
2013-01-19usb: Fix compilation for MinGW (regression)Stefan Weil1-1/+1
84f2d0ea added an argument to function usb_host_info. The stub function must match the declaration in usb.h. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19vl: Use size_t for sizes in get_boot_devices_list()Markus Armbruster1-1/+1
Code mixes uint32_t, int and size_t. Very unlikely to go wrong in practice, but clean it up anyway. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19fw_cfg: Use void *, size_t instead of uint8_t *, uint32_t for blobsMarkus Armbruster3-26/+26
Many callers pass size_t, which gets silently truncated to uint32_t. Harmless, because all practical sizes are well below 4GiB. Clean it up anyway. Size overflow now fails assertions. Bonus: saves a whole bunch of silly casts. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19pc: Clean up bochs_bios_init()'s (non-)use of sizeofMarkus Armbruster1-3/+3
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19sun4: Fix unchecked strdup() by switching to fw_cfg_add_string()Markus Armbruster2-12/+4
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19pc: Fix unchecked strdup() by switching to fw_cfg_add_string()Markus Armbruster1-3/+1
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19fw_cfg: New fw_cfg_add_string()Markus Armbruster2-0/+8
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19fw_cfg: Dumb down fw_cfg_add_*() not to return success / failureMarkus Armbruster2-35/+24
No caller is checking the value, so all errors get ignored, usually silently. assert() instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19fw_cfg: Replace debug prints by tracepointsMarkus Armbruster1-19/+6
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19Merge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agrafBlue Swirl4-21/+55
* 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf: PPC: KVM: Add support for EPR with KVM openpic: export e500 epr enable into a ppc.c function Update Linux kernel headers PPC: e500: Change in-memory order of load blobs PPC: Provide zero SVR for -cpu e500mc and e5500 PPC: E500: Calculate loading blob offsets properly openpic: set mixed mode as supported openpic: unify gcr mode mask updates openpic: move gcr write into a function
2013-01-18s390: Add a hypercall registration interface.Cornelia Huck4-42/+107
Allow virtio machines to register for different diag500 function codes and convert s390-virtio to use it. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18S390: Enable -cpu help and QMP query-cpu-definitionsViktor Mihajlovski1-1/+5
This enables qemu -cpu help to return a list of supported CPU models on s390 and also to query for cpu definitions in the monitor. Initially only cpu model = host is returned. This needs to be reworked into a full-fledged CPU model handling later on. This change is needed to allow libvirt exploiters (like OpenStack) to specify a CPU model. Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> [agraf: fix s390x-linux-user, adjust header locations] Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18s390: Move IPL code into a separate deviceChristian Borntraeger3-88/+185
Lets move the code to setup IPL for external kernel or via the zipl rom into a separate file. This allows to - define a reboot handler, setting up the PSW appropriately - enhance the boot code to IPL disks that contain a bootmap that was created with zipl under LPAR or z/VM (future patch) - reuse that code for several machines (e.g. virtio-ccw and virtio-s390) - allow different machines to provide different defaults Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> [agraf: symbolify initial psw, adjust header file location, fix for QOM] Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18PPC: KVM: Add support for EPR with KVMAlexander Graf1-0/+6
This patch links KVM EPR support to the existing TCG support we have now. Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18openpic: export e500 epr enable into a ppc.c functionAlexander Graf3-6/+18
Enabling and disabling the EPR capability (mpic_proxy) is a system wide operation. As such, it belongs into the ppc.c file, since that's where PPC specific machine wide logic happens. Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18PPC: e500: Change in-memory order of load blobsAlexander Graf1-1/+6
Today, we load <kernel> <initrd> <dtb> into memory in that order. However, Linux has a bug where it can only handle the dtb if it's within the first 64MB of where <kernel> starts. So instead, let's change the order to <kernel> <dtb> <initrd> making Linux happy. Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18PPC: E500: Calculate loading blob offsets properlyAlexander Graf1-4/+8
We have 3 blobs we need to load when booting the system: - kernel - initrd - dtb We place them in physical memory in that order. At least we should. This patch fixes the location calculation up to take any module into account, fixing the dtb offset along the way. Reported-by: Stuart Yoder <stuart.yoder@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18openpic: set mixed mode as supportedAlexander Graf1-0/+1
The Raven MPIC implementation supports the "Mixed" mode to work with an i8259. While we don't implement mixed mode, we should mark it as a supported mode in the mode bitmap. Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18openpic: unify gcr mode mask updatesAlexander Graf1-12/+13
The mode mask already masks out bits we don't care about, so the actual handling code can stay intact regardless. Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18openpic: move gcr write into a functionAlexander Graf1-17/+22
The GCR register contains too much functionality to be covered inside of the register switch statement. Move it out into a separate function. Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18dataplane: support viostor virtio-pci status bit settingStefan Hajnoczi1-1/+2
The viostor virtio-blk driver for Windows does not use the VIRTIO_CONFIG_S_DRIVER bit. It only sets the VIRTIO_CONFIG_S_DRIVER_OK bit. The viostor driver refreshes the virtio-pci status byte sometimes while the guest is running. We misinterpret 0x4 (VIRTIO_CONFIG_S_DRIVER_OK) as an indication that virtio-blk-data-plane should be stopped since 0x2 (VIRTIO_CONFIG_S_DRIVER) is missing. The result is that the device becomes unresponsive. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-18dataplane: avoid reentrancy during virtio_blk_data_plane_stop()Stefan Hajnoczi1-3/+6
When dataplane is stopping, the s->vdev->binding->set_host_notifier(..., false) call can invoke the virtqueue handler if an ioeventfd notification is pending. This causes hw/virtio-blk.c to invoke virtio_blk_data_plane_start() before virtio_blk_data_plane_stop() returns! The result is that we try to restart dataplane while trying to stop it and the following assertion is raised: msix_set_mask_notifier: Assertion `!dev->msix_mask_notifier' failed. Although the code was intended to prevent this scenario, the s->started boolean isn't enough. Add s->stopping so that we can postpone clearing s->started until we've completely stopped dataplane. This way, virtqueue handler calls during virtio_blk_data_plane_stop() are ignored. When dataplane is legitimately started again later we already self-kick ourselves to resume processing. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-17Merge remote-tracking branch 'luiz/queue/qmp' into stagingAnthony Liguori15-23/+24
# By Wenchao Xia # Via Luiz Capitulino * luiz/queue/qmp: HMP: add sub command table to info HMP: move define of mon_cmds HMP: add infrastructure for sub command HMP: delete info handler HMP: add QDict to info callback handler
2013-01-17virtio-pci: fix irqfd cleanup argument orderMichael S. Tsirkin1-3/+3
Order of arguments of kvm_virtio_pci_irqfd_release got mixed up in all calls. As a result users see assertions during cleanup. Reported-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-17qom: Extend documentation on QOM method conceptsAndreas Färber1-4/+10
Add a documentation section "Methods" and discuss among others how to handle overriding virtual methods. Clarify DeviceClass::realize documentation and refer to the above. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-17HMP: add QDict to info callback handlerWenchao Xia15-23/+24
This patch change all info call back function to take additional QDict * parameter, which allow those command take parameter. Now it is set to NULL at default case. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>