summaryrefslogtreecommitdiffstats
path: root/hw
Commit message (Collapse)AuthorAgeFilesLines
* ppc405_uc: fix a buffer overflowBlue Swirl2011-01-121-2/+3
| | | | | | | | | | Fix a buffer overflow, reported by cppcheck: [/src/qemu/hw/ppc405_uc.c:72]: (error) Buffer access out-of-bounds: bd.bi_s_version The use of field bi_s_version seems to be a typo, it should be bi_r_version. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* lan9118: fix a buffer overflowBlue Swirl2011-01-121-2/+2
| | | | | | | | | | Fix a buffer overflow, reported by cppcheck: [/src/qemu/hw/lan9118.c:849]: (error) Buffer access out-of-bounds: s.eeprom All eeprom handling code assumes that the size of eeprom is 128, except lan9118_eeprom_cmd. Fix this by restricting the address passed. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* loader: fix a file descriptor leakBlue Swirl2011-01-121-2/+3
| | | | | | | Fix a file descriptor leak, reported by cppcheck: [/src/qemu/hw/loader.c:311]: (error) Resource leak: fd Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Merge remote branch 'mst/for_anthony' into stagingAnthony Liguori2011-01-1011-31/+374
|\
| * pci: fix migration path for devices behind bridgesMichael S. Tsirkin2010-12-271-11/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The device path used for migration is currently broken for for all devices behind a nested bridge. Replace this by a hierarchical list of slot/function numbers, walking the path from root down to device. Add :00 after the domain number so that if there are no nested bridges, this is compatible with what we have now. Note: as pointed out by Gleb, using openfirmware paths might be cleaner, doing this would break compatibility though, and the IDs used are not guest or user visible at all, so breaking the compatibility is probably not worth it. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pcie/aer: glue aer error injection into qemu monitorIsaku Yamahata2010-12-242-0/+236
| | | | | | | | | | | | | | introduce pcie_aer_inject_error command. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: introduce a helper function to convert qdev id to PCIDeviceIsaku Yamahata2010-12-242-0/+36
| | | | | | | | | | | | | | | | This patch introduce a helper function to get PCIDevice from qdev id. This function will be used later. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * qdev: export qdev_find_recursive() for later useIsaku Yamahata2010-12-242-1/+3
| | | | | | | | | | | | | | This patch exports qdev_find_recursive() for later use. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * build, pci: remove QMP dependency on core PCI codeIsaku Yamahata2010-12-221-0/+37
| | | | | | | | | | | | | | | | by introducing pci-stub.c, eliminate QMP dependency on core PCI code rquired by query-pci command. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pcie: add flr supportIsaku Yamahata2010-12-226-13/+12
| | | | | | | | | | | | | | Support flr: trigger device reset on flr config write. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pc/piix: fix mismerge of b1aeb92666d2fde413c34578b3b42bbfe5f2a506Isaku Yamahata2010-12-221-8/+4
| | | | | | | | | | | | | | | | The change set of b1aeb92666d2fde413c34578b3b42bbfe5f2a506 in pci branch was mismerged. The compatibility should be kept for 0.13, not for 0.14. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * qdev: remove an unused functionMichael S. Tsirkin2010-12-212-7/+1
| | | | | | | | | | | | qbus_reset_all is unused, remove it Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * qbus: register reset handler for qbus whose parent is NULLIsaku Yamahata2010-12-202-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stefan Weil reported the regression caused by ec990eb622ad46df5ddcb1e94c418c271894d416 as follows > The second regression also occurs with MIPS malta. > Networking no longer works with the default pcnet nic. > > This is caused because the reset function for pcnet is no > longer called during system boot. The result in an invalid > mac address (all zero) and a non-working nic. > > For this second regression I still have no simple solution. > Of course mips_malta.c should be converted to qdev which > would fix both problems (but only for malta system emulation). The issue is, it is assumed that all qbuses, qdeves are under main_system_bus. But there are qbuses whose parent is NULL. So it is necessary to trigger reset for those qbuses. (On the other hand, if NULL is passed to qdev_create(), its parent bus is main_system_bus.) Ideally those buses should be moved under bus controller device which is qdev. But it's not done yet. So register qbus reset handler for qbus whose parent is NULL. Reported-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: "Michael S. Tsirkin" <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * qdev: sysbus_get_default must not return a NULL pointer (fix regression)Stefan Weil2010-12-191-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Every system should have some sort of main system bus, so sysbus_get_default should always return a valid bus. Without this patch, at least mipssim and malta no longer start but raise a null pointer access exception (caused by commit ec990eb622ad46df5ddcb1e94c418c271894d416). Cc: Anthony Liguori <anthony@codemonkey.ws> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: don't use bus number in migration, stub outMichael S. Tsirkin2010-12-191-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Using bus numbers in migration is clearly wrong as they are guest assigned. Not really sure what the right thing to do is, for now stick 0 in there so things keep working for non-nested setups, add a TODO. We also probably have to mark nested bridges as non-migrateable until this is fixed? Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Alex Williamson <alex.williamson@redhat.com>
* | target-sh4: implement writes to mmaped ITLBAurelien Jarno2011-01-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | Some Linux kernels seems to implement ITLB/UTLB flushing through by writing all TLB entries through the memory mapped interface instead of writing one to MMUCR.TI. Implement memory mapped ITLB write interface so that such kernels can boot. This fixes https://bugs.launchpad.net/bugs/700774 . Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | cirrus: delete GCC 4.6 warningsAurelien Jarno2011-01-061-3/+3
| | | | | | | | | | | | | | | | Commit 92d675d1c1f23f3617e24b63c825074a1d1da44b triggered uninitialized variables warning with GCC 4.6. Fix them by adding zero initializers. Acked-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | cirrus_vga: Declare as little endianBlue Swirl2011-01-061-100/+12
| | | | | | | | | | | | | | | | This patch replaces explicit bswaps with endianness hints to the mmio layer. CC: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | pc: move port 92 stuff back to pc.c from pckbd.cBlue Swirl2011-01-062-20/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | 956a3e6bb7386de48b642d4fee11f7f86a2fcf9a introduced a bug concerning reset bit for port 92. Since the keyboard output port and port 92 are not compatible anyway, let's separate them. Reported-by: Peter Lieven <pl@dlh.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> -- v2: added reset handler and VMState
* | cirrus_vga: fix division by 0 for color expansion ropAurelien Jarno2011-01-041-32/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit d85d0d3883f5a567fa2969a0396e42e0a662b3fa introduces a regression with Windows ME that leads to a division by 0 and a crash. It uses the color expansion rop with the source pitch set to 0. This is something allowed, as the manual explicitely says "When the source of color-expand data is display memory, the source pitch is ignored.". This patch fixes this regression by computing sx, sy and others variables only if they are going to be used later, that is for a plain copy ROP. It basically consists in moving code. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | Fix curses on big endian hostsAurelien Jarno2011-01-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On big endian hosts, the curses interface is unusable: the emulated graphic card only displays garbage, while the monitor interface displays nothing (or rather only spaces). The curses interface is waiting for data in native endianness, so console_write_ch() should not do any conversion. The conversion should be done when reading the video buffer in hw/vga.c. I supposed this buffer is in little endian mode, though it's not impossible that the data is actually in guest endianness. I currently have no big endian guest to way (they all switch to graphic mode immediately). Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | Merge branch 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemuAurelien Jarno2010-12-277-1/+2196
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemu: vnc/spice: add set_passwd monitor command. vnc: support password expire vnc: auth reject cleanup spice: add qmp 'query-spice' and hmp 'info spice' commands. spice: connection events. spice: add qxl device spice: add qxl vgabios binary.
| * | spice: add qxl deviceGerd Hoffmann2010-12-097-1/+2196
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qxl is a paravirtual graphics card. The qxl device is the bridge between the guest and the spice server (aka libspice-server). The spice server will send the rendering commands to the spice client, which will actually render them. The spice server is also able to render locally, which is done in case the guest wants read something from video memory. Local rendering is also used to support display over vnc and sdl. qxl is activated using "-vga qxl". qxl supports multihead, additional cards can be added via '-device qxl". [ v2: add copyright to files ] [ v2: use qemu-common.h for standard includes ] [ v2: create separate qxl-vga device for primary ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | | s390: compile fixesAlexander Graf2010-12-262-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | The s390 target doesn't compile out of the box anymore. This patch fixes all the obvious glitches that got introduced in the last few weeks. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | | qdev: sysbus_get_default must not return a NULL pointer (fix regression)Stefan Weil2010-12-211-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every system should have some sort of main system bus, so sysbus_get_default should always return a valid bus. Without this patch, at least mipssim and malta no longer start but raise a null pointer access exception (caused by commit ec990eb622ad46df5ddcb1e94c418c271894d416). Cc: Anthony Liguori <anthony@codemonkey.ws> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | | sparc32: ledma extra registers need tracing tooBob Breuer2010-12-201-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | Also trace the extra registers, and update the comments with new info from Artyom Tarasenko. Signed-off-by: Bob Breuer <breuerr@mc.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | | wdt_ib700: Fix accidental use of SoftFloat int64 typeAndreas Färber2010-12-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | softfloat.h's int64 type has least-width semantics. Since we're assigning an int64_t, use plain int64_t. v4: * Summary change. v3: * Split off. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Acked-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | | apic: Fix accidental use of SoftFloat uint32 typeAndreas Färber2010-12-201-1/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | softfloat.h's uint32 type has least-width semantics. Surrounding code uses uint32_t, so use uint32_t here, too. v4: * Summary change. v3: * Split off. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | ahci: delete write-only variables (v2)Blue Swirl2010-12-191-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid these warnings with GCC 4.6.0: /src/qemu/hw/ide/ahci.c: In function 'ahci_reset_port': /src/qemu/hw/ide/ahci.c:810:14: error: variable 'tfd' set but not used [-Werror=unused-but-set-variable] /src/qemu/hw/ide/ahci.c: In function 'handle_cmd': /src/qemu/hw/ide/ahci.c:1103:19: error: variable 'pr' set but not used [-Werror=unused-but-set-variable] In the tfd variable case, fix the logic also. CC: Alexander Graf <agraf@suse.de> CC: Kevin Wolf <kwolf@redhat.com> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | vga: Declare as little endianBlue Swirl2010-12-191-25/+1
| | | | | | | | | | | | | | | | | | This patch replaces explicit bswaps with endianness hints to the mmio layer. CC: Alexander Graf <agraf@suse.de> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | sparc32: ledma extra registersBob Breuer2010-12-182-8/+23
| | | | | | | | | | | | | | | | | | | | ledma has 0x20 bytes of registers according to OBP, and at least Solaris9 reads the 5th register which is beyond what we've mapped. So let's setup a flag (inspired by a previous patch from Blue Swirl) to identify ledma from espdma, and map another 16 bytes of registers which return 0. Signed-off-by: Bob Breuer <breuerr@mc.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | ide: Build fix for via.cKevin Wolf2010-12-171-1/+1
| | | | | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | ide: Fix build for cmd646.cKevin Wolf2010-12-171-2/+2
| | | | | | | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Acked-by: Andreas Färber <andreas.faerber@web.de>
* | scsi-disk: support WRITE SAME (16) with unmap bitChristoph Hellwig2010-12-172-2/+52
| | | | | | | | | | | | | | | | | | | | Support discards via the WRITE SAME command with the unmap bit set, and tell the initiator about the support for it via the block limit and the new thin provisioning EVPD pages. Also fix the comment which incorrectly describedthe block limits EVPD page. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | ide: Register vm change state handler once onlyStefan Hajnoczi2010-12-173-28/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We register the vm change state handler in a PCI BAR map() function. This function can be called multiple times throughout the lifetime of a PCI IDE device. This results in duplicate vm change state handlers being register, none of which are ever unregistered. Instead, register the vm change state handler in the device's init function once and for all. piix tested, cmd646 and via not tested. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | Remove NULL checks for bdrv_new return valueKevin Wolf2010-12-171-11/+6
| | | | | | | | | | | | It's an indirect call to qemu_malloc, which never returns an error. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | ide: honor ncq for atapiAlexander Graf2010-12-171-0/+6
| | | | | | | | | | | | | | | | | | ATAPI also can do ncq, so let's expose the capability. This patch makes CD-ROM support work on Windows 7 for me. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | ahci: set SATA Mode SelectSebastian Herbszt2010-12-171-0/+3
| | | | | | | | | | | | | | Set SATA Mode Select to AHCI in the Address Map Register. Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | ahci: add ahci emulationAlexander Graf2010-12-171-0/+1524
| | | | | | | | | | | | | | | | This patch adds an emulation layer for an ICH-9 AHCI controller. For now this controller does not do IDE legacy emulation. It is a pure AHCI controller. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | pci: add ich9 pci idAlexander Graf2010-12-171-0/+1
| | | | | | | | | | | | | | | | | | | | We need a PCI ID for our new AHCI adapter. I just picked an ICH-9 because that's the one in the Q35 chipset. This patch adds a PCI ID define for an ICH-9 AHCI adapter. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | pci: add storage class for sataAlexander Graf2010-12-171-0/+1
| | | | | | | | | | | | | | This patch adds the storage sata class id. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | ide: add ncq identify data for ahci sata drivesRoland Elek2010-12-172-0/+9
| | | | | | | | | | | | | | | | | | I modified ide_identify() to include the zero-based queue length value in word 75, and set bit 8 in word 76 to signal NCQ support in the identify data for AHCI SATA drives. Signed-off-by: Roland Elek <elek.roland@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | ide: move transfer_start after variable modificationAlexander Graf2010-12-171-4/+4
| | | | | | | | | | | | | | | | | | | | We hook into transfer_start and immediately call the end function for ahci. This means that everything needs to be in place for the end function when we start the transfer, so let's move the function down to where all state is in place. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | ide: Split out BMDMA code from ATA coreAlexander Graf2010-12-177-298/+446
| | | | | | | | | | | | | | | | | | The ATA core is currently heavily intertwined with BMDMA code. Let's loosen that a bit, so we can happily replace the DMA backend with different implementations. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | ide: fix whitespace gap in ide_exec_cmdAlexander Graf2010-12-171-367/+367
| | | | | | | | | | | | | | | | | | Now that we have the function split out, we have to reindent it. In order to increase the readability of the actual functional change, this is split out. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | ide: split ide command interpretation offAlexander Graf2010-12-172-6/+16
| | | | | | | | | | | | | | | | The ATA command interpretation code can be used for PATA and SATA interfaces alike. So let's split it out into a separate function. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | Merge remote branch 'jvrao/for-anthony' into stagingAnthony Liguori2010-12-175-12/+20
|\ \
| * | virtio-9p: fix build on !CONFIG_UTIMENSATHidetoshi Seto2010-12-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduce a fallback mechanism for old systems that do not support utimensat(). This fix build failure with following warnings: hw/virtio-9p-local.c: In function 'local_utimensat': hw/virtio-9p-local.c:479: warning: implicit declaration of function 'utimensat' hw/virtio-9p-local.c:479: warning: nested extern declaration of 'utimensat' and: hw/virtio-9p.c: In function 'v9fs_setattr_post_chmod': hw/virtio-9p.c:1410: error: 'UTIME_NOW' undeclared (first use in this function) hw/virtio-9p.c:1410: error: (Each undeclared identifier is reported only once hw/virtio-9p.c:1410: error: for each function it appears in.) hw/virtio-9p.c:1413: error: 'UTIME_OMIT' undeclared (first use in this function) hw/virtio-9p.c: In function 'v9fs_wstat_post_chmod': hw/virtio-9p.c:2905: error: 'UTIME_OMIT' undeclared (first use in this function) [NOTE: At this time virtio-9p is only user of utimensat(), and is available only when host is linux and CONFIG_VIRTFS is defined. So there are no similar warning for win32. Please provide a wrapper for win32 in oslib-win32.c if new user really requires it.] v5: - Allow fallback on runtime - Move qemu_utimensat() to oslib-posix.c - Rebased on latest qemu.git v4: - Use tv_now.tv_usec v3: - Use better alternative handling for UTIME_NOW/OMIT - Move qemu_utimensat() to cutils.c V2: - Introduce qemu_utimensat() Acked-by: Chris Wright <chrisw@sous-sol.org> Acked-by: M. Mohan Kumar <mohan@in.ibm.com> Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
| * | virtio-9p: Check the return value of llistxattr.Kusanagi Kouichi2010-12-021-0/+3
| | | | | | | | | | | | | | | | | | | | | If llistxattr returned 0, qemu aborts. Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
| * | hw/virtio9p: Use appropriate debug print functions in TLINK pathHarsh Prateek Bora2010-12-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Running fsstress with debug enabled causes assertion failure because of inappropriate usage of debug print functions. With this patch, fsstress passes without assertion failure. Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
OpenPOWER on IntegriCloud