summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-01-26hw/smc91c111: Add explicit 'return' rather than relying on fallthroughPeter Maydell1-0/+1
Add an explicit 'return' statement to a case in smc91c111_readb rather than relying on fallthrough to the following case's return statement, for code clarity and to placate static analysers. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-26hw/pflash_cfi02.c: Mark deliberate fallthroughPeter Maydell1-0/+1
Mark the deliberate fallthrough where we treat the case of an attempt to read flash when it is an unknown command state as if it were a normal read. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-26hw/omap_dma, hw/omap_spi: Explicitly mark fallthroughsPeter Maydell2-0/+36
Explicitly mark the fallthroughs as intentional in the code pattern where we gradually increment an index before falling into the code to read/write that array entry: case THINGY_3: idx++; case THINGY_2: idx++; case THINGY_1: idx++; case THINGY_0: return s->thingy[idx]; This makes static analysers happy. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-26hw/omap1.c: Add fallthrough markers and breaksPeter Maydell1-0/+3
Explicitly mark cases where we are deliberately falling through to the following code. In one case we insert a 'break' instead of falling through to a 'break', as this seems slightly clearer. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-26hw/arm_sysctl.c: Add missing 'break' statementsPeter Maydell1-0/+2
Add some break statements that were accidentally omitted from some cases of arm_sysctl_write(). The omission was harmless because in both cases the following case did an immediate break, but adding the breaks explicitly placates static analysers and avoids weird behaviour if the following register is ever implemented as something other than a no-op. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-26link seccomp only with softmmu targetsMichael Tokarev1-1/+1
Now, if seccomp is detected, it is linked into every executable, but is used only by softmmu targets (from vl.c). So link it only where it is actually needed. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-26bsd-user: avoid conflict with qemu_vmallocBlue Swirl2-5/+2
Rename qemu_vmalloc() to bsd_vmalloc(), adjust the only user. Remove #ifdeffery in oslib-posix.c. Tested-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-26build: remove extra-obj-yPaolo Bonzini5-12/+8
extra-obj-y is somewhat complicated to understand. Replace it with a special CONFIG_ALL symbol that is defined only at toplevel. This limits the case of directories defining more than one *-obj-y target. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-26build: remove universal-obj-yPaolo Bonzini6-34/+33
All of universal-obj-y, user-obj-y (right now unused) and common-obj-y can be unified into common-obj-y if we take care of defining CONFIG_SOFTMMU and CONFIG_USER_ONLY in the toplevel makefile. This is similar to how we define symbols for hardware components. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-26build: use -$(CONFIG_SECCOMP) instead of ifeqPaolo Bonzini1-5/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-26build: move around libcacard-y definitionPaolo Bonzini1-9/+9
It is also needed if !CONFIG_SOFTMMU, unlike everything that surrounds it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-26tests: adjust gcov variables for directory movementPaolo Bonzini1-7/+7
I had missed the introduction of the gcov-files-* variables. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-25PPC: e500: Select MPIC v4.2 on ppce500 platformScott Wood4-3/+9
The compatible string is changed to fsl,mpic on all e500 platforms, to advertise the existence of BRR1. This matches what the device tree will have on real hardware. With MPIC v4.2 max_cpu can be increased from 15 to 32. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25PPC: e500: fix mpic_iack addressScott Wood1-1/+1
MPIC+0xa0 is IACK for the current CPU. MPIC+0x200a0 is IACK for CPU 0. This fix allows EPR to work with an SMP target. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25openpic: add basic support for MPIC v4.2Scott Wood2-112/+227
Besides the new value in the version register, this provides: - ILR support, which includes: - IDR becoming a pure CPU bitmap, allowing 32 CPUs - machine check output support (though other parts of QEMU need to be fixed for it to do something other than immediately reboot the guest) - dummy error interrupt support (EISR0/EIMR0 read as zero) - actually all FSL MPICs get all summary registers returning zero for now, which includes EISR0/EIMR0 Various refactoring is done to support these changes and to ease new functionality (e.g. a more flexible way of declaring regions). Just as the code was already not a full implementation of MPIC v2.0, this is not a full implementation of MPIC v4.2 -- e.g. it still has only one bank of MSIs. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25openpic: fix timer address decodingScott Wood1-3/+7
The timer memory range begins at 0x10f0, so that address 0x1120 shows up as 0x30, 0x1130 shows up as 0x40, etc. However, the address decoding (other than TFRR) is not adjusted for this, causing the wrong registers to be accessed. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25openpic: fix remaining issues from idr-to-destmask conversionScott Wood1-6/+7
openpic_update_irq() was checking idr rather than destmask, treating it as if it were a simple bitmap of cpus. Changed to use destmask. IPI delivery was removing bits directly from .idr, without calling write_IRQreg_idr so that the change could be conveyed to destmask. Changed to use destmask directly. Save/restore destmask when serializing, as due to the IPI change it cannot be reproduced from idr. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25pseries: Adjust default VIO address allocations to play better with libvirtDavid Gibson1-1/+1
Currently, if VIO devices for pseries don't have addresses explicitly allocated, they get automatically numbered from 0x1000. This is in the same general range that libvirt will typically assign VIO device addresses. That means that if there is a device libvirt doesn't know about, and it gets an address assigned before the libvirt assigned devices are processed, we can end up with an address conflict (qemu will abort with an error). While the real solution is to teach libvirt about the other devices, so it can correctly manage the whole allocation, this patch reduces the interim inconvenience by moving qemu allocations to a range that libvirt is less likely to conflict with. Because the guest gets the device addresses through the device tree, these addresses are truly arbitrary and can be changed without breaking guests. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25pseries: Improve handling of multiple PCI host bridgesDavid Gibson3-43/+94
Multiple - even many - PCI host bridges (i.e. PCI domains) are very common on real PAPR compliant hardware. For reasons related to the PAPR specified IOMMU interfaces, PCI device assignment with VFIO will generally require at least two (virtual) PHBs and possibly more depending on which devices are assigned. At the moment the qemu PAPR PCI code will not deal with this well, leaving several crucial parameters of PHBs other than the default one uninitialized. This patch reworks the code to allow this. Every PHB needs a unique BUID (Bus Unit Identifier, the id used for the PAPR PCI related interfaces) and a unique LIOBN (Logical IO Bus Number, the id used for the PAPR IOMMU related interfaces). In addition they need windows in CPU real address space to access PCI memory space, PCI IO space and MSIs. Properties are added to the PCI host bridge qdevice to allow configuration of all these. To simplify configuration of multiple PHBs for common cases, a convenience "index" property is also added. This can be set instead of the low-level properties, and will generate suitable values for the other parameters, different for each index value. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25target-ppc: Give a meaningful error if too many threads are specifiedMike Qiu1-0/+12
Currently the target-ppc tcg code only supports a single thread. You can specify more, but they're treated identically to multiple cores. On KVM we obviously can't support more threads than the hardware; if more are specified it will cause strange and cryptic errors. This patch clarifies the situation by giving a simple meaningful error if more threads are specified than we can support. Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25cuda: Move ADB bus into CUDA stateAndreas Färber5-10/+15
Replace the global adb_bus with a CUDA-internal one, accessed using regular qdev child bus accessor. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25adb: QOM'ify ADB devicesAndreas Färber4-78/+209
They were not qdev'ified before. Derive ADBDevice from DeviceState and convert reset callbacks to DeviceClass::reset, ADBDevice::opaque pointer to ADBDevice subtypes for mouse and keyboard and adb_{kbd,mouse}_init() to regular qdev functions. Fixing Coding Style issues and splitting keyboard and mouse off into their own files is left for a later point in time. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25adb: QOM'ify Apple Desktop BusAndreas Färber3-3/+30
It was not a qbus before, turn it into a first-class bus and initialize it properly from CUDA. Leave it a global variable as long as devices are not QOM'ified yet. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25cuda: QOM'ify CUDAAndreas Färber5-91/+154
It was not qdev'ified before. Turn it into a SysBusDevice and embed it in MacIO. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25ide/macio: QOM'ify MacIO IDEAndreas Färber6-78/+195
It was not qdev'ified before. Turn it into a SysBusDevice. Embed them into the MacIO devices. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25mac_nvram: QOM'ify MacIO NVRAMAndreas Färber5-41/+102
It was not qdev'ified before. Turn it into a SysBusDevice and initialize it via static properties. Prepare Old World specific MacIO state and embed the NVRAM state there. Drop macio_nvram_setup_bar() in favor of sysbus_mmio_map() or direct use of Memory API. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25mac_nvram: Mark as Big EndianAndreas Färber1-1/+1
Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25mac_nvram: Clean up public APIAndreas Färber2-13/+12
The state data field is accessed in uint8_t quantities, so switch from uint32_t argument and return value to uint8_t. Fix debug format specifiers while at it. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25macio: Split MacIO in twoAndreas Färber4-33/+82
Let the machines create two different types. This prepares to move knowledge about sub-devices from the machines into the devices. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25macio: Delay qdev init until all fields are initializedAndreas Färber1-3/+8
This turns macio_bar_setup() into an implementation detail of the qdev initfn, to be removed step by step. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25macio: QOM'ify some moreAndreas Färber1-6/+19
Move bar MemoryRegion initialization to an instance_init. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-25ppc: Move Mac machines to hw/ppc/Andreas Färber13-43/+44
Signed-off-by: Andreas Färber <afaerber@suse.de> [agraf: squash in MAINTAINERS fix] Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-24Merge remote-tracking branch 'bonzini/scsi-next' into stagingAnthony Liguori1-10/+41
# By Paolo Bonzini (1) and Peter Lieven (1) # Via Paolo Bonzini * bonzini/scsi-next: iscsi: add support for iovectors iscsi: do not leak acb->buf when commands are aborted
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-24iscsi: add support for iovectorsPeter Lieven1-9/+34
This patch adds support for directly passing the iovec array from QEMUIOVector if libiscsi supports it (1.8.0 or newer). Signed-off-by: Peter Lieven <pl@kamp.de> [Preserve the improvements from commit 4cc841b, iscsi: partly avoid iovec linearization in iscsi_aio_writev, 2012-11-19 - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-24iscsi: do not leak acb->buf when commands are abortedPaolo Bonzini1-1/+7
acb->buf is freed in the WRITE(16) callback, but this may not get called at all when commands are aborted. Add another free in the ABORT TASK callback, which requires setting acb->buf to NULL everywhere. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-24target-cris: Fix typo in D_LOG() macroAndreas Färber2-2/+2
It's __VA_ARGS__. Fixes the build with CRIS_[OP_]HELPER_DEBUG defined. Broken since r6338 / 93fcfe39a0383377e647b821c9f165fd927cd4e0 (Convert references to logfile/loglevel to use qemu_log*() macros). Cc: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.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 Liguori4-14/+105
# 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 Liguori3-17/+91
# 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-23Merge remote-tracking branch 'spice/spice.v68' into stagingAnthony Liguori2-6/+20
# By Alon Levy # Via Gerd Hoffmann * spice/spice.v68: qxl: change rom size to 8192 qxl: stop using non revision 4 rom fields for revision < 4
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-22iscsi: add support for iSCSI NOPs [v2]Peter Lieven1-0/+38
This patch will send NOP-Out PDUs every 5 seconds to the iSCSI target. If a consecutive number of NOP-In replies fail a reconnect is initiated. iSCSI NOPs help to ensure that the connection to the target is still operational. This should not, but in reality may be the case even if the TCP connection is still alive if there are bugs in either the target or the initiator implementation. v2: - track the NOPs inside libiscsi so libiscsi can reset the counter in case it initiates a reconnect. Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-22iscsi: partly avoid iovec linearization in iscsi_aio_writevPeter Lieven1-5/+11
libiscsi expects all write16 data in a linear buffer. If the iovec only contains one buffer we can skip the linearization step as well as the additional malloc/free and pass the buffer directly. Reported-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-22iscsi: add iscsi_create supportPeter Lieven1-0/+52
This patch adds support for bdrv_create. This allows e.g. to use qemu-img to convert from any supported device to an iscsi backed storage as destination. Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-22usb: add usb-bot device (scsi bulk-only transport).Gerd Hoffmann2-16/+89
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>