summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-05-31target-alpha: Single-step properly across branches.Richard Henderson1-15/+20
We were failing to generate EXC_DEBUG in the EXIT_PC_UPDATED path. This caused us not to stop at the instruction after a branch, but on the instruction afterward. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Disassemble EV6 PALcode instructions.Richard Henderson3-5/+4
The QEMU emulation PALcode will use EV6 PALcode insns regardless of the "real" cpu instruction set being emulated. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Claim ownership.Richard Henderson1-2/+2
I've been maintaining this port for a while now. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori2-2/+2
2011-05-31Merge remote-tracking branch 'amit/for-anthony' into stagingAnthony Liguori3-71/+70
2011-05-31Merge remote-tracking branch 'bonzini/scsi.2' into stagingAnthony Liguori9-573/+868
Conflicts: hw/usb-msd.c
2011-05-31Merge remote-tracking branch 'kraxel/usb.14.pull' into stagingAnthony Liguori23-387/+2441
2011-05-29Fix spelling in comment (additon -> addition)Stefan Weil1-1/+1
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-05-29pflash_cfi02: Fix a typo in debug code (TARGET_FMT_pld -> TARGET_FMT_plx)Stefan Weil1-1/+1
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>
2011-05-28bitbang_i2c: Fix spurious slave read after NACKMarcus Comstedt1-1/+4
After NACKing a read operation, a raising SCL should not trigger a new read from the slave. Introduce a new state which just waits for a stop or start condition after NACK. Signed-off-by: Marcus Comstedt <marcus@mc.pp.se> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-05-28Move user emulator stuff from cpu-exec.c to user-exec.cBlue Swirl3-660/+678
Simplify cpu-exec.c by refactoring. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-05-28cpu-exec: prepare for user and softmmu splitBlue Swirl1-131/+172
There is little in common with user and softmmu versions of cpu_resume_signal(), split them. Fix coding style for the user emulator part. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-05-27virtio-console: Simplify init callbacksMarkus Armbruster1-26/+9
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-05-27virtio-serial: Drop redundant VirtIOSerialPort member infoMarkus Armbruster3-20/+32
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-05-27virtio-serial: Drop useless property is_consoleMarkus Armbruster2-5/+0
All you could ever achieve with it is break stuff, so removing it should be safe. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-05-27virtio-serial: Clean up virtconsole detectionMarkus Armbruster3-6/+11
virtio-serial-bus needs to treat "virtconsole" devices specially. It uses VirtIOSerialPort member is_console to recognize them. It gets its value via property initialization. Cute hack, except it lets users mess with it: "-device virtconsole,is_console=0" isn't plugged into port 0 as it should. Move the flag to VirtIOSerialPortInfo. Keep the property for backward compatibility; its value has no effect. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-05-27virtio-serial: Plug memory leak on qdev exit()Markus Armbruster1-18/+9
virtio_serial_init() allocates the VirtIOSerialBus dynamically, but virtio_serial_exit() doesn't free it. Fix by getting rid of the allocation. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-05-27virtio-serial-bus: use bh for unthrottlingAlon Levy2-2/+15
Instead of calling flush_queued_data when unthrottling, schedule a bh. That way we can return immediately to the caller, and the flush uses the same call path as a have_data for callbackee. No migration change is required because bh are called from vm_stop. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-05-26scsi: ignore LUN field in the CDBPaolo Bonzini2-6/+5
The LUN field in the CDB is a historical relic. Ignore it as reserved, which is what modern SCSI specifications actually say. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: rename arguments to the new callbacksPaolo Bonzini4-37/+34
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: split command_complete callback in twoPaolo Bonzini6-137/+168
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
2011-05-26esp: rename sense to statusPaolo Bonzini1-5/+5
This mirrors the LSI patch that was recently committed. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
2011-05-26scsi-generic: Handle queue fullPaolo Bonzini1-0/+3
The sg driver currently has a hardcoded limit of commands it can handle simultaneously. When this limit is reached the driver will return -EDOM. So we need to capture this to enable proper return values here. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: make write_data return voidPaolo Bonzini3-10/+5
The return value is unused anyway. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26scsi-disk: add data direction checkingHannes Reinecke1-11/+24
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. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: Implement 'get_sense' callbackHannes Reinecke5-1/+49
The get_sense callback copies existing sense information into the provided buffer. This is required if sense information should be transferred together with the command response. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: introduce scsi_req_get_bufPaolo Bonzini6-9/+11
... and remove some SCSIDevice variables or fields that now become unused. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: introduce scsi_req_continuePaolo Bonzini7-60/+47
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: introduce scsi_req_newPaolo Bonzini6-5/+10
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: do not call send_command directlyPaolo Bonzini8-9/+14
Move the common part of scsi-disk.c and scsi-generic.c to the SCSI layer. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: Update sense code handlingHannes Reinecke4-67/+208
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 error which is actually a violation of the spec in certain cases. This patch introduces various predefined sense codes to have the sense code reporting more in line with the spec. On top of Hannes's patch I fixed the reply to REQUEST SENSE commands with DESC=0 and a small (<18) length. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: use scsi_req_completePaolo Bonzini1-3/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: introduce scsi_req_cancelPaolo Bonzini8-17/+80
This is for when the request must be dropped in the void, but still memory should be freed. To this end, the devices register a second callback in SCSIBusOps. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: introduce scsi_req_abortPaolo Bonzini3-6/+12
This covers the case of canceling a request's I/O and still completing it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: commonize purging requestsPaolo Bonzini4-32/+17
The code for canceling requests upon reset is already the same. Clean it up and move it to scsi-bus.c. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: Use 'SCSIRequest' directlyHannes Reinecke8-252/+173
Currently the SCSIRequest structure is abstracted away and cannot accessed directly from the driver. This requires the handler to do a lookup on an abstract 'tag' which identifies the SCSIRequest structure. With this patch the SCSIRequest structure is exposed to the driver. This allows use to use it directly as an argument to the SCSIDeviceInfo callback functions and remove the lookup. A new callback function 'alloc_req' is introduced matching 'free req'; unref'ing to free up resources after use is moved into the scsi_command_complete callbacks. This temporarily introduces a leak of requests that are cancelled, when they are removed from the queue and not from the driver. This is fixed later by introducing scsi_req_cancel. That patch in turn depends on this one, because the argument to scsi_req_cancel is a SCSIRequest. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26lsi: extract lsi_find_by_tagPaolo Bonzini1-25/+38
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: reference-count requestsPaolo Bonzini4-23/+58
With the next patch, a device may hold SCSIRequest for an indefinite time. 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 the need to unref the request when it fails. This will go away with the next patches, which move the unref'ing to the devices. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
2011-05-26scsi-generic: do not use a stale aiocbPaolo Bonzini1-0/+3
If a request is canceled after it has been completed, scsi_cancel_io would pass a stale aiocb to bdrv_aio_cancel. Avoid this. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: introduce SCSIBusOpsPaolo Bonzini7-17/+34
There are more operations than a SCSI bus can handle, besides completing commands. One example, which this series will introduce, is cleaning up after a request is cancelled. More long term, a "SCSI bus" can represent the LUNs attached to a target; in this case, while all commands will ultimately reach a logical unit, it is the target who is in charge of answering REPORT LUNs. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: introduce scsi_req_dataPaolo Bonzini5-7/+20
This abstracts calling the command_complete callback, reducing churn in the following patches. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26scsi-generic: Remove bogus double completePaolo Bonzini1-2/+4
scsi-generic scsi_read_complete() should not -both- call the client complete callback with SCSI_REASON_DATA -and- call scsi_command_complete(). The former will cause the client to queue a new read or write request, while the later will free the request data structure, thus causing the new read or write request to use a freed/stale structure when it completes. This patch fixes the bug, fixing a crash with scsi-generic & RHEL5.5 installer. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26scsi: add tracing of scsi requestsPaolo Bonzini2-0/+12
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-05-26usb: add ehci adapterGerd Hoffmann5-0/+2078
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 Mark Burkley, with contributions by Niels de Vos. David S. Ahern continued working on it. Kevin Wolf, Jan Kiszka and Vincent Palatin contributed bugfixes. /me (Gerd Hoffmann) picked it up where it left off, prepared the code for merge, fixed a few bugs and added basic user docs. Cc: David S. Ahern <daahern@cisco.com> Cc: Jan Kiszka <jan.kiszka@web.de> Cc: Kevin Wolf <mail@kevin-wolf.de> Cc: Vincent Palatin <vincent.palatin_qemu@m4x.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-26usb: move cancel callback to USBDeviceInfoGerd Hoffmann4-22/+12
Remove the cancel callback from the USBPacket struct, move it over to USBDeviceInfo. Zap usb_defer_packet() which is obsolete now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-26usb: keep track of packet owner.Gerd Hoffmann2-15/+35
Keep track of the device which owns the usb packet for async processing. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-26usb: add usb_handle_packetGerd Hoffmann6-7/+22
Add a usb_handle_packet function, put it into use everywhere. Right now it just calls dev->info->handle_packet(), that will change in future patches though. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-26usb-storage: don't call usb_packet_complete twiceGerd Hoffmann1-1/+1
usb_msd_copy_data() may cause a recursive call to usb_msd_command_complete() which in turn may complete the packet, setting s->packet to NULL in case it does. Recheck s->packet before calling usb_packet_complete() to fix the double call. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-26usb-linux: fix max_packet_size for highspeed.Gerd Hoffmann1-2/+17
Calculate the max packet size correctly. Only bits 0..11 specify the size, bits 11+12 specify the number of (highspeed) microframes the endpoint wants to use. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-26usb-linux: split large xfersGerd Hoffmann1-23/+41
Add support for splitting large transfers into multiple smaller ones. This is needed for the upcoming EHCI emulation which allows guests to submit requests up to 20k in size. The linux kernel allows 16k max size though. Based on a patch from David Ahern, see http://www.mail-archive.com/qemu-devel@nongnu.org/msg30337.html Cc: David Ahern <daahern@cisco.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>