uhci: Add a completions_only flag for async completions
Add a completions_only flag, and set this when running process_frame for asynccompletion handling, this fixes 2 issues in a single patch:
1) It makes sure async completed packets get written to guest mem immediately,...
uhci: Don't allow the guest to set port-enabled when there is no dev connected
It is possible for device disconnect and the guest trying to reset the port(because of USB xact errors prior to the disconnect getting signaled) to race,when we hit this race, the guest will write the port-control register with its...
uhci: Fix double unlink
uhci_async_cancel() already does a uhci_async_unlink().
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-bt: Return NAK instead of STALL when interrupt ep has no data
I noticed this while making all devices with interrupt endpoints properlydo wakeup. While at it also add wakeup support.
Note that I've not tested this, but returning STALL for an interrupt ep...
usb-smartcard-reader: Properly NAK interrupt eps when we've no events
When we've no data to return from the interrupt endpoint, return NAK ratherthen a 0 length packet.
CC: Alon Levy <alevy@redhat.com>Signed-off-by: Hans de Goede <hdegoede@redhat.com>...
usb-redir: Split usb_handle_interrupt_data into separate in/out functions
No functional changes.
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'kraxel/usb.71' into staging
Merge remote-tracking branch 'amit/loadvm-irq-inj-fix' into staging
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'afaerber/qom-cpu' into staging
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
Merge branch 'vga.1' of git://git.kraxel.org/qemu
virtio-rng-pci: create a default backend if none exists
This allows you to specify:
$ qemu -device virtio-rng-pci
And things will Just Work with a reasonable default.
virtio-rng: hardware random number generator device
The Linux kernel already has a virtio-rng driver, this is the deviceimplementation.
When the guest asks for entropy from the virtio hwrng, it puts a bufferin the vq. We then put entropy into that buffer, and push it back to...
virtio-rng: add rate limiting support
This adds parameters to virtio-rng-pci to allow rate limiting the entropy aguest receives. An example command line:
$ qemu -device virtio-rng-pci,max-bytes=1024,period=1000
Would limit entropy collection to 1Kb/s....
usb: host-linux: Ignore parsing errors of the device descriptors
The Linux is more tolerant here as well: Just stop parsing the devicedescriptors when an error is detected but do not reset what was foundso far. This allows to run buggy devices with partially invalid...
ehci: Don't access packet after freeing it
ehci_state_writeback() will free the packet, so we should not accessthe packet after calling ehci_state_writeback().
ehci: Fixup q->qtdaddr after cancelling an already completed packet
This avoids the q->qtdaddr == p->qtdaddr asserts we have triggering, whena queue contains multiple completed packages when we cancel the queue.
I triggered this with windows7 + async interrupt endpoint handling (*)...
ehci: Better detection for qtd-s linked in circles
Windows links interrupt qtd-s in circles, which means that when interruptendpoints return USB_RET_ASYNC, combined with the recent"ehci: Retry to fill the queue while waiting for td completion" patch,we keep adding the tds to the queue over and over again, as we detect the...
ehci: Don't verify the next pointer for periodic qh-s and qtd-s
While testing the move to async packet handling for interrupt endpoints Inoticed that Windows-XP likes to play tricks with the next pointer forperiodic qh-s, so we should not fail qh / qtd verification when it changes....
ehci: keep the frame timer running in case the guest asked for frame list rollover interrupts
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ehci: handle dma errors
Starting with commit 1c380f9460522f32c8dd2577b2a53d518ec91c6d dmatransfers can actually fail. This patch makes ehci keep trackof the busmaster bit in pci config space, by setting/clearing thedma_context pointer. Attempts to dma without context will result...
usb-redir: Only add actually in flight packets to the in flight queue
Packets which are queued up, but not yet handed over to the device, arenot in flight.
usb-redir: Set default debug level to warning
The previous default of 0 means that even errors and warnings would notget printed, which is really not a good default.
usb-host: update tracing
Now that we have separate status and length fields in USBPacketupdate the completion tracepoint to log both.
usb-host: fix splitted transfers
USBPacket->actual_length wasn't updated correctly for USBPacketssplitted into multiple urbs. Fix it.
vga: fix mmio vga register mapping
vga: fix bochs alignment issue
The bochs dispi interface traditionally uses port 0x1ce as 16bit indexregister and port 0x1cf as 16bit data register. The later is unaligned,and probably for that reason the the data register was moved to 0x1d0for non-x86 archs....
fix live migration
Commit 1c380f9460522f32c8dd2577b2a53d518ec91c6d breaks live migration.DMA stops working for ehci (and probably for any pci device) afterrestoring the guest because the bus master region never gets enabled.Add code doing that after loading the pci config space from vmstate....
usb: Fix (another) bug in usb_packet_map() for IOMMU handling
Elements in qemu SGLists can cross IOMMU page boundaries. So, in commit39c138c8420f51a7da7b35233a8d7400a0b589ac "usb: Fix usb_packet_map() in thepresence of IOMMUs", I changed usb_packet_map() to split up each SGList...
usb-host: scan for usb devices when the vm starts
Commit a844ed842d9a9d929645c09ae0f52f753d7a02e0 leads to usb-hostdetecting devices not right after qemu startup because the guestisn't running yet. Instead they are found on the first of theregular usb device poll runs. Which is too late for seabios to see...
virtio-serial-bus: post_load send_event when vm is running
Alexander Larsson found irq injection to Windows guests stopped after amigration. The symptom was the mouse stopped working.
Reproduction steps are:1. On src, start qemu with a virtio-serial port without any backend...
mips/malta: fix CBUS UART interrupt pin
According to the MIPS Malta Developement Platform User's Manual, thei8259 interrupt controller is supposed to be connected to the hardwareIRQ0, and the CBUS UART to the hardware interrupt 2.
In QEMU they are both connected to hardware interrupt 0, the CBUS UART...
qdev: Split up header so it can be used in cpu.h
Header file dependency is a frickin' nightmare right now. cpu.h tendsto get included in our 'include everything' header files but qdev alsoneeds to include those headers mainly for qdev-properties since it knows...
Move qemu_irq typedef out of qemu-common.h
It's necessary for making CPU child of DEVICE withoutcausing circular header deps.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>[ehabkost: re-added the typedef to hw/irq.h after rebasing]Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>...
acpi_piix4: fix migration of gpe fields
Migrate 16 bytes for en/sts fields (which is the correct size),increase version to 3, and document how to support incomingmigration from qemu-kvm 1.2.
Acked-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
megasas: Use bdrv_drain_all instead of qemu_aio_flush
Calling qemu_aio_flush() directly can hang when combined with I/Othrottling.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>
fdc: use status0 field instead of a local variable
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
fdc: fix FD_SR0_SEEK for non-DMA transfers and multi sectors transfers
On non-DMA transfers, fdctrl_stop_transfer() used to set FD_SR0_SEEKno matter if there actually was a seek or not. This is obviously wrong.
fdctrl_seek_to_next_sect() has this information because it performs...
fdc: fix FD_SR0_SEEK for initial seek on DMA transfers
fdctrl_start_transfer() used to set FD_SR0_SEEK no matter ifthere actually was a seek or not. This is obviously wrong.
fdctrl_start_transfer() has this information because it performsthe initial seek itself....
fdc: fix false FD_SR0_SEEK
Do not always set FD_SR0_SEEK, as callers already set it if needed.
fdc: implement VERIFY command
VERIFY command is like a READ command, except that read data is nottransfered by DMA.As DMA engine is not used, so we have to start data transfer ourselves.
fdc: remove double affectation of FD_MSR_CMDBUSY flag
FD_MSR_CMDBUSY flag is already set in fdctrl_write_data(), justbefore calling the command handler (fdctrl_start_transfer() here).
fdc: fix typo in zero constant
fdc: remove last usage of FD_STATE_SEEK
Replace it by directly setting FD_SR0_SEEK if required
aio: rename AIOPool to AIOCBInfo
Now that AIOPool no longer keeps a freelist, it isn't really a "pool" anymore. Rename it to AIOCBInfo and make it const since it no longerneeds to be modified.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
fdc: Remove status0 parameter from fdctrl_set_fifo()
It decided whether an interrupt is triggered. Only one caller made useof this functionality, so move the code there.
In this one caller, the interrupt must actually be triggeredunconditionally, like it was before commit 2fee0088. For example, a...
Merge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-1.3.0-rc0' into staging
vfio-pci: KVM INTx accel & common msi_get_message
Merge remote-tracking branch 'bonzini/scsi-next' into staging
Merge remote-tracking branch 'kraxel/usb.70' into staging
Merge remote-tracking branch 'spice/spice.v63' into staging
vfio-pci: Add KVM INTx acceleration
This makes use of the new level irqfd support enabling bypass of qemuuserspace both on INTx injection and unmask. This significantlyboosts the performance of devices making use of legacy interrupts (ex.~60% better netperf TCP_RR scores for an e1000e assigned to a Linux...
vfio-pci: Use common msi_get_message
We can get rid of our local version now that a helper exists.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
dma: Define dma_context_memory and use in sysbus-ohci
Define a new global dma_context_memory which is a DMAContext correspondingto the global address_space_memory AddressSpace. This can be used bysysbus peripherals like sysbus-ohci which need to do DMA....
virtio-scsi: use dma_context_memory
Until address_space_rw was introduced, NULL was accepted as aplaceholder for DMA with no IOMMU (to address_space_memory).
This does not work anymore, and dma_context_memory needs tobe specified explicitly.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
megasas: Correct target/lun mapping
The structure to reference a logical drive has an unused field,which can be used to carry the lun ID. This enabled seabios toestablish the proper target/LUN mapping.
Cc: Paolo Bonzini <pbonzini@redhat.com>Cc: Gerd Hoffmann <kraxel@redhat.com>...
scsi: do not return short responses for emulated commands
The inquiry command, for the case of VPD=1, was returning shortresponses; the number of returned bytes was just the number of bytesin the request, without padding to the specified allocation length...
virtio-scsi: factor checks for VIRTIO_SCSI_S_DRIVER_OK when reporting events
Suggested by Laszlo Ersek.
scsi: remove superfluous call to scsi_device_set_ua
megasas: do not include block_int.h
scsi-disk: flush cache after disabling it
SBC says that "if an application client changes the WCE bit from one tozero via a MODE SELECT command, then the device server shall writeany data in volatile cache to non-volatile medium before completingthe command"....
m48t59: remove unused m48t59_set_addr
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
sun4c: remove unused functions
vmware_vga: Add back some info in local state partially reverting aa32b38c
Keep saving display surface parameters at init and using these cachedvalues instead of getting them when needed. Not sure why this isneeded (maybe due to the interaction with the vga device) but not...
kvmvapic: Fix TB invalidation after instruction patching
Since 0b57e287, cpu_memory_rw_debug already triggers a TB invalidation.As it doesn't (and cannot) set is_cpu_write_access=1 but "consumes" thecurrently executed TB, the tb_invalidate_phys_page_range call from...
ehci: fix migration
Commit 5010d4dc618b6b8e7c21129c487c06f6493f71fc reorganized vmstate tosplit core + pci, but got two little details wrong. Fix them.
xhci: Fix some DMA host endian bugs
The xhci device does correct endian switches on the results of some DMAsbut not all. In particular, there are many DMAs of what are essentiallyarrays of 32-bit integers which never get byteswapped. This causes them...
ehci: Add support for packets with both data and an error status
xhci: Add support for packets with both data and an error status
usb/combined-packet: Move freeing of combined to usb_combined_packet_remove()
usb: split packet result into actual_length + status
Since with the ehci and xhci controllers a single packet can be largerthen maxpacketsize, it is possible for the result of a single packetto be both having transferred some data as well as the transfer to have...
usb-redir: Allow packets to have both data and an error-status
ehci: Get rid of the magical PROC_ERR status
Instead make ehci_execute and ehci_fill_queue return the again value.
spice: fix initialization order
Register displaychangelistener last, after spice is fully initialized,otherwise we may hit NULL pointer dereferences when qemu starts callingour callbacks.
Commit e250d949feb1334828f27f0d145c35f29c4b7639 triggers this bug....
hw/qxl: qxl_send_events: nop if stopped
Added a trace point for easy logging.
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=870972
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qxl: fix cursor reset
When resetting the qxl cursor notify the qemu displaystate too.
qxl: call dpy_gfx_resize when entering vga mode
When entering vga mode the display size likely changes,notify all displaychangelisteners about this.
Probably went unnoticed for a while as one if the firstthings the guest does after leaving qxl native mode and...
hw/qxl: guest bug on primary create with stride %4 != 0
Due to usage of pixman for rendering on all spice surfaces we havepixman's requirement that the stride be word aligned. A guest nothonoring that can crash spice and qemu with it due to failure to create...
vmware_vga: Allow simple drivers to work without using the fifo
Postpone stopping the dirty log to the point where the command fifo isconfigured to allow drivers which don't use the fifo to work too.(Without this the picture rendered into the vram never got to the...
vmware_vga: Return a value for FB_SIZE before the device is enabled
According to the documentation drivers using this device should readFB_SIZE before enabling the device to know what memory to map. Thiswould not work if we return 0 before enabled. The docs also mention...
vmware_vga: Remove duplicated info from local state
Removed info from vmsvga_state that is available from elsewhere andthus was duplicated here unnecessarily.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
vmware_vga: Coding style cleanup
Fix coding style as suggested by checkpatch.pl
Merge branch 'trivial-patches' of git://github.com/stefanha/qemu
xenfb: fix build breakage caused by console cleanup series
Console cleanup series renamed dpy_resize and dpy_update all over thetree, but hw/xenfb.c was forgotten. Update it too so it builds again.
Reported-by: Jan Kiszka <jan.kiszka@web.de>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
Merge remote-tracking branch 'kraxel/usb.69' into staging
pc: Drop redundant test for ROM memory region
Just a few lines above, we already initialize rom_memory accordingly.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
ppc: add missing static
Add missing 'static' qualifiers.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
cadence_uart: More debug information
Add more helpful debug information to the cadence UART.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Merge remote-tracking branch 'kraxel/pixman.v3' into staging
Merge remote-tracking branch 'stefanha/net' into staging
Merge remote-tracking branch 'bonzini/threadpool' into staging
arm_boot: Change initrd load address to "halfway through RAM"
To avoid continually having to bump the initrd load addressto account for larger kernel images, put the initrd halfwaythrough RAM. This allows large kernels on new boards with lotsof RAM to work OK, without breaking existing usecases for...
Merge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf
Merge branch 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
usb-redir: Add an usbredir_setup_usb_eps() helper function
usb-redir: Use reject rather the disconnect on bad ep info
So that the client gets a notification about us disconnecting the device.
usb-redir: Allow to attach USB 2.0 devices to 1.1 host controller
This follows the logic of host-linux: If a 2.0 device has no ISOendpoint and no interrupt endpoint with a packet size > 64, we canattach it also to an 1.1 host controller. In case the redir server does...
usb-redir: Allow redirecting super speed devices to high speed controllers