Stefan Hajnoczi [Wed, 25 May 2011 18:48:01 +0000 (19:48 +0100)]
QMP: add server mode to QEMUMonitorProtocol
QEMU supports socket chardevs that establish connections like a server
or a client. The QEMUMonitorProtocol class only supports connecting as
a client. It is not possible to connect race-free when launching QEMU
since trying to connect before QEMU has bound and is listening on the
socket results in failure.
Add the QEMUMonitorProtocol(server=True) argument to bind and listen on
the socket. The QEMU process can then be launched and connects to the
already existing QMP socket without a race condition:
qmp = qmp.QEMUMonitorProtocol(monitor_path, server=True)
popen = subprocess.Popen(args)
qmp.accept()
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Stefan Hajnoczi [Wed, 25 May 2011 18:48:00 +0000 (19:48 +0100)]
QMP: add get_events(wait=True) option
The get_events() function polls for new QMP events and then returns. It
can be useful to wait for the next QMP event so add the boolean 'wait'
keyword argument.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Luiz Capitulino [Fri, 29 Apr 2011 15:11:50 +0000 (12:11 -0300)]
HMP: Use QMP inject nmi implementation
This **CHANGES** the human monitor "nmi" command behavior.
Currently it accepts an CPU argument which, when provided, will send
the NMI to the specified CPU. This feature is of discussable value
though and HMP shouldn't have more features than QMP, so let's use
QMP's instead (it's also simpler).
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Lai Jiangshan [Mon, 7 Mar 2011 09:05:15 +0000 (17:05 +0800)]
QMP: add inject-nmi qmp command
inject-nmi command injects an NMI on all CPUs of guest.
It is only supported for x86 guest currently, it will
returns "Unsupported" error for non-x86 guest.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Lai Jiangshan [Mon, 7 Mar 2011 09:05:04 +0000 (17:05 +0800)]
QMP: QError: New QERR_UNSUPPORTED
New QERR_UNSUPPORTED for unsupported commands or requests.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Juha Riihim?ki [Tue, 31 May 2011 18:40:21 +0000 (19:40 +0100)]
audio: fix integer overflow expression
Fix an integer overflow that can happen for signed 32 bit types
when using FLOAT_MIXENG. (Note that at the moment this is only true
when using the MacOSX coreaudio audio driver.)
Signed-off-by: Juha Riihim?ki <juha.riihimaki@nokia.com>
[Peter Maydell: Removed unnecessary casts]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: malc <av1474@comtv.ru>
Anthony Liguori [Tue, 31 May 2011 13:23:11 +0000 (08:23 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Tue, 31 May 2011 13:22:03 +0000 (08:22 -0500)]
Merge remote-tracking branch 'amit/for-anthony' into staging
Anthony Liguori [Tue, 31 May 2011 13:20:56 +0000 (08:20 -0500)]
Merge remote-tracking branch 'bonzini/scsi.2' into staging
Conflicts:
hw/usb-msd.c
Anthony Liguori [Tue, 31 May 2011 13:17:15 +0000 (08:17 -0500)]
Merge remote-tracking branch 'kraxel/usb.14.pull' into staging
Stefan Weil [Sun, 22 May 2011 12:02:40 +0000 (14:02 +0200)]
Fix spelling in comment (additon -> addition)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Stefan Weil [Sun, 22 May 2011 12:02:39 +0000 (14:02 +0200)]
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>
Marcus Comstedt [Sat, 28 May 2011 14:55:52 +0000 (16:55 +0200)]
bitbang_i2c: Fix spurious slave read after NACK
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>
Blue Swirl [Sun, 8 May 2011 11:22:38 +0000 (11:22 +0000)]
Move user emulator stuff from cpu-exec.c to user-exec.c
Simplify cpu-exec.c by refactoring.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Sat, 21 May 2011 08:42:35 +0000 (08:42 +0000)]
cpu-exec: prepare for user and softmmu split
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>
Markus Armbruster [Wed, 25 May 2011 12:21:14 +0000 (14:21 +0200)]
virtio-console: Simplify init callbacks
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Markus Armbruster [Wed, 25 May 2011 12:21:13 +0000 (14:21 +0200)]
virtio-serial: Drop redundant VirtIOSerialPort member info
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Markus Armbruster [Wed, 25 May 2011 12:21:12 +0000 (14:21 +0200)]
virtio-serial: Drop useless property is_console
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>
Markus Armbruster [Wed, 25 May 2011 12:21:11 +0000 (14:21 +0200)]
virtio-serial: Clean up virtconsole detection
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>
Markus Armbruster [Wed, 25 May 2011 12:21:10 +0000 (14:21 +0200)]
virtio-serial: Plug memory leak on qdev exit()
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>
Alon Levy [Fri, 29 Apr 2011 11:25:06 +0000 (14:25 +0300)]
virtio-serial-bus: use bh for unthrottling
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>
Paolo Bonzini [Thu, 19 May 2011 14:47:28 +0000 (16:47 +0200)]
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.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Paolo Bonzini [Fri, 20 May 2011 18:18:07 +0000 (20:18 +0200)]
scsi: rename arguments to the new callbacks
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Paolo Bonzini [Fri, 22 Apr 2011 10:27:30 +0000 (12:27 +0200)]
scsi: split command_complete callback in two
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Paolo Bonzini [Fri, 20 May 2011 18:10:02 +0000 (20:10 +0200)]
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>
Paolo Bonzini [Mon, 18 Apr 2011 12:29:16 +0000 (14:29 +0200)]
scsi-generic: Handle queue full
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>
Paolo Bonzini [Fri, 22 Apr 2011 07:39:16 +0000 (09:39 +0200)]
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>
Hannes Reinecke [Mon, 18 Apr 2011 10:57:22 +0000 (12:57 +0200)]
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.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Hannes Reinecke [Mon, 18 Apr 2011 11:36:02 +0000 (13:36 +0200)]
scsi: Implement 'get_sense' callback
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>
Paolo Bonzini [Thu, 21 Apr 2011 11:21:02 +0000 (13:21 +0200)]
scsi: introduce scsi_req_get_buf
... 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>
Paolo Bonzini [Mon, 18 Apr 2011 13:28:11 +0000 (15:28 +0200)]
scsi: introduce scsi_req_continue
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Paolo Bonzini [Mon, 18 Apr 2011 17:09:55 +0000 (19:09 +0200)]
scsi: introduce scsi_req_new
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Paolo Bonzini [Mon, 18 Apr 2011 17:07:23 +0000 (19:07 +0200)]
scsi: do not call send_command directly
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>
Hannes Reinecke [Mon, 18 Apr 2011 10:53:14 +0000 (12:53 +0200)]
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 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>
Paolo Bonzini [Mon, 18 Apr 2011 15:06:17 +0000 (17:06 +0200)]
scsi: use scsi_req_complete
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Paolo Bonzini [Mon, 18 Apr 2011 20:53:08 +0000 (22:53 +0200)]
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 devices
register a second callback in SCSIBusOps.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Paolo Bonzini [Mon, 18 Apr 2011 15:14:51 +0000 (17:14 +0200)]
scsi: introduce scsi_req_abort
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>
Paolo Bonzini [Mon, 18 Apr 2011 16:47:12 +0000 (18:47 +0200)]
scsi: commonize purging requests
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>
Hannes Reinecke [Mon, 18 Apr 2011 10:35:39 +0000 (12:35 +0200)]
scsi: Use 'SCSIRequest' directly
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>
Paolo Bonzini [Mon, 18 Apr 2011 10:01:45 +0000 (12:01 +0200)]
lsi: extract lsi_find_by_tag
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Paolo Bonzini [Mon, 18 Apr 2011 14:01:56 +0000 (16:01 +0200)]
scsi: reference-count requests
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>
Paolo Bonzini [Wed, 25 May 2011 14:53:46 +0000 (16:53 +0200)]
scsi-generic: do not use a stale aiocb
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>
Paolo Bonzini [Mon, 18 Apr 2011 15:11:14 +0000 (17:11 +0200)]
scsi: introduce SCSIBusOps
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>
Paolo Bonzini [Mon, 18 Apr 2011 12:59:13 +0000 (14:59 +0200)]
scsi: introduce scsi_req_data
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>
Paolo Bonzini [Tue, 3 May 2011 12:15:59 +0000 (14:15 +0200)]
scsi-generic: Remove bogus double complete
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>
Paolo Bonzini [Fri, 15 Apr 2011 09:51:13 +0000 (11:51 +0200)]
scsi: add tracing of scsi requests
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Gerd Hoffmann [Fri, 3 Dec 2010 15:17:28 +0000 (16:17 +0100)]
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 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>
Gerd Hoffmann [Mon, 16 May 2011 08:34:53 +0000 (10:34 +0200)]
usb: move cancel callback to USBDeviceInfo
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>
Gerd Hoffmann [Thu, 12 May 2011 11:48:13 +0000 (13:48 +0200)]
usb: keep track of packet owner.
Keep track of the device which owns the usb packet for async processing.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Thu, 12 May 2011 11:20:39 +0000 (13:20 +0200)]
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 will
change in future patches though.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Mon, 16 May 2011 12:25:59 +0000 (14:25 +0200)]
usb-storage: don't call usb_packet_complete twice
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>
Gerd Hoffmann [Mon, 16 May 2011 09:30:57 +0000 (11:30 +0200)]
usb-linux: fix max_packet_size for highspeed.
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>
Gerd Hoffmann [Mon, 16 May 2011 08:21:51 +0000 (10:21 +0200)]
usb-linux: split large xfers
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>
Gerd Hoffmann [Mon, 16 May 2011 07:20:06 +0000 (09:20 +0200)]
usb-linux: walk async urb list in cancel
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>
Gerd Hoffmann [Mon, 16 May 2011 07:13:05 +0000 (09:13 +0200)]
usb-linux: track aurbs in list
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>
Gerd Hoffmann [Tue, 10 May 2011 10:07:42 +0000 (12:07 +0200)]
usb-linux: add hostport property
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>
Gerd Hoffmann [Tue, 10 May 2011 09:43:57 +0000 (11:43 +0200)]
usb-linux: fix device path aka physical port handling
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>
Hans de Goede [Wed, 2 Feb 2011 16:36:29 +0000 (17:36 +0100)]
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 almost
identical code.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Wed, 2 Feb 2011 15:33:13 +0000 (16:33 +0100)]
usb: Pass the packet to the device's handle_control callback
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>
Jan Vesely [Mon, 9 May 2011 10:16:50 +0000 (12:16 +0200)]
Bug #757654: UHCI fails to signal stall response patch
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>
Brad Hards [Sun, 3 Apr 2011 05:33:21 +0000 (15:33 +1000)]
usb: add support for "grouped" interfaces and the Interface Association 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>
Brad Hards [Sun, 3 Apr 2011 05:33:20 +0000 (15:33 +1000)]
usb: remove fallback to bNumInterfaces if no .nif
All callers have been updated.
Signed-off-by: Brad Hards <bradh@frogmouth.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Brad Hards [Sun, 3 Apr 2011 05:33:19 +0000 (15:33 +1000)]
usb: update config descriptors to identify number of interfaces
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>
Brad Hards [Sun, 3 Apr 2011 05:33:18 +0000 (15:33 +1000)]
usb: Add Interface Association Descriptor descriptor type
Signed-off-by: Brad Hards <bradh@frogmouth.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Anthony Liguori [Wed, 25 May 2011 12:04:13 +0000 (07:04 -0500)]
Merge remote-tracking branch 'kraxel/CVE-2011-1751' into staging
Peter Maydell [Mon, 23 May 2011 09:13:47 +0000 (10:13 +0100)]
configure: Document --disable-slirp option in --help
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>
Peter Maydell [Mon, 23 May 2011 15:04:42 +0000 (16:04 +0100)]
target-arm/exec.h: Remove unused #define of M0
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>
Peter Maydell [Thu, 19 May 2011 13:46:16 +0000 (14:46 +0100)]
target-arm: Signal InvalidOp for Neon GE and GT compares of QNaN
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>
Peter Maydell [Thu, 19 May 2011 13:46:19 +0000 (14:46 +0100)]
target-arm: Use correct float status for Neon int-float conversions
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>
Peter Maydell [Thu, 19 May 2011 13:46:18 +0000 (14:46 +0100)]
target-arm: Signal Underflow when denormal flushed to zero on output
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>
Peter Maydell [Thu, 19 May 2011 13:46:17 +0000 (14:46 +0100)]
softfloat: Add new flag for when denormal result is flushed to zero
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>
Peter Maydell [Thu, 19 May 2011 13:46:15 +0000 (14:46 +0100)]
target-arm: Signal InputDenormal for VRECPE, VRSQRTE, VRECPS, VRSQRTS
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>
Peter Maydell [Thu, 19 May 2011 13:46:14 +0000 (14:46 +0100)]
target-arm: Don't set FP exceptions in recip, recip_sqrt estimate fns
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>
Aurelien Jarno [Tue, 17 May 2011 16:25:45 +0000 (18:25 +0200)]
tcg: don't keep dead outputs in registers
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>
Aurelien Jarno [Tue, 17 May 2011 16:25:45 +0000 (18:25 +0200)]
tcg: mark dead output argument in op_dead_args
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>
Aurelien Jarno [Tue, 17 May 2011 16:25:45 +0000 (18:25 +0200)]
tcg: replace op_dead_iargs by op_dead_args
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>
Aurelien Jarno [Mon, 23 May 2011 20:36:17 +0000 (22:36 +0200)]
Merge branch 'trivial-patches' of git://repo.or.cz/qemu/stefanha
* 'trivial-patches' of git://repo.or.cz/qemu/stefanha:
Fix typos in comments (chek -> check)
hw/sd.c: Don't complain about SDIO commands CMD52/CMD53
hw/realview.c: Remove duplicate #include line
piix_pci: fix piix3_set_irq_pic()
Aurelien Jarno [Mon, 23 May 2011 20:35:37 +0000 (22:35 +0200)]
Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
* 'ppc-next' of git://repo.or.cz/qemu/agraf:
Fix a bug in mtsr/mtsrin emulation on ppc64
pSeries: Clean up write-only variables
w32: Fix compilation and replace non-portable usage of ulong
Aurelien Jarno [Mon, 23 May 2011 20:33:39 +0000 (22:33 +0200)]
Merge branch 's390-next' of git://repo.or.cz/qemu/agraf
* 's390-next' of git://repo.or.cz/qemu/agraf:
s390x: complain when allocating ram fails
s390x: fix memory detection for guests > 64GB
s390x: change mapping base to allow guests > 2GB
s390x: Fix debugging for unknown sigp order codes
s390x: build s390x by default
s390x: remove compatibility cc field
s390x: Adjust GDB stub
s390x: translate engine for s390x CPU
s390x: Adjust internal kvm code
s390x: Implement opcode helpers
s390x: helper functions for system emulation
s390x: Shift variables in CPUState for memset(0)
s390x: keep hint on virtio managing size
s390x: make kvm exported functions conditional on kvm
s390x: s390x-linux-user support
tcg: extend max tcg opcodes when using 64-on-32bit
s390x: fix smp support for kvm
Stefan Weil [Sat, 30 Apr 2011 20:49:26 +0000 (22:49 +0200)]
Fix typos in comments (chek -> check)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Peter Maydell [Fri, 20 May 2011 09:11:53 +0000 (10:11 +0100)]
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 use
these in their probing for presence of an SDIO card.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Peter Maydell [Thu, 19 May 2011 15:21:57 +0000 (16:21 +0100)]
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>
TeLeMan [Mon, 16 May 2011 11:50:55 +0000 (19:50 +0800)]
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>
Blue Swirl [Sat, 14 May 2011 11:55:30 +0000 (11:55 +0000)]
Delete unused tb_invalidate_page_range
tb_invalidate_page_range() was intended to be used to invalidate an
area of a TB which the guest explicitly flushes from i-cache. However,
QEMU detects writes to code areas where TBs have been generated, so
his has never been useful.
Delete the function, adjust callers.
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
David Gibson [Fri, 20 May 2011 03:34:59 +0000 (13:34 +1000)]
Fix a bug in mtsr/mtsrin emulation on ppc64
Early ppc64 CPUs include a hack to partially simulate the ppc32 segment
registers, by translating writes to them into writes to the SLB. This is
not used by any current Linux kernel, but it is used by the openbios used
in the qemu mac99 model.
Commit
81762d6dd0d430d87024f2c83e9c4dcc4329fb7d, cleaning up the SLB
handling introduced a bug in this code, breaking the openbios currently in
qemu. Specifically, there was an off by one error bitshuffling the
register format used by mtsr into the format needed for the SLB load,
causing the flag bits to end up in the wrong place. This caused the
storage keys to be wrong under openbios, meaning that the translation code
incorrectly thought a legitimate access was a permission violation.
This patch fixes the bug, at the same time it fixes some build bug in the
MMU debugging code (only exposed when DEBUG_MMU is enabled).
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
David Gibson [Tue, 17 May 2011 06:47:04 +0000 (16:47 +1000)]
pSeries: Clean up write-only variables
A few pieces of the pSeries emulation code have variables which are set
but never used, which causes warnings on gcc 4.6. This patch removes
these instances.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
Stefan Weil [Sat, 14 May 2011 23:38:04 +0000 (23:38 +0000)]
w32: Fix compilation and replace non-portable usage of ulong
ulong is undefined for w32 (and maybe other) compilations.
Replace it by uintptr_t (which also fixes compilation for w64
and is a better choice for pointer to integer conversions).
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
Alexander Graf [Fri, 20 May 2011 15:33:28 +0000 (17:33 +0200)]
s390x: complain when allocating ram fails
While trying out the > 64GB guest RAM patch, I hit some virtual address
limitations of my host system, which resulted in mmap failing. Unfortunately,
qemu didn't tell me about this failure, but just used the NULL pointer
happily, resulting in either segmentation faults or other fun errors.
To spare other users from tracing this down, let's print a nice message
instead so the user can figure out what's wrong from there.
Signed-off-by: Alexander Graf <agraf@suse.de>
Christian Borntraeger [Thu, 12 May 2011 08:50:44 +0000 (10:50 +0200)]
s390x: fix memory detection for guests > 64GB
the s390 memory detection has a 16bit field that specifies the amount of
increments. This patch adopts the memory size to always fit into that
scheme. This also fixes virtio detection for these guests, since the
descriptor page is located after the main memory.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Christian Borntraeger [Tue, 10 May 2011 12:49:10 +0000 (14:49 +0200)]
s390x: change mapping base to allow guests > 2GB
the current s390x qemu memory layout is
0x1000000: guest start
0x80000000: qemu binary
which limits the amount of available memory to <2GB.
This patch moves the guest pages to 32GB to not collide with the binary
and to leave some space for the program break of qemu.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Christian Borntraeger [Wed, 4 May 2011 08:30:12 +0000 (10:30 +0200)]
s390x: Fix debugging for unknown sigp order codes
On unknown sigp order codes we print a debug message. This patch
fixes the output, since we want to see the order_code and not
the register numbers.
Patch applies on agraf tree.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Alexander Graf [Wed, 23 Mar 2011 07:23:47 +0000 (08:23 +0100)]
s390x: build s390x by default
This patch enables building of s390x-softmmu and s390x-linux-user
targets by default.
Signed-off-by: Alexander Graf <agraf@suse.de>
Alexander Graf [Wed, 13 Apr 2011 11:30:00 +0000 (13:30 +0200)]
s390x: remove compatibility cc field
Remove the now unused cc field that was only required to not break
bisectability.
Signed-off-by: Alexander Graf <agraf@suse.de>
Alexander Graf [Wed, 23 Mar 2011 09:58:07 +0000 (10:58 +0100)]
s390x: Adjust GDB stub
We have successfully lazilized cc computation, so we need to manually
trigger its calculation when gdb wants to fetch it. We also changed the
variable name, so writing it writes into a different field now.
Signed-off-by: Alexander Graf <agraf@suse.de>
Alexander Graf [Wed, 23 Mar 2011 09:58:07 +0000 (10:58 +0100)]
s390x: translate engine for s390x CPU
This is the main meat part of the patch set. It implements emulation for an
s390x CPU.
The code does all the optimizations that are common for TCG code:
- direct branches
- cc optimization
- unrolling of simple microcode loops
I'm still open for suggestions on speedups of course :).
Signed-off-by: Alexander Graf <agraf@suse.de>
Alexander Graf [Wed, 23 Mar 2011 09:58:07 +0000 (10:58 +0100)]
s390x: Adjust internal kvm code
We're now finally emulating an s390x CPU, so we can move quite some logic
from the kvm code out into generic CPU code.
This patch does this and adjusts the interfaces according to what the code
around now expects to be able to call.
Signed-off-by: Alexander Graf <agraf@suse.de>
Alexander Graf [Wed, 23 Mar 2011 09:58:07 +0000 (10:58 +0100)]
s390x: Implement opcode helpers
There are some instructions that can't (or shouldn't) be expressed by pure
tcg code. For those, we call into externally compiled C functions.
This patch implements those C functions.
Signed-off-by: Alexander Graf <agraf@suse.de>
Alexander Graf [Wed, 23 Mar 2011 09:58:07 +0000 (10:58 +0100)]
s390x: helper functions for system emulation
When running system emulation, we need to transverse through the MMU and
deliver interrupts according to the specification.
This patch implements those two pieces and in addition adjusts the CPU
initialization code to account for the new fields in CPUState.
Signed-off-by: Alexander Graf <agraf@suse.de>
Alexander Graf [Mon, 2 May 2011 08:11:40 +0000 (10:11 +0200)]
s390x: Shift variables in CPUState for memset(0)
The default reset handler does a memset(0) until right in between CPU_COMMON.
I incorrectly changed that behavior on the s390x port, so let's move the fields
in CPUState around to reflect the correct split up to which point memset(0)
zeros out everything.
Signed-off-by: Alexander Graf <agraf@suse.de>
Alexander Graf [Wed, 13 Apr 2011 08:55:11 +0000 (10:55 +0200)]
s390x: keep hint on virtio managing size
The s390x virtio bus keeps management information on virtio after the top
of the guest's RAM. We need to be able to tell the guest the size of its
RAM (without virtio stuff), but also be able to trap when the guest accesses
RAM outside of its scope (including virtio stuff).
So we need a variable telling us the size of the virtio stuff, so we can
calculate the highest available RAM address from that.
While at it, also increase the maximum number of virtio pages, so we play
along well with more recent kernels that spawn a ridiculous number of virtio
console adapters.
Signed-off-by: Alexander Graf <agraf@suse.de>