summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | scsi: introduce scsi_req_newPaolo Bonzini2011-05-266-5/+10
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: do not call send_command directlyPaolo Bonzini2011-05-268-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>
| * | | scsi: Update sense code handlingHannes Reinecke2011-05-264-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>
| * | | scsi: use scsi_req_completePaolo Bonzini2011-05-261-3/+2
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: introduce scsi_req_cancelPaolo Bonzini2011-05-268-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>
| * | | scsi: introduce scsi_req_abortPaolo Bonzini2011-05-263-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>
| * | | scsi: commonize purging requestsPaolo Bonzini2011-05-264-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>
| * | | scsi: Use 'SCSIRequest' directlyHannes Reinecke2011-05-268-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>
| * | | lsi: extract lsi_find_by_tagPaolo Bonzini2011-05-261-25/+38
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: reference-count requestsPaolo Bonzini2011-05-264-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>
| * | | scsi-generic: do not use a stale aiocbPaolo Bonzini2011-05-261-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>
| * | | scsi: introduce SCSIBusOpsPaolo Bonzini2011-05-267-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>
| * | | scsi: introduce scsi_req_dataPaolo Bonzini2011-05-265-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>
| * | | scsi-generic: Remove bogus double completePaolo Bonzini2011-05-261-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>
| * | | scsi: add tracing of scsi requestsPaolo Bonzini2011-05-262-0/+12
| |/ / | | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
* | | Merge remote-tracking branch 'kraxel/usb.14.pull' into stagingAnthony Liguori2011-05-3123-387/+2441
|\ \ \ | |_|/ |/| |
| * | usb: add ehci adapterGerd Hoffmann2011-05-265-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>
| * | usb: move cancel callback to USBDeviceInfoGerd Hoffmann2011-05-264-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>
| * | usb: keep track of packet owner.Gerd Hoffmann2011-05-262-15/+35
| | | | | | | | | | | | | | | | | | Keep track of the device which owns the usb packet for async processing. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb: add usb_handle_packetGerd Hoffmann2011-05-266-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>
| * | usb-storage: don't call usb_packet_complete twiceGerd Hoffmann2011-05-261-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>
| * | usb-linux: fix max_packet_size for highspeed.Gerd Hoffmann2011-05-261-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>
| * | usb-linux: split large xfersGerd Hoffmann2011-05-261-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>
| * | usb-linux: walk async urb list in cancelGerd Hoffmann2011-05-261-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lookup async urbs which are to be canceled using the linked list instead of the direct opaque pointer. There are two reasons we are doing that: First, to avoid the opaque poiner to the callback, which is needed for upcoming cleanups. Second, because we might need multiple urbs per request for highspeed support, so a single opaque pointer doesn't cut it any more anyway. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb-linux: track aurbs in listGerd Hoffmann2011-05-261-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds code to track all async urbs in a linked list, so we can find them without having to pass around a opaque pointer to them. Prerequisite for the cleanups. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb-linux: add hostport propertyGerd Hoffmann2011-05-261-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a hostport property which allows to specify the host usb devices to pass through by bus number and physical port. This means you can basically hand over one (or more) of the usb plugs on your host to the guest and whatever device is plugged in there will show up in the guest. Usage: -device usb-host,hostbus=1,hostport=1 You can figure the port numbers by plugging in some usb device, then find it in "info usbhost" and pick bus and port specified there. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb-linux: fix device path aka physical port handlingGerd Hoffmann2011-05-261-22/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The device path isn't just a number. It specifies the physical port the device is connected to and in case the device is connected via usb hub you'll have two numbers there, like this: "5.1". The first specifies the root port where the hub is plugged into, the second specifies the port number of the hub where the device is plugged in. With multiple hubs chained the string can become longer. This patch renames devpath to port and makes it a string. It also adapts the sysfs parsing code accordingly. The parser code is also more strict now and skips the root hubs (which can't be assigned anyway). The "info usbhost" monitor command now prints bus number, (os-assigned) device address and physical port for each device. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb-linux: use usb_generic_handle_packet()Hans de Goede2011-05-263-245/+66
| | | | | | | | | | | | | | | | | | | | | | | | 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 almost identical code. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
| * | usb: Pass the packet to the device's handle_control callbackHans de Goede2011-05-2614-35/+39
| | | | | | | | | | | | | | | | | | | | | | | | This allows using the generic usb_generic_handle_packet function from device code which does ASYNC control requests (such as the linux host pass through code). Signed-off-by: Hans de Goede <hdegoede@redhat.com>
| * | Bug #757654: UHCI fails to signal stall response patchJan Vesely2011-05-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | UHCI host controller status register indicates error and an 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: add support for "grouped" interfaces and the Interface Association ↵Brad Hards2011-05-263-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Descriptor This is used for some devices that have multiple interfaces that form a logic device. An example is Video Class, which has a Control interface and a Streaming interface. There can be additional interfaces on the same (physical) devices (e.g. a microphone), and Interface Association Descriptor handles this case. Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb: remove fallback to bNumInterfaces if no .nifBrad Hards2011-05-261-3/+2
| | | | | | | | | | | | | | | | | | | | | All callers have been updated. Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb: update config descriptors to identify number of interfacesBrad Hards2011-05-265-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | Previously we relied on the .bNumInterfaces, but that won't always be accurate after the introduction of grouped interfaces. Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb: Add Interface Association Descriptor descriptor typeBrad Hards2011-05-261-0/+1
| |/ | | | | | | | | Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | bitbang_i2c: Fix spurious slave read after NACKMarcus Comstedt2011-05-281-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>
* | Move user emulator stuff from cpu-exec.c to user-exec.cBlue Swirl2011-05-283-660/+678
| | | | | | | | | | | | Simplify cpu-exec.c by refactoring. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | cpu-exec: prepare for user and softmmu splitBlue Swirl2011-05-281-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>
* Merge remote-tracking branch 'kraxel/CVE-2011-1751' into stagingAnthony Liguori2011-05-251-1/+3
|\
| * Ignore pci unplug requests for unpluggable devices (CVE-2011-1751)Gerd Hoffmann2011-05-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | This patch makes qemu ignore unplug requests from the guest for pci devices which are tagged as non-hotpluggable. Trouble spot is the piix4 chipset with the ISA bridge. Requests to unplug that one will make it go away together with all ISA bus devices, which are not prepared to be unplugged and thus don't cleanup, leaving active qemu timers behind in free'ed memory. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | configure: Document --disable-slirp option in --helpPeter Maydell2011-05-231-0/+1
| | | | | | | | | | | | | | | | The --disable-slirp option was undocumented; add it to configure's --help output. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | target-arm/exec.h: Remove unused #define of M0Peter Maydell2011-05-231-2/+0
| | | | | | | | | | | | | | Remove a preprocessor #define which is never used. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | target-arm: Signal InvalidOp for Neon GE and GT compares of QNaNPeter Maydell2011-05-231-22/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the input to a Neon float comparison is a quiet NaN, the ARM ARM specifies that we should raise InvalidOp if the comparison is GE or GT but not for EQ. (Signaling NaNs raise InvalidOp regardless). This means only EQ should use the _quiet version of the comparison function. We implement this by cleaning up the comparison helpers to call the appopriate versions of the softfloat simple comparison functions (float32_le and friends) rather than the generic float32_compare functions. This makes them simple enough that they are clearer opencoded rather than macroised. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | target-arm: Use correct float status for Neon int-float conversionsPeter Maydell2011-05-233-194/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | The Neon versions of int-float conversions must use the "standard FPSCR" rather than the default FPSCR. Implement this by having the helper functions take a pointer to the appropriate float_status value rather than simply taking a pointer to the entire CPUState, and making translate.c pass a pointer to vfp.fp_status or vfp.standard_fp_status appropriately for whether the instruction being translated is Neon or VFP. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | target-arm: Signal Underflow when denormal flushed to zero on outputPeter Maydell2011-05-231-1/+1
| | | | | | | | | | | | | | | | | | On ARM the architecture mandates that when an output denormal is flushed to zero we must set the FPSCR UFC (underflow) bit, so map softfloat's float_flag_output_denormal accordingly. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | softfloat: Add new flag for when denormal result is flushed to zeroPeter Maydell2011-05-232-8/+36
| | | | | | | | | | | | | | | | | | | | | | Add a new float_flag_output_denormal which is set when the result of a floating point operation would be denormal but is flushed to zero because we are in flush_to_zero mode. This is necessary because some architectures signal this condition as an underflow and others signal it as an inexact result. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | target-arm: Signal InputDenormal for VRECPE, VRSQRTE, VRECPS, VRSQRTSPeter Maydell2011-05-231-0/+12
| | | | | | | | | | | | | | | | The helpers for VRECPE.F32, VSQRTE.F32, VRECPS and VRSQRTS handle denormals as special cases, so we must set the InputDenormal exception flag ourselves. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | target-arm: Don't set FP exceptions in recip, recip_sqrt estimate fnsPeter Maydell2011-05-231-2/+10
| | | | | | | | | | | | | | | | | | The functions which do the core estimation algorithms for the VRSQRTE and VRECPE instructions should not set floating point exception flags, so use a local fp status for doing these calculations. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | tcg: don't keep dead outputs in registersAurelien Jarno2011-05-231-10/+18
| | | | | | | | | | | | | | | | | | | | If an op with dead outputs is not removed, because it has side effects or has multiple output and only one dead, mark the registers as dead instead of saving them. This avoid a few register spills on TCG targets with low register count, especially with div2 and mul2 ops, or when a qemu_ld* result is not used (prefetch emulation for example). Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | tcg: mark dead output argument in op_dead_argsAurelien Jarno2011-05-231-2/+8
| | | | | | | | | | | | | | If an op is not removed and has dead output arguments, mark it in op_dead_args similarly to what is done for input arguments. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | tcg: replace op_dead_iargs by op_dead_argsAurelien Jarno2011-05-232-37/+38
| | | | | | | | | | | | | | Allow all args to be dead by replacing the input specific op_dead_iargs variable by op_dead_args. Note this is a purely mechanical change. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
OpenPOWER on IntegriCloud