hd-geometry: Move disk geometry guessing back from block.c
Commit f3d54fc4 factored it out of hw/ide.c for reuse. Sensible,except it was put into block.c. Device-specific functionality shouldbe kept in device code, not the block layer. Move it tohw/hd-geometry.c, and make stylistic changes required to keep...
hd-geometry: Add tracepoints
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hd-geometry: Unnest conditional in hd_geometry_guess()
hd-geometry: Factor out guess_chs_for_size()
hd-geometry: Clean up gratuitous goto in hd_geometry_guess()
fdc: Move floppy geometry guessing back from block.c
Commit 5bbdbb46 moved it to block.c because "other geometry guessingfunctions already reside in block.c". Device-specific functionalityshould be kept in device code, not the block layer. Move it back....
Merge branch 'trivial-patches' of git://github.com/stefanha/qemu
vga: Implement blinking of text cursor
Let the text cursor blink at 1.875 Hz, the original VGA cursorfrequency. No timer is used, instead we rely on the fact that thedisplay is updated periodically.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hw/sh_serial: Use TARGET_PRIxPHYS rather than %x for physaddr
Switch a format string from %x to TARGET_PRIxPHYS so that it willcontinue to work even if target_phys_addr_t is changedto 64 bits in the future.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
hw/omap.h: Use TARGET_PRIxPHYS to define OMAP_FMT_plx
Use the new TARGET_PRIxPHYS macro to avoid the need to define anOMAP_FMT_plx macro whose expansion depends directly onTARGET_PHYS_ADDR_BITS.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Acked-by: Andreas Färber <afaerber@suse.de>...
esp: add AMD PCscsi emulation (PCI SCSI adapter)
The PCI version is supported in lots of Operating Systems,and has been successfully tested on:- MS DOS 6.22 (using DC390 driver)- MS Windows 3.11 (using DC390 driver)- MS Windows 98 SE (using default driver)...
pci: add some stubs
Cc: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
esp: use trace framework instead of stderr output
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
esp: split esp code into generic chip emulation and sysbus layer
esp: use hba_private field instead of a complex cast
esp: support future change of chip_id
esp: implement Reset ATN command
esp: implement Disable selection command
esp: delay Transfer Information command if dma is not enabled
The same mechanism is already in place for some select commands.
esp: execute select commands immediately when it is a non-dma command
megasas: mark mfi_frame_desc as 'static'
Suggested by blue swirl. Patch is on top of Paolo'sscsi-next tree.
Signed-off-by: Hannes Reinecke <hare@suse.de>Cc: Paolo Bonzini <pbonzini@redhat.com>Cc: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw/imx_avic.c: Avoid format error when target_phys_addr_t is 64 bits
Add a missing cast to avoid gcc complaining about format stringerrors when printing an expression based on a target_phys_addr_t.
Merge remote-tracking branch 'mjt/mjt-iov2' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'kraxel/usb.55' into staging
Merge remote-tracking branch 'bonzini/scsi-next' into staging
fdc: rewrite seek and DSKCHG bit handling
This bit is cleared on every successful seek to a different track (cylinder).The seek is also called on revalidate or on read/write/format commands whichalso clear the DSKCHG bit.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>...
fdc: fix interrupt handling
If you call the SENSE INTERRUPT STATUS command while there is no interruptwaiting you get as result unknown command.
Fixed status0 register handling for read/write/format commands.
fdc: Drop broken code for user-defined floppy geometry
bdrv_get_floppy_geometry_hint() fails to store through its parameterdrive when bs has a geometry hint. Makes fd_revalidate() assignrandom crap to drv->drive.
Has been broken that way for ages. Harmless, because:...
usb: fix interface initialization
zero is a valid interface number, so don't use it when resetting theendpoints.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-host: add trace events for iso xfers
Replace iso transfer fprintf's with trace points. Also rename existingtracepoints so they all match usb_host_iso_*.
usb-ehci: Fix an assert whenever isoc transfers are used
hcd-ehci.c is missing an usb_packet_init() call for the ipacket UsbPacketit uses for isoc transfers, triggering an assert (taking the entire vm down)in usb_packet_setup as soon as any isoc transfers are done by a high speed...
ehci: Kick async schedule on wakeup in the non companion case
Commit 0f588df8b3688b00e77aabaa32e26ece5f19bd39, added codeto ehci_wakeup to kick the async schedule on wakeup, but the elsewas positioned wrong making it trigger for devices which are routed...
usb-redir: Correctly handle the usb_redir_babble usbredir status
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: split endpoint init and reset
Create a new usb_ep_reset() function to reset endpoint state, withoutre-initialiting the queues, so we don't unlink in-flight packets justbecause usb-host has to re-parse the descriptor tables.
ehci: don't flush cache on doorbell rings.
Commit 4be23939ab0d7019c7e59a37485b416fbbf0f073 makes ehci instantlyzap any unlinked queue heads when the guest rings the doorbell.
While hacking up uas support this turned out to be a problem. The linuxkernel can unlink and instantly relink the very same queue head, thereby...
ehci: fix ehci_qh_do_overlay
Use ehci_flush_qh to make sure we touch inly the fields the hc isallowed to touch.
ehci: fix td writeback
Only write back the dwords the hc is supposed to update. Should notmake a difference in theory as the guest must not touch the td whileit is active to avoid races. But it is still more correct.
hw/cadence_gem: Make rx_desc_addr and tx_desc_addr uint32_t
Make the state fields rx_desc_addr and tx_desc_addr uint32_t;this matches the VMStateDescription, and also conforms to howhardware works: the registers don't magically become largerif the device is attached to a CPU with a larger physical...
i.MX31: Interrupt Controller
Implement the Freescale i.MX31 advanced vectored interrupt controller, at leastto the extent it is used by Linux 3.x
Vectors are not implemented.
Signed-off-by: Philip O'Sullivan <philipo@ok-labs.com>Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au>...
i.MX31: KZM-ARM11-01 evaluation board
Board support for Kyoto Micro's KZM-ARM11-01, an evaluation board builtaround the Freescale i.MX31.
Signed-off-by: Philip O'Sullivan <philipo@ok-labs.com>Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
i.MX: UART support
Implement the Freescale i.MX UART. This uart is used in a variety ofSoCs, including some by Motorola, as well as in the Freescale i.MXseries.
This patch gives only a `bare-bones' implementation, enough to run Linuxor OKL4, but that's about it....
i.MX31: Clock Control Module
For Linux to be able to work out how fast its clocks are going, sothat timer ticks come approximately at the right time, it needs tobe able to query the clock control module (CCM).
This is the start of a CCM implementation. It currently knows only about...
i.MX31: Timers
Implement the timers on the Freescale i.MX31 SoC.This is not a complete implementation, but gives enough forLinux to boot and run. In particular external triggers, which arenot useful under QEMU, are not implemented.
Signed-off-by: Philip O'Sullivan <philipo@ok-labs.com>...
hw/exynos4210.c: Fix misleading initialization of IROM mirror
We want to mirror whole IROM and should pass zero instead ofEXYNOS4210_IROM_BASE_ADDR (though it equals to zero too) sincememory_region_init_alias takes an offset within an originalregion as an argument....
Exynos4: add RTC device
Signed-off-by: Oleg Ogurtsov <o.ogurtsov@samsung.com>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/exynos4210_pwm.c: Fix STOP status in tick handler.
START/STOP bit was not cleaned correctly.
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
ARM: hw/exynos4210_mct.c: Fix a bug which hangs Linux kernel.
After some long period of time Linux kernel hanged due toptimer_get_count may return 0 before timer interrupt occurs,thus, causing FRC to jump back in time
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>...
virtio-scsi: do not crash on adding buffers to the event queue
The event queue is not supported yet and the handler does nothave to do much anyway when buffers are added. However, thehandler is called unconditionally by the virtio layer, and thisresults in a crash as soon as buffers are added to the event...
scsi: Fix data length == SCSI_SENSE_BUF_SIZE
Fix the edge case where the sense data length is exactly the sameas SCSI_SENSE_BUF_SIZE.This makes SCSI requests work that use all of the available 95 bytesense data.
Signed-off-by: Christian Hoff <christian.hoff@de.ibm.com>...
scsi: Fix LOAD_UNLOAD
Change operation code of LOAD_UNLOAD command to 0x1b as described insection 7.3 of the SCSI Stream Commands spec.
Signed-off-by: Christian Hoff <christian.hoff@de.ibm.com>Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>...
scsi: Ensure command and transfer lengths are set for all SCSI devices
scsi-generic relies on those values to be correct, so it is important thatthose values are initialized properly for all device types.
Reported-by: Christian Hoff <christian.hoff@de.ibm.com>...
scsi: Add basic support for SCSI media changer commands.
This adds basic support for SCSI media changer commands.Not all commands are supported as of now, but enough to coverbasic functionality.
scsi: Fix transfer length for READ POSITION commands.
The transfer length depends on the specific service actioncode, as defined in the SCSI stream commands spec section 7.7.Up to now only the extended form was supported.
megasas: LSI Megaraid SAS HBA emulation
This patch adds an emulation for the LSI Megaraid SAS 8708EM2 HBA.I've tested it to work with Linux, Windows Vista, and Windows7.
Signed-off-by: Hannes Reinecke <hare@suse.de>[ Squashed trivial changes from Andreas Faerber, rebased over IOMMU...
scsi: add a qdev property for the disk's WWN
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
atapi: implement READ DISC INFORMATION
This command is not necessary for CD-ROM and DVD-ROM, but some versions ofudev trip on its absence.
Cc: Kevin Wolf <kwolf@redhat.com>Cc: Markus Armbruster <armbru@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scsi-disk: implement READ DISC INFORMATION
ISCSI: Add SCSI passthrough via scsi-generic to libiscsi
Update iscsi to allow passthrough of SG_IO scsi commands when the iscsidevice is forced to be scsi-generic.
Implement both bdrv_ioctl() and bdrv_aio_ioctl() in the iscsi backend,emulate the SG_IO ioctl and pass the SCSI commands across to the...
megasas: Add header file
This patch adds the header file for megasas.
Signed-off-by: Hannes Reinecke <hare@suse.de>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scsi: simplify handling of the VPD page length field
The last four bytes of the thin provisioning page were cut out.
iommu: Allow PCI to use IOMMU infrastructure
This patch adds some hooks to let PCI devices and busses use the new IOMMUinfrastructure. When IOMMU support is enabled, each PCI device nowcontains a DMAContext * which is used by the pci_dma_*() wrapper functions....
pseries: Implement IOMMU and DMA for PAPR PCI devices
Currently the pseries machine emulation does not support DMA for emulatedPCI devices, because the PAPR spec always requires a (guest visible,paravirtualized) IOMMU which was not implemented. Now that we have...
Better support for dma_addr_t variables
A while back, we introduced the dma_addr_t type, which is supposed tobe used for bus visible memory addresses. At present, this is analias for target_phys_addr_t, but this will change when we eventuallyadd support for guest visible IOMMUs....
iommu: Add universal DMA helper functions
Not that long ago, every device implementation using DMA directlyaccessed guest memory using cpu_physical_memory_*(). This meant thatadding support for a guest visible IOMMU would require changing everyone of these devices to go through IOMMU translation....
usb-ohci: Use universal DMA helper functions
The OHCI device emulation can provide both PCI and SysBus OHCIimplementations. Because of this, it was not previously converted touse the PCI DMA helper functions.
This patch converts it to use the new universal DMA helper functions....
iommu: Make sglists and dma_bdrv helpers use new universal DMA helpers
dma-helpers.c contains a number of helper functions for doingscatter/gather DMA, and various block device related DMA. Currently,these directly access guest memory using cpu_physical_memory_*(),...
ide/ahci: Use universal DMA helper functions
The AHCI device can provide both PCI and SysBus AHCI deviceemulations. For this reason, it wasn't previously converted to usethe pci_dma_*() helper functions. Now that we have universal DMAhelper functions, this converts AHCI to use them....
usb: Convert usb_packet_{map, unmap} to universal DMA helpers
The USB UHCI and EHCI drivers were converted some time ago to use thepci_dma_*() helper functions. However, this conversion was not completebecause in some places both these drivers do DMA via the usb_packet_map()...
iommu: Introduce IOMMU emulation infrastructure
This patch adds the basic infrastructure necessary to emulate an IOMMUvisible to the guest. The DMAContext structure is extended withinformation and a callback describing the translation, and the various...
pseries: Convert sPAPR TCEs to use generic IOMMU infrastructure
The pseries platform already contains an IOMMU implementation, since it isessential for the platform's paravirtualized VIO devices. This IOMMUsupport is currently built into the implementation of the VIO "bus" and...
rtl8139: validate rx ring before receiving packets
Commit ff71f2e8cacefae99179993204172bc65e4303df prevent the possiblecrash during initialization of linux driver by checking the operatingmode.This seems too strict as:
- the real card could still work in mode other than normal...
qdev: fix use-after-free in the error path of qdev_init_nofail
From Markus:
Before:
$ qemu-system-x86_64 -display none -drive if=ide qemu-system-x86_64: Device needs media, but drive is empty qemu-system-x86_64: Initialization of device ide-hd failed...
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'spice/spice.v58' into staging
Merge remote-tracking branch 'sstabellini/compile-xs' into staging
Merge remote-tracking branch 'sstabellini/xen-pt' into staging
Merge remote-tracking branch 'kraxel/usb.54' into staging
Merge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf
Merge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
Merge branch 's390-for-upstream' of git://repo.or.cz/qemu/agraf
Merge branch 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
PPC: BookE: Implement EPR SPR
On the e500 series, accessing SPR_EPR magically turns into an access atthat CPU's IACK register on the MPIC. Implement that logic to get kernelsthat make use of that feature work.
Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: e500: Refactor serial dt generation
When generating serial port device tree nodes, we duplicate quite a bitof code, because there are 2 of them in the mpc8544ds board we emulate.
Shove the generating code into a function, so we duplicate less code....
PPC: e500: allow users to set the /compatible property via -machine
Device trees usually have a node /compatible, which indicate which machinetype we're looking at. For quick prototyping, it can be very useful to changethe contents of that node via the command line....
uImage: increase the gzip load size
Recent u-boot has different defines for its gzip extract buffer, but thecommon ground seems to be 64MB. So let's bump it up to that, enabling meto load my test image again ;).
PPC: e500: Use new MPIC dt format
Due to popular demand, we're updating the way we generate the MPICnode and interrupt lines based on what the current state of art is.
Requested-by: Scott Wood <scottwood@freescale.com>Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: e500: Use new SOC dt format
Due to popular demand, let's clean up the soc node a bit and usemore recent dt notions.
PPC: e500: Define addresses as always 64bit
Every time we use an address constant, it needs to potentially fit intoa 64bit physical address space. So let's define things accordingly.
PPC: e500: Extend address/size of / to 64bit
We want to be able to support >= 4GB of RAM. To do so, we need to be ableto tell the guest OS how much RAM it has.
However, that information today is capped to 32bit. So let's extend theoffset and size fields to 64bit, so we can fit in big addresses and even...
PPC: e500: dt: use 64bit cell helper
We have a nice 64bit helper to ease the device tree generation andmake the code more readable when creating 64bit 2-cell parameters.Use it when generating the device tree.
PPC: e500: dt: use target_phys_addr_t for ramsize
We're passing the ram size as uint32_t, capping it to 32 bits atm.Change to target_phys_addr_t (uint64_t) to make sure we have allthe bits.
PPC: e500: enable manual loading of dtb blob
We want to be able to override the automatically created device treeby using the -dtb option. Implement this for the mpc8544ds machine.
PPC: e500: dt: create /soc8544 node dynamically
PPC: e500: dt: create serial nodes dynamically
PPC: e500: dt: create mpic node dynamically
PPC: e500: dt: create global-utils node dynamically
PPC: e500: dt: create pci node dynamically
PPC: e500: dt: start with empty device tree
Now that all of the device tree bits are generated during runtime, wecan get rid of the device tree blob and instead start from scratch withan empty device tree.
dt: Add -machine dumpdtb option to dump the current dtb
Now that we are dynamically creating the dtb, it's really useful tobe able to dump the created blob for debugging.
This patch implements a -machine dumpdtb=<file> option for e500 thatdumps the dtb exactly in the form the guest would get it to disk. It...