usb: cancel async packets on unplug
This patch adds USBBusOps struct with (for now) only a single callbackwhich is called when a device is about to be destroyed. The USB Hostadapters are implementing this callback and use it to cancel any asyncrequests which might be in flight before the device actually goes away....
usb-ehci: drop EXECUTING checks.
The state machine doesn't stop in EXECUTING state any more when asyncpackets are in flight, so the checks are not needed any more and canbe dropped.
Also kick out the check for the frame timer. As we don't stop & sleep...
Fix USB mouse Set_Protocol behavior
The QEMU USB mouse claims to support the "boot" protocol(bInterfaceSubClass is 1). However, the mouse rejects theSet_Protocol command.
The qemu mouse does support the "boot" protocol specification, so asimple fix is to enable the Set_Protocol request....
The USB tablet should not claim boot protocol support.
The USB tablet advertises that it supports the "boot" protocol.However, its reports aren't "boot" protocol compatible. So, itshouldn't claim that.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>...
usb-ehci: fix offset writeback in ehci_buffer_rw
Two bugs at once:
First the mask is backwards, so the it used to keeps the offset andclears the page address, which is not what we need when we update theoffset.
Second the offset calculation is wrong in case head isn't page aligned....
usb-ehci: fix error handling.
Set the correct bits for nodev, stall and babble errors.Raise errint irq. Fix state transition from WRITEBACKto the next state.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ehci: fix a number of unused-but-set-variable warnings (new with gcc-4.6)
usb-ehci: multiqueue support
This patch adds support for keeping multiple queues going at the sametime. One slow device will not affect other devices any more.
The patch adds code to manage EHCIQueue structs. It also does a numberof changes to the state machine:...
usb-ehci: trace buffer copy
Add a trace point for buffer copies and drop the DPRINTF's.
No change in behavior.
usb-ehci: add queue data struct
Add EHCIQueue struct, move the fields needed to track the queue stateinto that struct. Pass the new struct instead of ehci state down tofunctions which handle the queue state. Lot of variable references havechanged due to that without an actual functional change....
usb-ehci: trace mmio and usbsts
This patch starts adding trace support to ehci. It tracesupdates of the status register (USBSTS), mmio access andcontroller reset.
It also adds functions to set and clear status register bitsand puts them in use everywhere....
usb-ehci: trace state machine changes
Add functions to get and set the current state of the state machine,add tracepoints there to trace state transitions. Add support fortraceing the queue heads and transfer descriptors as we look at them.
Drop a few DPRINTFs and all DPRINTF_ST lines, they are obsolete now....
usb-ehci: trace port state
Trace usb port operations (attach, detach, reset),drop a few obsolete DPRINTF's.
usb-ehci: improve mmio tracing
Add a separate tracepoint to log how register values change in responseto a mmio write. Especially useful for registers which have read-onlyor clear-on-write bits in them.
Merge remote branch 'rth/axp-next' into alpha-merge
Merge remote-tracking branch 'jvrao/for-anthony' into staging
Merge remote-tracking branch 'spice/spice.v37' into staging
Conflicts: vl.c
ide/core: Remove explicit setting of BM_STATUS_INT
BM_STATUS_INT is automatically set during ide_set_irq(), there's no reason toset it manually in addition.
There is even one case where the interrupt status bit was set, but no IRQ wasraised. This is when the PRD table was reached but there is more data to...
Add an isa device for SGA
This patch adds a dummy legacy ISA device whose responsibility is todeploy sgabios, an option rom for a serial graphics adapter.The proposal is that this device is always-on when -nographics,but can otherwise be enable in any setup when -device sga is used....
isa-vga: Make available with -device, like the other VGA qdevs
Switch no_user off and make it suppress the default VGA.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qxl: fix cmdlog for vga
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
scsi: fix tracing of scsi requests with simple backend
The simple backend only supports a maximum of 6 arguments. Split thescsi_req_parsed event in two parts to cope with the limit.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
virtio-9p: Remove statement without effect (fix warning from cppcheck)
cppcheck report:virtio-9p.c:197: warning: Redundant assignment of "flags" to itself
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Reviewed-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>...
multiboot: set boot_device to first partition
The multiboot info struct's 'boot_device' field has 'part1' set to 0x01, whichmaps to the second primary partition. To specify the first primary partition,'part1' should be set to 0x00, since partition numbers start from zero...
PPC: fix mpc8544ds pci default devices
After the Qdev'ification of the MPC8544DS board and PCI bus, the internalPCI bus name changed from "pci" to "pci.0". Reflect this change in thesearch for that bus.
This patch enables networking on e500 guests again....
hw/9pfs: Don't crash when we get a request with not supported 9p operation
Return EOPNOTSUPP as error
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
[virtio-9p] Make rpath thread safe
Current rpath inline function is heavily used in all system calls.This function has a static buffer making it a non-thread safe function.This patch introduces new thread-safe routine and makes use of it.
Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
virtio-9p: Use relative includes for files in hw
Commit 353ac78d495ef976242abd868f68d78420861c2c moved the fileswithout fixing the include paths. It used a modified CFLAGSto add hw to the include search path, but this breaks buildswhere the user wants to set special CFLAGS. Long include paths...
virtio-9p: Move device specific code to virtio-9p-device
virtio-9p: Move 9p device registration into virtio-9p.c
This patch move the 9p device registration into its own file
[virtio-9p] Stop renaming files with similar name!
v9fs_complete_rename() mistakenly renames files with similar nameas we don't check if the matched name is really an offspring.
Signed-off-by: Malahal Naineni <malahal@us.ibm.com>Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
target-alpha: Remove partial support for palcode emulation.
This code does not work, and will be replaced by a bios image.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'amit/for-anthony' into staging
Merge remote-tracking branch 'bonzini/scsi.2' into staging
Conflicts: hw/usb-msd.c
Merge remote-tracking branch 'kraxel/usb.14.pull' into staging
pflash_cfi02: Fix a typo in debug code (TARGET_FMT_pld -> TARGET_FMT_plx)
Thanks to Tobias Hoffmann <th55@gmx.de> for this patch.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
bitbang_i2c: Fix spurious slave read after NACK
After NACKing a read operation, a raising SCL should not trigger a newread from the slave. Introduce a new state which just waits for a stopor start condition after NACK.
Signed-off-by: Marcus Comstedt <marcus@mc.pp.se>...
virtio-serial: Clean up virtconsole detection
virtio-serial-bus needs to treat "virtconsole" devices specially. Ituses VirtIOSerialPort member is_console to recognize them. It getsits value via property initialization. Cute hack, except it letsusers mess with it: "-device virtconsole,is_console=0" isn't plugged...
virtio-serial: Drop useless property is_console
All you could ever achieve with it is break stuff, so removing itshould be safe.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-serial: Drop redundant VirtIOSerialPort member info
virtio-console: Simplify init callbacks
virtio-serial-bus: use bh for unthrottling
Instead of calling flush_queued_data when unthrottling, schedulea bh. That way we can return immediately to the caller, and theflush uses the same call path as a have_data for callbackee.
No migration change is required because bh are called from vm_stop....
virtio-serial: Plug memory leak on qdev exit()
virtio_serial_init() allocates the VirtIOSerialBus dynamically, butvirtio_serial_exit() doesn't free it.
Fix by getting rid of the allocation.
scsi: make write_data return void
The return value is unused anyway.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Christoph Hellwig <hch@lst.de>
scsi-generic: Handle queue full
The sg driver currently has a hardcoded limit of commands itcan handle simultaneously. When this limit is reached thedriver will return -EDOM. So we need to capture this toenable proper return values here.
Signed-off-by: Hannes Reinecke <hare@suse.de>...
esp: rename sense to status
This mirrors the LSI patch that was recently committed.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Cc: Christoph Hellwig <hch@lst.de>
scsi: split command_complete callback in two
scsi: rename arguments to the new callbacks
scsi: ignore LUN field in the CDB
The LUN field in the CDB is a historical relic. Ignore it as reserved,which is what modern SCSI specifications actually say.
scsi: Update sense code handling
The SCSI spec has a quite detailed list of sense codes available.It even mandates the use of specific ones for some failure cases.The current implementation just has one type of generic errorwhich is actually a violation of the spec in certain cases....
scsi: do not call send_command directly
Move the common part of scsi-disk.c and scsi-generic.c to the SCSI layer.
scsi: introduce scsi_req_new
scsi: introduce scsi_req_continue
scsi: introduce scsi_req_get_buf
... and remove some SCSIDevice variables or fields that now become unused.
scsi: Implement 'get_sense' callback
The get_sense callback copies existing sense information intothe provided buffer. This is required if sense informationshould be transferred together with the command response.
scsi-disk: add data direction checking
scsi_req_parse() already provides for a data direction setting,so we should be using it to check for correct direction.And we should return the sense code 'INVALID FIELD IN CDB'in these cases.
scsi: reference-count requests
With the next patch, a device may hold SCSIRequest for an indefinitetime. Split a rather big patch, and protect against access errors,by reference counting them.
There is some ugliness in scsi_send_command implementation due to...
lsi: extract lsi_find_by_tag
scsi: Use 'SCSIRequest' directly
Currently the SCSIRequest structure is abstracted away and cannot accesseddirectly from the driver. This requires the handler to do a lookup onan abstract 'tag' which identifies the SCSIRequest structure.
With this patch the SCSIRequest structure is exposed to the driver. This...
scsi: commonize purging requests
The code for canceling requests upon reset is already the same. Cleanit up and move it to scsi-bus.c.
scsi: introduce scsi_req_abort
This covers the case of canceling a request's I/O and stillcompleting it.
scsi: introduce scsi_req_cancel
This is for when the request must be dropped in the void,but still memory should be freed. To this end, the devicesregister a second callback in SCSIBusOps.
scsi: use scsi_req_complete
scsi: add tracing of scsi requests
scsi-generic: Remove bogus double complete
scsi-generic scsi_read_complete() should not both call the clientcomplete callback with SCSI_REASON_DATA and callscsi_command_complete(). The former will cause the client to queue anew read or write request, while the later will free the request data...
scsi: introduce scsi_req_data
This abstracts calling the command_complete callback, reducing churnin the following patches.
scsi: introduce SCSIBusOps
There are more operations than a SCSI bus can handle, besides completingcommands. One example, which this series will introduce, is cleaning upafter a request is cancelled.
More long term, a "SCSI bus" can represent the LUNs attached to a...
scsi-generic: do not use a stale aiocb
If a request is canceled after it has been completed, scsi_cancel_iowould pass a stale aiocb to bdrv_aio_cancel. Avoid this.
usb: add ehci adapter
This patch finally merges the EHCI host adapter aka USB 2.0 support.
Based on the ehci bits collected @ git://git.kiszka.org/qemu.git ehci
EHCI has a long out-of-tree history. Project was started by MarkBurkley, with contributions by Niels de Vos. David S. Ahern continued...
usb: add usb_handle_packet
Add a usb_handle_packet function, put it into use everywhere.Right now it just calls dev->info->handle_packet(), that willchange in future patches though.
usb: keep track of packet owner.
Keep track of the device which owns the usb packet for async processing.
usb: move cancel callback to USBDeviceInfo
Remove the cancel callback from the USBPacket struct, move it overto USBDeviceInfo. Zap usb_defer_packet() which is obsolete now.
usb: Add Interface Association Descriptor descriptor type
Signed-off-by: Brad Hards <bradh@frogmouth.net>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: update config descriptors to identify number of interfaces
Previously we relied on the .bNumInterfaces, but that won't always beaccurate after the introduction of grouped interfaces.
usb: remove fallback to bNumInterfaces if no .nif
All callers have been updated.
usb: add support for "grouped" interfaces and the Interface Association Descriptor
This is used for some devices that have multiple interfaces that form a logicdevice. An example is Video Class, which has a Control interface and aStreaming interface. There can be additional interfaces on the same (physical)...
Bug #757654: UHCI fails to signal stall response patch
UHCI host controller status register indicates error andan interrupt is triggered on BABBLE and STALL errors.
Signed-off-by: Jan Vesely <jano.vesely@gmail.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: Pass the packet to the device's handle_control callback
This allows using the generic usb_generic_handle_packet function fromdevice code which does ASYNC control requests (such as the linux hostpass through code).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb-linux: use usb_generic_handle_packet()
Make the linux usb host passthrough code use the usb_generic_handle_packet()function, rather then the curent DYI code. This removes 200 lines of almostidentical code.
usb-storage: don't call usb_packet_complete twice
usb_msd_copy_data() may cause a recursive call tousb_msd_command_complete() which in turn may completethe packet, setting s->packet to NULL in case it does.Recheck s->packet before calling usb_packet_complete()...
Merge remote-tracking branch 'kraxel/CVE-2011-1751' into staging
Merge branch 'trivial-patches' of git://repo.or.cz/qemu/stefanha
Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
piix_pci: fix piix3_set_irq_pic()
If pic_irq is greater than 7, the irq level is always 0 on 32bits.
Signed-off-by: TeLeMan <geleman@gmail.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw/realview.c: Remove duplicate #include line
Remove a duplicate #include of sysbus.h.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw/sd.c: Don't complain about SDIO commands CMD52/CMD53
The SDIO specification introduces new commands 52 and 53.Handle as illegal command but do not complain on stderr,as SDIO-aware OSes (including Linux) may legitimately usethese in their probing for presence of an SDIO card....
pSeries: Clean up write-only variables
A few pieces of the pSeries emulation code have variables which are setbut never used, which causes warnings on gcc 4.6. This patch removesthese instances.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
s390x: fix memory detection for guests > 64GB
the s390 memory detection has a 16bit field that specifies the amount ofincrements. This patch adopts the memory size to always fit into thatscheme. This also fixes virtio detection for these guests, since the...
s390x: keep hint on virtio managing size
The s390x virtio bus keeps management information on virtio after the topof the guest's RAM. We need to be able to tell the guest the size of itsRAM (without virtio stuff), but also be able to trap when the guest accesses...
ahci: Fix non-NCQ accesses for LBA > 16bits
AHCI provides two ways of reading/writing data:
1) NCQ 2) ATA commands with the LBA in the command FIS
In the second code path, we didn't handle any LBAs that were bigger than16 bits, so whenever a guest that used high LBA numbers wanted to access...
Ignore pci unplug requests for unpluggable devices (CVE-2011-1751)
This patch makes qemu ignore unplug requests from the guest for pcidevices which are tagged as non-hotpluggable. Trouble spot is thepiix4 chipset with the ISA bridge. Requests to unplug that one will...
blockdev: Store -drive option media in DriveInfo
DriveInfo is closely tied to -drive, and like -drive, it mixesinformation about host and guest part of the block device. UnlikeDriveInfo, BlockDriverState should be about the host part only.
One of the remaining guest bits there is the "type hint". -drive...
scsi: Split qdev "scsi-disk" into "scsi-hd" and "scsi-cd"
A "scsi-disk" is either a hard disk or a CD-ROM, depending on theassociated BlockDriverState's type hint. Unclean; disk vs. CD belongsto the guest part, not the host part.
Have separate qdevs "scsi-hd" and "scsi-cd" to model disk vs. CD in...
ide: Split qdev "ide-drive" into "ide-hd" and "ide-cd"
An "ide-drive" is either a hard disk or a CD-ROM, depending on theassociated BlockDriverState's type hint. Unclean; disk vs. CD belongsto the guest part, not the host part.
Have separate qdevs "ide-hd" and "ide-cd" to model disk vs. CD in...
ahci: Fix crashes on duplicate BH registration
If ahci_dma_set_inactive is called a while there is still a pending BHfrom a previous run, we will crash on the second run ofahci_check_cmd_bh as it overwrites AHCIDevice::check_bh. Avoid thisbroken and redundant duplicate registration....
ide: cleanup warnings
Add \n.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/xen_disk: Remove unused local variable
cppcheck report:hw/xen_disk.c:309: style: Variable 'len' is assigned a value that is never used
Cc: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: Turn debug messages into assertions
These printfs aren't really debug messages, but clearly indicate a bug if theyever become effective. Noone uses DEBUG_IDE, let's re-enable the checkunconditionally and make it an assertion instead of printfs in the device...
ahci: Unbreak bar registration
Fix regression of 667bb59: ahci_init initializes ahci.mem, so we have tomove bar registration after it.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>