summaryrefslogtreecommitdiffstats
path: root/hw
Commit message (Collapse)AuthorAgeFilesLines
* sparc32 fix spurious dma interrupts v2Artyom Tarasenko2010-02-151-10/+24
| | | | | | | | | | | | | | | Don't raise irq when not enabled. Raise irq on enabling if DMA_INTR is set Don't clear irq unless it was raised by DMA, as there are other irq sources Don't set DMA_INTR bit spuriously. v1->v2: - Don't clear irq unless it was raised by DMA - Raise irq on enabling if DMA_INTR is set - Assume revertion of 787cfbc432bf1d353a77cbdb613754f3963371a3 Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Revert "Sparc32: improve DMA controller IRQ debugging"Blue Swirl2010-02-151-2/+0
| | | | This reverts commit 787cfbc432bf1d353a77cbdb613754f3963371a3.
* dec: use PCI accessorsBlue Swirl2010-02-141-2/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* sparc64: use PCI accessors for APB/PBMBlue Swirl2010-02-141-11/+15
| | | | | | | | | | Remove useless set to zero lines. Latency programming should be done by BIOS, reset value is zero. Add revision to APB, don't enable PCI_COMMAND_MASTER and set status according to APB specification. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Remove conditional rom loading supportBlue Swirl2010-02-143-9/+0
| | | | | | | | Commit c2039bd0ffce8807e0eaac55254fde790825fa92 made rom loading automatic for non-PC architectures. Remove now mostly unused conditional rom loading support. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pci: fix info pci with host bridge.Isaku Yamahata2010-02-131-3/+3
| | | | | | | | | | | This patch fixes 525e05147d5a3bdc08caa422d108c1ef71b584b5. pci host bridge doesn't have header type of bridge. The check should be by header type, instead of pci class device. Cc: Blue Swirl <blauwirbel@gmail.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Merge branch 'for_anthony' of ↵Blue Swirl2010-02-131-1/+1
|\ | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/mst/qemu * 'for_anthony' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/qemu: pci: fix pci_find_bus()
| * pci: fix pci_find_bus()Isaku Yamahata2010-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | typo in c021f8e65f5009a5ab5711d9d5326fcab553ef1c. comparison fix. Cc: Blue Swirl <blauwirbel@gmail.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | ide: add topology supportChristoph Hellwig2010-02-101-0/+2
| | | | | | | | | | | | | | | | Export the physical block size in the ATA IDENTIFY command. The other topology values are not supported in ATA so skip them. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | scsi: add topology supportChristoph Hellwig2010-02-101-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Export the physical block size in the READ CAPACITY (16) command, and add the new block limits VPD page to export the minimum and optiomal I/O sizes. Note that we also need to bump the scsi revision level to SPC-2 as that is the minimum requirement by at least the Linux kernel to try READ CAPACITY (16) first and look at the block limits VPD page. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | virtio-blk: add topology supportChristoph Hellwig2010-02-102-0/+12
| | | | | | | | | | | | | | | | Export all topology information in the block config structure, guarded by a new VIRTIO_BLK_F_TOPOLOGY feature flag. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | block: add topology qdev propertiesChristoph Hellwig2010-02-1012-73/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add three new qdev properties to export block topology information to the guest. This is needed to get optimal I/O alignment for RAID arrays or SSDs. The options are: - physical_block_size to specify the physical block size of the device, this is going to increase from 512 bytes to 4096 kilobytes for many modern storage devices - min_io_size to specify the minimal I/O size without performance impact, this is typically set to the RAID chunk size for arrays. - opt_io_size to specify the optimal sustained I/O size, this is typically the RAID stripe width for arrays. I decided to not auto-probe these values from blkid which might easily be possible as I don't know how to deal with these issues on migration. Note that we specificly only set the physical_block_size, and not the logial one which is the unit all I/O is described in. The reason for that is that IDE does not support increasing the logical block size and at last for now I want to stick to one meachnisms in queue and allow for easy switching of transports for a given backing image which would not be possible if scsi and virtio use real 4k sectors, while ide only uses the physical block exponent. To make this more common for the different block drivers introduce a new BlockConf structure holding all common block properties and a DEFINE_BLOCK_PROPERTIES macro to add them all together, mirroring what is done for network drivers. Also switch over all block drivers to use it, except for the floppy driver which has weird driveA/driveB properties and probably won't require any advanced block options ever. Example usage for a virtio device with 4k physical block size and 8k optimal I/O size: -drive file=scratch.img,media=disk,cache=none,id=scratch \ -device virtio-blk-pci,drive=scratch,physical_block_size=4096,opt_io_size=8192 aliguori: updated patch to take into account BLOCK events Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | virtio-blk: revert serial number supporthch@lst.de2010-02-102-64/+3
| | | | | | | | | | | | | | | | | | | | The addition of the whole ATA IDENTIY page caused the config space to go above the allowed size in the PCI spec, and thus the feature was already reverted in the Linux guest driver and disabled by default in qemu. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Monitor: remove unneeded checksLuiz Capitulino2010-02-101-1/+0
| | | | | | | | | | | | | | | | It's not needed to check the return of qobject_from_jsonf() anymore, as an assert() has been added there. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | virtio-net: fix network stall under loadTom Lendacky2010-02-101-1/+9
| | | | | | | | | | | | | | | | | | Fix a race condition where qemu finds that there are not enough virtio ring buffers available and the guest make more buffers available before qemu can enable notifications. Signed-off-by: Tom Lendacky <toml@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | segfault due to buffer overrun in usb-serialDavid S. Ahern2010-02-101-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | This fixes a segfault due to buffer overrun in the usb-serial device. The memcpy was incrementing the start location by recv_used yet, the computation of first_size (how much to write at the end of the buffer before wrapping to the front) was not accounting for it. This causes the next element after the receive buffer (recv_ptr) to get overwritten with random data. Signed-off-by: David Ahern <daahern@cisco.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | audio streaming from usb devicesDavid S. Ahern2010-02-101-12/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have streaming audio devices working within qemu-kvm. This is a port of the changes to qemu. Streaming audio generates a series of isochronous requests that are repetitive and time sensitive. The URBs need to be submitted in consecutive USB frames and responses need to be handled in a timely manner. Summary of the changes for isochronous requests: 1. The initial 'valid' value is increased to 32. It needs to be higher than its current value of 10 since the host adds a 10 frame delay to the scheduling of the first request; if valid is set to 10 the first isochronous request times out and qemu cancels it. 32 was chosen as a nice round number, and it is used in the path where a TD-async pairing already exists. 2. The token field in the TD is *not* unique for isochronous requests, so it is not a good choice for finding a matching async request. The buffer (where to write the guest data) is unique, so use that value instead. 3. TD's for isochronous request need to be completed in the async completion handler so that data is pushed to the guest as soon as it is available. The uhci code currently attempts to process complete isochronous TDs the next time the UHCI frame with the request is processed. The results in lost data since the async requests will have long since timed out based on the valid parameter. Increasing the valid value is not acceptable as it introduces a 1+ second delay in the data getting pushed to the guest. 4. The frame timer needs to be run on 1 msec intervals. Currently, the expire time for the processing the next frame is computed after the processing of each frame. This regularly causes the scheduling of frames to shift in time. When this happens the periodic scheduling of the requests is broken and the subsequent request is seen as a new request by the host resulting in a 10 msec delay (first isochronous request is scheduled for 10 frames from when the URB is submitted). [ For what's worth a small change is needed to the guest driver to have more outstanding URBs (at least 4 URBs with 5 packets per URB).] Signed-off-by: David Ahern <daahern@cisco.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | virtio-blk: Generate BLOCK_IO_ERROR QMP eventLuiz Capitulino2010-02-101-1/+5
| | | | | | | | | | | | | | Just call bdrv_mon_event() in the right place. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | scsi: Generate BLOCK_IO_ERROR QMP eventLuiz Capitulino2010-02-101-1/+5
| | | | | | | | | | | | | | Just call bdrv_mon_event() in the right place. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | ide: Generate BLOCK_IO_ERROR QMP eventLuiz Capitulino2010-02-101-1/+5
| | | | | | | | | | | | | | Just call bdrv_mon_event() in the right place. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | sh7750: handle MMUCR TI bitAurelien Jarno2010-02-091-2/+5
| | | | | | | | | | | | | | When the MMUCR TI bit is set, all the UTLB and ITLB entries should be flushed. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | Merge remote branch 'qemu-kvm/uq/master' into staging-tmpAnthony Liguori2010-02-081-0/+3
|\ \
| * | KVM: Make vmport KVM-compatibleJan Kiszka2010-02-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | The vmport "device" accesses the VCPU registers, so it requires proper cpu_synchronize_state. Add it to vmport_ioport_read, which also synchronizes vmport_ioport_write. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* | | SH4/R2D: fix poweroffAurelien Jarno2010-02-081-4/+5
| |/ |/| | | | | | | | | | | The write the the PA_POWOFF register is currently ignored. Fix that by calling qemu_system_shutdown_request() when a poweroff is requested. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | dec: actually implement PCI bridgingBlue Swirl2010-02-072-0/+28
| | | | | | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | esp: use CamelCaseFunc for function typesBlue Swirl2010-02-072-7/+7
| | | | | | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | fw_cfg: don't use reserved _ prefixBlue Swirl2010-02-072-3/+3
| | | | | | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | fdc: don't use reserved _ prefixBlue Swirl2010-02-071-6/+6
| | | | | | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | fdc: don't use reserved _t suffixBlue Swirl2010-02-074-192/+190
| | | | | | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | escc: don't use reserved _t suffixBlue Swirl2010-02-071-4/+4
| | | | | | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | m48t59: don't use reserved _t suffixBlue Swirl2010-02-075-55/+52
| | | | | | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Do not use dprintfmalc2010-02-074-91/+91
| | | | | | | | | | | | | | | | | | dprintf is already claimed by POSIX[1], and on at least one system is implemented as a macro [1] http://www.opengroup.org/onlinepubs/9699919799/functions/dprintf.html Signed-off-by: malc <av1474@comtv.ru>
* | mips/malta: fix typoAurelien Jarno2010-02-061-1/+1
| | | | | | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | PCI: show also host bridge data in "info pci" outputBlue Swirl2010-02-061-1/+1
| | | | | | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | PCI: fix multiple bridge problemsBlue Swirl2010-02-061-11/+17
| | | | | | | | | | | | | | | | | | When several PCI bridges were in use, monitor command "info pci" would enter into infinite loop. Buses behind the bridge were not discoverable because secondary and subordinate bus numbers were not used properly. Other buses were not found because bus search terminated on first miss. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Refactor DEC 21154 PCI bridgeBlue Swirl2010-02-053-106/+84
|/ | | | | | | It's currently not used by PPC machines. Refactor so that also Sparc64 machines can use it. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qdev: Add rudimentary help for property valueMarkus Armbruster2010-02-031-1/+1
| | | | | | | | This provides the same information as reverted commit 2ba6edf0. Not much, just better than nothing. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: Add help for device propertiesMarkus Armbruster2010-02-031-1/+14
| | | | | | | | | | | Option "-device DRIVER,?" and monitor command "device_add DRIVER,?" print the supported properties instead of creating a device. The former also terminates the program. This is commit 2ba6edf0 (just reverted) done right. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "qdev: Add help for device properties"Markus Armbruster2010-02-031-13/+2
| | | | | | | | | | | | | | | | | This reverts commit 2ba6edf0dd740166632df80caa85992b20791a68. The commit has two issues: * When it runs from the monitor, e.g. "device_add e1000,?", it prints to stderr instead of the monitor. * Help looks to callers just like failed device creation. This makes main() exit unsuccessfully on "-device e1000,?". We need to do this differently. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "qdev: Add help for property value"Markus Armbruster2010-02-031-7/+2
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 922910ce42d15bdb7c2347436b1b5798b5401de4. The commit has four issues: * When it runs from the monitor, e.g. "device_add e1000,mac=?", it prints to stderr instead of the monitor. * Help looks to callers just like failed device creation. This makes main() exit unsuccessfully on "-device e1000,mac=?". * It has an undocumented side effect on -global: "-global e1000.mac=?" prints help, but only when we actually add an e1000 device. * It does not work for properties that accept the value "?". We need to do this differently. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: Fix exit code for -device ?Markus Armbruster2010-02-032-9/+20
| | | | | | | | | | | | Help was shoehorned into device creation, qdev_device_add(). Since help doesn't create a device, it returns NULL, which looks to callers just like failed device creation. Monitor handler do_device_add() doesn't care, but main() exits unsuccessfully. Move help out of device creation, into new qdev_device_help(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sparc64: implement basic IOMMU/interrupt handlingBlue Swirl2010-01-301-22/+142
| | | | | | Also add reset control. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc64: byte swap IO port accessBlue Swirl2010-01-291-4/+4
| | | | | | This requires an updated OpenBIOS image. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* virtio-blk: Fix error cases which ignored rerror/werrorKevin Wolf2010-01-291-2/+2
| | | | | | | | If an I/O request fails right away instead of getting an error only in the callback, we still need to consider rerror/werror. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-blk: Fix restart after read errorKevin Wolf2010-01-291-2/+9
| | | | | | | | | Current code assumes that only write requests are ever going to be restarted. This is wrong since rerror=stop exists. Instead of directly starting writes, use the same request processing as used for new requests. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio_blk: Factor virtio_blk_handle_request outKevin Wolf2010-01-291-32/+46
| | | | | | | | We need a function that handles a single request. Create one by splitting out code from virtio_blk_handle_output. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* cirrus: Properly re-register cirrus_linear_io_addr on vram unmapJan Kiszka2010-01-291-2/+4
| | | | | | | | | | | | This fixes CONFIG_FB_CIRRUS for Linux guests and probably much more: When switching away from linearly mapped vram, we also have to restore the I/O handlers for the LFB. This regression was once introduced by commit 2bec46dc97. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-serial-bus: Fix bus initialisation and allow for bus identificationAmit Shah2010-01-291-2/+1
| | | | | | | | | | | | This commit enables one to use multiple virtio-serial devices and to assign ports to arbitrary devices like this: -device virtio-serial,id=foo -device virtio-serial,id=bar \ -device virtserialport,bus=foo.0,name=foo \ -device virtserialport,bus=bar.0,name=bar Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sparc64: reimplement tick timers v4Igor V. Kovalenko2010-01-271-33/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | sparc64 timer has tick counter which can be set and read, and tick compare value used as deadline to fire timer interrupt. The timer is not used as periodic timer, instead deadline is set each time new timer interrupt is needed. v3 -> v4: - coding style v2 -> v3: - added missing timer debug output macro - CPUTimer struct and typedef moved to cpu.h - change CPU_SAVE_VERSION to 6, older save formats not supported v1 -> v2: - new conversion helpers cpu_to_timer_ticks and timer_to_cpu_ticks - save offset from clock source to implement cpu_tick_set_count - renamed struct sun4u_timer to CPUTimer - load and save cpu timers v0 -> v1: - coding style Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pflash: Buffer block writesEdgar E. Iglesias2010-01-271-3/+9
| | | | | | | | Buffer block writes to avoid flushing every word access onto backing storage device. This significantly speeds up flash emulation for flashes connected through an 8 or 16-bit bus combined with backing storage (-pflash). Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
OpenPOWER on IntegriCloud