Commit Graph

5194 Commits

Author SHA1 Message Date
Gerd Hoffmann e7e73892a6 usb-hid: fixup changed tracking.
Remove leftover calls to usb_hid_changed().

Take care to update the changed flag after delivering a event via
GET_REPORT like we do when sending events via interrupt endpoint.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-22 13:36:31 +02:00
Hervé Poussineau cd3e2409a3 ds1225y: convert to qdev device, and use it in MIPS Jazz emulation
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-20 20:54:51 +00:00
Hervé Poussineau d43ed9ec25 ds1225y: use trace framework
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-20 20:54:50 +00:00
Hervé Poussineau 86f25c7c37 ds1225y: Remove protection stuff, which doesn't belong to this device
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-20 20:54:49 +00:00
Gerd Hoffmann 98e51ec92e usb-serial doesn't support migration
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 14:49:41 +02:00
Gerd Hoffmann 4ab0ba9e26 usb-net doesn't support migration
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 14:49:41 +02:00
Gerd Hoffmann 2474e5052b usb-bt doesn't support migration
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 14:49:41 +02:00
Gerd Hoffmann ccce9fd205 usb-wacom doesn't support migration
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 14:49:41 +02:00
Gerd Hoffmann f54b656303 usb storage: first migration support bits.
Tag vmstate as unmigratable for the time being,
to be removed when mgration support is finished.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 14:49:41 +02:00
Gerd Hoffmann 9490fb0624 ehci doesn't support migration
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 14:49:41 +02:00
Gerd Hoffmann b7ce1b27f6 ahci doesn't support migration
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 14:49:41 +02:00
Yonit Halperin 8927cfbba2 qxl: upon reset, if spice worker is stopped, the command rings can be not empty
Spice worker does no longer process commands when it is stopped.
Otherwise, it might crash during migration when attempting to process
commands while the guest is not completely loaded.

Cc: Alon Levy <alevy@redhat.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 10:08:53 +02:00
Gerd Hoffmann 2837c8ea1f vmstate: add no_migrate flag to VMStateDescription
This allows to easily tag devices as non-migratable,
so any attempt to migrate a virtual machine with the
device in question active will make migration fail.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 09:23:33 +02:00
Hannes Reinecke 3e1c0c9a4b scsi-disk: Mask out serial number EVPD
If the serial number is not set we should mask it out in the
list of supported VPD pages and mark it as not supported.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-07-19 15:39:05 +02:00
Hannes Reinecke 653c1c3fb6 scsi-disk: Fixup debugging statement
A debugging statement wasn't converted to the new interface.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-07-19 15:39:05 +02:00
Hannes Reinecke c5bf71a9a3 scsi: Add 'hba_private' to SCSIRequest
'tag' is just an abstraction to identify the command
from the driver. So we should make that explicit by
replacing 'tag' with a driver-defined pointer 'hba_private'.
This saves the lookup for driver handling several commands
in parallel.
'tag' is still being kept for tracing purposes.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-07-19 15:38:58 +02:00
Anthony Liguori 03ff09580e Merge remote-tracking branch 'agraf/xen-next' into staging 2011-07-19 08:04:35 -05:00
Anthony Liguori b4dabf9587 Merge remote-tracking branch 'kraxel/usb.19' into staging 2011-07-19 08:03:20 -05:00
Anthony Liguori de20fbcac9 Merge remote-tracking branch 'spice/spice.v38' into staging 2011-07-19 08:02:35 -05:00
Anthony Liguori 6734529435 Merge remote-tracking branch 'mst/for_anthony' into staging 2011-07-19 07:43:54 -05:00
Hannes Reinecke 348e7b8dcd iov: Update parameter usage in iov_(to|from)_buf()
iov_to_buf() has an 'offset' parameter, iov_from_buf() hasn't.
This patch adds the missing parameter to iov_from_buf().
It also renames the 'offset' parameter to 'iov_off' to
emphasize it's the offset into the iovec and not the buffer.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-07-18 16:06:27 +02:00
Amit Shah 0219d73283 virtio-console: Prevent abort()s in case of host chardev close
A host chardev could close just before the guest sends some data to be
written.  This will cause an -EPIPE error.  This shouldn't be propagated
to virtio-serial-bus.

Ideally we should close the port once -EPIPE is received, but since the
chardev interface doesn't return such meaningful values to its users,
all we get is -1 for any kind of error.  Just return 0 for now and wait
for chardevs to return better error messages to act better on the return
messages.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-07-18 15:30:15 +05:30
Amit Shah 95c9cde2df virtio-serial-bus: Fix trailing \n in error_report string
Markus fixed offenders in the file but one instance sneaked in via
another patch.  Fix it.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-07-18 15:30:15 +05:30
Amit Shah d02e4fa4a8 virtio-console: Add some trace events
Add some trace events for messages passed between the char layer and the
virtio-serial bus.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-07-18 15:30:14 +05:30
Amit Shah 49e3fdd7f2 virtio-serial-bus: Add trace events
Add some trace events for messages passed between the guest and host.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-07-18 15:30:14 +05:30
Michael S. Tsirkin c8eac1cfa1 virtio: fix indirect descriptor buffer overflow
We were previously allowing arbitrarily-long indirect descriptors, which
could lead to a buffer overflow in qemu-kvm process.

CVE-2011-2212

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-17 18:47:34 +03:00
Michael S. Tsirkin 0d2b962d16 xen: move to new pci initializers
move ids to pci info structure

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-17 18:47:34 +03:00
Anthony PERARD ce4fd422a6 hw/piix_pci.c: Fix PIIX3-xen to initialize ids
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-17 18:47:34 +03:00
Michael S. Tsirkin 33d5ad53c1 pci_ids: tweak names to match linux/pci_ids.h
Sync xen names to ones used by linux. Add
xen platform device id as well.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-17 18:47:34 +03:00
Michael S. Tsirkin c1be973ae1 vhost: fix double free on device stop
vhost dev stop failed to clear the log field.
Typically not an issue as dev start overwrites this field,
but if logging gets disabled before the following start,
it doesn't so this causes a double free.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-17 18:47:33 +03:00
Alexander Graf 25a118130f xen_console: fall back to qemu serial device
The new xen_console protocol changed the default xen_console output device
from whatever Qemu chose to whatever xenstore choses and "pty" as fallback.

This is not how Qemu works. It has its own serial redirection semantics. So
it xenstore doesn't contain information on what to do, Qemu is the place to
ask.

Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17 01:54:25 +02:00
Stefano Stabellini 0f51726adc xen_console: support the new extended xenstore protocol
Since CS 21994 on xen-unstable.hg and CS
466608f3a32e1f9808acdf832a5843af37e5fcec on qemu-xen-unstable.git, few
changes have been introduced to the PV console xenstore protocol, as
described by the document docs/misc/console.txt under xen-unstable.hg.

From the Qemu point of view, very few modifications are needed to
correctly support the protocol: read from xenstore the "output" node
that tell us what the output of the PV console is going to be.
In case the output is a tty, write to xenstore the device name.

Changes in v2:

- fix error paths: free malloc'ed strings and close the xenstore
connection before returning;

- remove useless snprintf in xenstore_store_pv_console_info if i == 0.

Changes in v3:

- replace xs_daemon_open/xs_daemon_close with xs_open/xs_close.

Changes in v4:

- add a compatibility implementation of xs_open/xs_close.

Changes in v5:

- fix code style.

[agraf] fix build error due to missing stub

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17 01:54:25 +02:00
Stefano Stabellini 7cef3f4fdb xen_disk: treat "aio" as "raw"
Sometimes the toolstack uses "aio" without an additional format
identifier, in such cases use "raw".

Updated in v2:

- fix code style.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17 01:54:25 +02:00
Stefano Stabellini 5ea3c2b405 xen_disk: cope with missing xenstore "params" node
When disk is a cdrom and the drive is empty the "params" node in
xenstore might be missing completely: cope with it instead of
segfaulting.

Updated in v2:

- actually removed the strchr(blkdev->params, ':') that caused the
segfault;

- free all the allocated strings from xenstore before returning;

Updated in v3:

- set blkdev fields to NULL after free'ing them.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17 01:54:25 +02:00
Stefano Stabellini 37cdfcf194 xen: add vkbd support for PV on HVM guests
Register the vkbd backend even when running as device emulator for HVM
guests: it is useful because it doesn't need a frequent timer like usb.

Check whether the XenInput DisplayState has been set in the initialise
state, rather than the input state.
In case the DisplayState hasn't been set and there is no vfb for this
domain, then set the XenInput DisplayState to the default one.

Changed in v2:

- use qemu_free instead of free;

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17 01:54:25 +02:00
Stefano Stabellini 5e6b701aba xen_console: fix memory leak
con_init leaks the string "type", fix it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17 01:54:25 +02:00
Jan Kiszka 868bb33faa xen: Fold CONFIG_XEN_MAPCACHE into CONFIG_XEN
Xen won't be enabled if there is no backend support available for the
host. And that also means the map cache will work. So drop the separate
config switch and move the required stubs over to xen-stub.c.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17 01:54:24 +02:00
Hervé Poussineau 429bef6912 esp: cancel current request only if some request is in flight
This bug was introduced in 94d3f98a3f3caddd7875f9a11776daeb84962a7b:
scsi_cancel_io was checking if some request was pending before trying
to cancel it, while scsi_req_cancel always cancels the request.

This may lead to a crash of Qemu due to dereferencing a NULL pointer,
as exhibited by NetBSD 5.1 installer on MIPS Magnum emulation.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 21:29:39 +00:00
Alexander Graf 06c46bbab0 spapr: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 20:00:33 +00:00
Alexander Graf 04bc74edec s390-virtio: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 20:00:32 +00:00
Alexander Graf db663d0f7a ppc405_uc: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 20:00:31 +00:00
Alexander Graf 75b0646f9e pl080: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 20:00:30 +00:00
Alexander Graf ae5d3eb474 msix: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 20:00:29 +00:00
Alexander Graf c5d29d2fec msi: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 20:00:28 +00:00
Alexander Graf 6c7796e5c1 intel-hda: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 20:00:27 +00:00
Alexander Graf 8517263fcb hpet: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 20:00:26 +00:00
Gerd Hoffmann 3dc345d587 usb-ohci: raise interrupt on attach
Got lost in commit 618c169b57,
add it back in.  Also fix codestyle while we are at it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-08 11:26:10 +02:00
Gerd Hoffmann 6c2385270b usb-hub: remove unused descriptor arrays
Somehow they where left over when converting the hub
to the new usb descriptor infrastructure ...

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-08 11:26:10 +02:00
Gerd Hoffmann dd850cf203 usb: fixup bluetooth descriptors
Commit 4696425cd0 changes some
endpoints from isocrounous to interrupt by mistake.  Fix it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-08 11:26:10 +02:00
Jes Sorensen eb3b58f96f usb_register_port(): do not set port->opaque and port->index twice
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-08 11:26:10 +02:00
Gerd Hoffmann 3028376ea0 ehci: add ich9 controller.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:02 +02:00
Gerd Hoffmann 5cc194caeb ehci: fix port count.
The ICH4 EHCI controller which we emulate has six ports not four.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:02 +02:00
Gerd Hoffmann 1b5a757067 uhci: add ich9 controllers
Add ich9 controllers,  Factor out properties to a separate
struct and reference it to reduce duplication.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:02 +02:00
Gerd Hoffmann f9ebf5e564 pci: add ich9 usb controller ids
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:02 +02:00
Hans de Goede 9c9fc3346b usb-ohci: Add support for being a companion controller
To use as a companion controller, use pci-ohci as device and set the
masterbus and num-ports properties, ie:

-device usb-ehci,addr=0b.1,multifunction=on,id=ehci0
-device pci-ohci,addr=0b.0,multifunction=on,masterbus=ehci0.0,num-ports=4

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:02 +02:00
Hans de Goede 35e4977f57 usb-uhci: Add support for being a companion controller
To use as a companion controller set the masterbus property.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:02 +02:00
Hans de Goede a0a3167a91 usb-ehci: Add support for registering companion controllers
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:02 +02:00
Hans de Goede fbd97532d2 usb-ehci: Fix handling of PED and PEDC port status bits
The PED bit should only be set for highspeed devices and the PEDC bit
should not be set on "normal" PED bit changes, only on io errors.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:02 +02:00
Hans de Goede 45b9fd3480 usb: assert on calling usb_attach(port, NULL) on a port without a dev
with the "usb-ehci: cleanup port reset handling" patch in place no callers
are calling usb_attach(port, NULL) for a port where port->dev is NULL.

Doing that makes no sense as that causes the port detach op to get called
for a port with nothing attached. Add an assert that port->dev != NULL when
dev == NULL, and remove the check for not having a port->dev in the dev == NULL
case.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:02 +02:00
Hans de Goede fbf9db6457 usb-ehci: cleanup port reset handling
Doing a usb_attach when dev is NULL will just result in the
port detach op getting called even though nothing was connected in
the first place.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:02 +02:00
Hans de Goede c44fd61c0f usb-ehci: Connect Status bit is read only, don't allow changing it by the guest
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:02 +02:00
Hans de Goede 053f9fcfb1 usb-ehci: drop unused num-ports state member
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:02 +02:00
Hans de Goede 4706ab6cc0 usb: Replace device_destroy bus op with a child_detach port op
Note this fixes 2 things in one go, first of all the device_destroy bus
op should be a device_detach bus op, as pending async packets from the
device should be cancelled on detach not on destroy.

Secondly having this as a bus op won't work with companion controllers, since
then there will be 1 bus driven by the ehci controller and thus 1 set of bus
ops, but the device being detached may be downstream of a handed over port.
Making the detach of a downstream device a port op allows the ehci controller
to forward this to the companion controller port for handed over ports.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:02 +02:00
Hans de Goede d47e59b8b8 usb: Make port wakeup and complete ops take a USBPort instead of a Device
This makes them consistent with the attach and detach ops, and in general
it makes sense to make portops take a port as argument. This also makes
adding support for a companion controller easier / cleaner.

[ kraxel: fix usb-musb.c build ]

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:02 +02:00
Hans de Goede ae60fea97c usb: Add a register_companion USB bus op.
This is a preparation patch for adding support for USB companion controllers.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:02 +02:00
Hans de Goede 3631e6c8c2 usb: Move (initial) call of usb_port_location to usb_fill_port
Cleanup / preparation patch for companion controller support. Note that
as a "side-effect" this patch also fixes the milkymist-softusb controller
not having a port_location set for its ports.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:02 +02:00
Hans de Goede 090ac6425a usb: Add a usb_fill_port helper function
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:01 +02:00
Peter Maydell 000eb4fa52 hw/usb-musb.c: Don't misuse usb_packet_complete()
In musb_packet() handle final processing of non-asynchronous
USB packets by directly calling musb_schedule_cb() rather than
going through usb_packet_complete(). The latter will trigger
an assertion because the packet doesn't belong to a device.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-05 15:09:01 +02:00
Kevin Wolf c925400ba8 ide: Initialise buffers with zeros
Just in case there's still a way how a guest can read out buffers when it's not
supposed to, let's zero the buffers during initialisation so that we don't leak
information to the guest.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
2011-07-05 11:23:43 +02:00
Kevin Wolf 40c4ed3f95 ide: Ignore reads during PIO in and writes during PIO out
This fixes https://bugs.launchpad.net/qemu/+bug/786209:

    When the DRQ_STAT bit is set, the IDE core permits both data reads
    and data writes, regardless of whether the current transfer was
    initiated as a read or write.

    This potentially leaks uninitialized host memory into the guest,
    if, before doing anything else to an IDE device, the guest begins a
    write transaction (e.g. WIN_WRITE), but then *reads* from the IO
    port instead of writing to it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
2011-07-05 11:23:42 +02:00
Markus Armbruster a8686a9b2b virtio-blk: Turn drive serial into a qdev property
It needs to be a qdev property, because it belongs to the drive's
guest part.  Precedence: commit a0fef654 and 6ced55a5.

Bonus: info qtree now shows the serial number.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-07-05 11:23:29 +02:00
Vasily Khoruzhick 9312805d33 pxa2xx_lcd: add proper rotation support
Until now, pxa2xx_lcd only supported 90deg rotation, but
some machines (for example Zipit Z2) needs 270deg rotation.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-07-04 22:12:21 +02:00
Stefan Weil 462a8bc646 arm: Add const attribute to some arm_boot_info pointers
Parameter 'info' is const, so add the missing attribute.

v2:
Add 'const' to the local variable info in do_cpu_reset() and to
the boot_info field in CPUARMState (suggested by Peter Maydell).

Cc: Andrzej Zaborowski <balrogg@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-07-04 21:58:25 +02:00
Alon Levy a3d14054d7 qxl: allow QXL_IO_LOG also in vga
The driver may change us to vga mode and still issue a QXL_IO_LOG,
which we can easily support.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-04 15:35:12 +02:00
Gerd Hoffmann 81144d1a36 qxl: put QXL_IO_UPDATE_IRQ into vgamode whitelist
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-04 15:35:12 +02:00
Yonit Halperin 868379ce69 qxl: make sure primary surface is saved on migration
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-04 15:35:12 +02:00
Alon Levy 6ebebb551a qxl: add dev id to guest prints
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-04 15:35:12 +02:00
Alon Levy 1f0ff2fb99 qxl-logger: add timestamp to command log
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-04 15:35:12 +02:00
Alon Levy 5b77870ce0 qxl: interface_get_command: fix reported mode
report correct mode when in undefined mode.
introduces qxl_mode_to_string(), and uses it in other places too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-04 15:35:12 +02:00
Gerd Hoffmann 638f4e4779 qxl: device id fixup
Move device ID to PCIDeviceInfo.
Remove support for the unused unstable device ID.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-04 15:35:12 +02:00
Hervé Poussineau 75ef849696 esp: correctly fill bus id with requested lun
This bug showed up after 1455084ea2, and
may be seen only on operating systems *not* using DMA to give commands
to SCSI adapter.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-02 18:50:19 +00:00
Blue Swirl 3b88670664 Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
* 'ppc-next' of git://repo.or.cz/qemu/agraf:
  PPC: move TLBs to their own arrays
  PPC: 440: Use 440 style MMU as default, so Qemu knows the MMU type
  PPC: E500: Use MAS registers instead of internal TLB representation
  PPC: Only set lower 32bits with mtmsr
  PPC: update openbios firmware
  PPC: mpc8544ds: Add hypervisor node
  PPC: calculate kernel,initrd,cmdline locations dynamically
  target-ppc: Handle memory-forced I/O controller access
  PPC: E500: Implement reboot controller
2011-07-01 21:12:50 +00:00
Edgar E. Iglesias 20be39de59 etraxfs-ser: Correct default value for RW_REC_CTRL
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-06-30 10:52:22 +02:00
Anthony Liguori 656acddb39 Merge remote-tracking branch 'kraxel/usb.17' into staging 2011-06-27 14:59:08 -05:00
Anthony Liguori c45d1fc191 Merge remote-tracking branch 'amit/for-anthony' into staging 2011-06-27 11:27:15 -05:00
Anthony Liguori bb820c03e2 Merge remote-tracking branch 'stefanha/trivial-patches' into staging 2011-06-27 11:25:23 -05:00
Luiz Capitulino d2e4d08b3e virtio-serial: Fix segfault on guest boot
If I start qemu with:

  # qemu -hda disks/test.img -enable-kvm -m 1G -snapshot \
         -device virtio-serial \
         -chardev socket,host=localhost,port=1234,server,nowait,id=foo \
         -device virtserialport,chardev=foo,name=org.qemu.guest_agent

I get a segfault when booting a Fedora 14 guest. The backtrace says:

  Program terminated with signal 11, Segmentation fault.
    #0  0x0000000000420850 in handle_control_message (vser=0x3732bd0, buf=0x2c173e0, len=8) at /home/lcapitulino/src/qmp-unstable/hw/virtio-serial-bus.c:335
    335     info = DO_UPCAST(VirtIOSerialPortInfo, qdev, port->dev.info);

What's happening is VIRTIO_CONSOLE_DEVICE_READY is a message for the
whole device, not for an individual port. So port is NULL. This bug was
introduced by commit a15bb0d6a9.

This commit fixes that by making the port returned by find_port_by_id()
be used only by the VIRTIO_CONSOLE_PORT_READY and
VIRTIO_CONSOLE_PORT_OPEN messages.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-06-27 15:04:54 +05:30
Blue Swirl 2b41f10e18 Remove exec-all.h include directives
Most exec-all.h include directives are now useless, remove them.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:35 +00:00
Jan Kiszka af2be20777 Fix fallouts from Linux header inclusion
This is an all-in-one fix for the smaller and bigger mistakes of the
build system changes for accompanied Linux headers:
 - only enable KVM and vhost on Linux hosts
 - fix powerpc asm header symlink
 - do not use Linux headers on non-Linux hosts
 - fix kvmclock for !CONFIG_KVM
 - fix s390 build on non-Linux hosts

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Tested-by: Andreas Färber <andreas.faerber@web.de>
Tested-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 17:35:47 +00:00
Matthew Fernandez 2167f7bc28 Fix comment typos in hw/armv7m.c
Fix a couple of typos in comments.

Signed-off-by: Matthew Fernandez <matthew.fernandez@gmail.com>
Acked-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24 09:13:37 +01:00
Markus Armbruster dd3d677512 Spell "unkown" correctly in error_report() arguments
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24 09:13:37 +01:00
Markus Armbruster 6daf194dde Strip trailing '\n' from error_report()'s first argument
error_report() prepends location, and appends a newline.  The message
constructed from the arguments should not contain a newline.  Fix the
obvious offenders.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24 09:13:36 +01:00
Gerd Hoffmann a7fb71d1b2 usb: ignore USB_DT_DEBUG
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 17:15:55 +02:00
Markus Armbruster c3a90cb120 usb-storage: Turn drive serial into a qdev property usb-storage.serial
It needs to be a qdev property, because it belongs to the drive's
guest part.  Precedence: commit a0fef654 and 6ced55a5.

Bonus: info qtree now shows the serial number.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 17:09:31 +02:00
Peter Maydell f3dc0051dc hw/usb-ohci.c: Fix handling of remote wakeup corner cases
Correct a number of minor errors in the OHCI wakeup implementation:
 * when the port is suspended but the controller is not, raise RHSC
 * when the controller is suspended but the port is not, raise RD
 * when the controller is suspended, move it to resume state

These fix some edge cases where a USB device might not successfully get
the attention of the guest OS if it tried to do so at the wrong time.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 11:28:07 +02:00
Hans de Goede bf5547f536 usb-bus: Don't allow speed mismatch while attaching devices
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 11:28:07 +02:00
Hans de Goede ba3f9bfba9 usb: Add a speedmask to devices
This is used to indicate at which speed[s] the device can operate,
so that this can be checked to match the ports capabilities when it gets
attached to a bus.

Note that currently all usb1 emulated device claim to be fullspeed, this
seems to not cause any problems, but still seems wrong, because with real
hardware keyboards, mice and tablets usually are lo-speed, so reporting these
as fullspeed devices seems wrong.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 11:28:06 +02:00
Hans de Goede fa19bf831b usb: Proper error propagation for usb_device_attach errors
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 11:28:06 +02:00
Hans de Goede ee210d6390 usb-bus: Don't allow attaching a device to a bus with no free ports
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 11:28:06 +02:00
Gerd Hoffmann adddecb169 ehci: switch to nanoseconds
Make ehci use nanoseconds everywhere.
Simplifies time calculations.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 11:28:06 +02:00
Gerd Hoffmann 16a2dee6b9 ehci: add freq + maxframes properties
Add properties for the wakeup rate and the max number of frames ehci
will process at once.

The wakeup rate defaults to 1000 which equals the usb frame rate.  This
can be reduced to make qemu wake up less often when ehci is active.

In case the wakeup rate is reduced or the ehci timer is delayed due to
latency issues elsewhere in qemu ehci will process multiple frames at
once.  The maxframes property specifies the upper limit for this.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 11:28:06 +02:00
Peter Maydell 48e2faf222 net: Warn about "-net nic" options which were ignored
Diagnose the case where the user asked for a NIC via "-net nic"
but the board didn't instantiate that NIC (for example where the
user asked for two NICs but the board only supports one). Note
that this diagnostic doesn't apply to NICs created through -device,
because those are always instantiated.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-22 07:18:39 -05:00
Avi Kivity f8e378f27f Optimize screendump
When running kvm-autotest, fputc() is often the second highest (sometimes #1)
function showing up in a profile.  This is due to fputc() locking the file
for every byte written.

Optimize by buffering a line's worth of pixels and writing that out in a
single call.

Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-22 07:18:38 -05:00
Anthony Liguori d6034a3a61 Merge remote-tracking branch 'qemu-kvm/uq/master' into staging 2011-06-22 07:13:10 -05:00
Anthony Liguori fdba9594df Merge remote-tracking branch 'mst/for_anthony' into staging
Conflicts:
	hw/usb-uhci.c
2011-06-22 07:11:09 -05:00
Anthony Liguori 7ee28fd303 Merge remote-tracking branch 'agraf/xen-next' into staging 2011-06-22 07:07:55 -05:00
Jan Kiszka 5802e066eb kvm: Drop CONFIG_KVM_PARA
The kvm_para.h header is now always available.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-06-20 15:16:45 -03:00
Christophe Fergeau bf79d49982 lsi: Fix unused-but-set-variable warning
This warning is new in gcc 4.6.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-20 16:42:35 +01:00
Steven Smith 01195b7347 xen: Add the Xen platform pci device
Introduce a new emulated PCI device, specific to fully virtualized Xen
guests.  The device is necessary for PV on HVM drivers to work.

Signed-off-by: Steven Smith <ssmith@xensource.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-19 04:43:04 +02:00
Stefano Stabellini bf09551a6b xen: fix interrupt routing
Compared to the last version I only added a comment to the code.

- remove i440FX-xen and i440fx_write_config_xen
we don't need to intercept pci config writes to i440FX anymore;

- introduce PIIX3-xen and piix3_write_config_xen
we do need to intercept pci config write to the PCI-ISA bridge to update
the PCI link routing;

- set the number of PIIX3-xen interrupts line to 128;

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-19 04:42:57 +02:00
Stefano Stabellini 45dcd36e1e cirrus_vga: reset lfb_addr after a pci config write if the BAR is unmapped
If the cirrus_vga PCI BAR is unmapped than we should not only reset
map_addr but also lfb_addr, otherwise we'll keep trying to map
the old lfb_addr in map_linear_vram.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-19 04:40:05 +02:00
Anthony PERARD b87de24e6c xen: Add xc_domain_add_to_physmap to xen_interface.
This function will be used to support sync dirty bitmap.

This come with a check against every Xen release, and special
implementation for Xen version that doesn't have this specific call.

This function will not be usable with Xen 3.3 because the behavior is
different.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-19 04:40:04 +02:00
Alexander Graf 1c53acccee PPC: move TLBs to their own arrays
Until now, we've created a union over multiple different TLB types and
allocated that union. While it's a waste of memory (and cache) to allocate
TLB information for a TLB type with much information when you only need
little, it also inflicts another issue.

With the new KVM API, we can now share the TLB between KVM and qemu, but
for that to work we need to have both be in the same layout. We can't just
stretch it over to fit some internal different TLB representation.

Hence this patch moves all TLB types to their own array, allowing us to only
address and allocate exactly the boundaries required for the specific TLB
type at hand.

Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-17 02:58:37 +02:00
Alexander Graf 0dd4bc7dd4 PPC: 440: Use 440 style MMU as default, so Qemu knows the MMU type
We have some KVM interaction code in Qemu that tries to be clever and
ignore some capabilities when running on BookE style MMUs. Unfortunately,
the default CPU bamboo was defaulting to was not a BookE-style MMU,
resulting in the check to fail.

With this patch, guests can run again on 440 with -enable-kvm.

Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-17 02:58:35 +02:00
Alexander Graf d1e256fe47 PPC: E500: Use MAS registers instead of internal TLB representation
The natural format for e500 cores to do TLB manipulation with are the MAS
registers. Instead of converting them into some internal representation
and back again when the guest reads them, we can just keep the data
identical to the way the guest passed it to us.

The main advantage of this approach is that we're getting closer to being
able to share MMU data with KVM using shared memory, so that we don't need
to copy lots of MMU data back and forth all the time. For this to work
however, another patch is required that gets rid of the TLB union, as that
destroys our memory layout that needs to be identical with the kernel one.

Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-17 02:58:34 +02:00
Alexander Graf 5de6b46db5 PPC: mpc8544ds: Add hypervisor node
When running a PPC guest with KVM that can do PV operations, we need
to indicate the guest which instructions to use for a hypercall and
that it is running as KVM guest.

This logic was available on openbios based machines already. This patch
also adds said functionality to the mpc8544ds machine.

Signed-off-by: Alexander Graf <agraf@suse.de>
Acked-by: Scott Wood <scottwood@freescale.com>
2011-06-17 02:58:28 +02:00
Alexander Graf b9e17a3453 PPC: calculate kernel,initrd,cmdline locations dynamically
During testing, I was generating a vmlinux binary that easily occupied
more than 20MB of RAM. Since the current -kernel code loads the initrd
at a fixed address behind the kernel, we were overwriting kernel data
when the kernel got too big.

To finally get rid of the issue, let's calculate the initrd and cmdline
addresses relative to the kernel size, so we can have kernels and initrds
that are as big as they want to - as long as they fit in RAM.

Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-17 02:58:27 +02:00
Alexander Graf b0fb84236d PPC: E500: Implement reboot controller
When Linux reboots an e500 VM, it writes to a magic register in the
"global-utilities" device indicated by the device tree. We were not
emulating that device so far, rendering the VM reboot-less.

This patch implements that device with only the reboot functionality
implemented and adds it to the device tree. With this patch applied,
I can successfully reboot a -M mpc8544ds VM.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Andreas Färber <andreas.faerber@web.de>
2011-06-17 02:58:23 +02:00
Michael S. Tsirkin 0e6264db2c wdt: remove unused variables
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2011-06-16 00:20:12 +03:00
Michael S. Tsirkin 9047c0b406 usb-ehci: move device/vendor/class id to qdev
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-06-15 18:32:08 +03:00
Michael S. Tsirkin cdfdec7f10 ppce500: move device/vendor/class id to qdev
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-06-15 18:32:08 +03:00
Isaku Yamahata c2afc92290 pci: don't call qdev pci init method
As pci id initialization is moved to common layer,
some initialization function can be empty.
So don't call init method if NULL.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-06-15 18:32:08 +03:00
Michael S. Tsirkin befeac45d4 Merge remote-tracking branch 'origin/master' into pci
Conflicts:
	hw/virtio-pci.c
2011-06-15 18:27:15 +03:00
Peter Maydell eb47d7c5d9 hw/9118.c: Implement active-low interrupt support
The 9118 ethernet controller interrupt line is active low unless
the IRQ config register is programmed to set both the IRQ_POL
(polarity: active-high) and IRQ_TYPE (type: push-pull) bits:
implement support for inverting the irq output in other configurations.
This also requires that we support setting the bits in the first
place, and that we correctly preserve them across software reset.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-06-15 13:23:37 +02:00
Juha Riihimäki 1e36f6a5b5 smc91c111: qdevify reset
Register the smc91c111 reset function as a qdev reset function.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-15 19:46:46 +00:00
Anthony Liguori f897235e0a Merge remote-tracking branch 'kraxel/usb.16' into staging 2011-06-15 09:03:22 -05:00
Anthony Liguori 1f8bedba79 Merge remote-tracking branch 'kwolf/for-anthony' into staging 2011-06-15 09:02:18 -05:00
Kevin Wolf ee752da74f ide: Clear error_status after restarting flush
Clearing the error status flag was missing for restarting flushes. Now that the
error status is separate from the BM status register, we can simply set it to 0
after restarting the request. This ensures that we never forget to clear a bit.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15 15:39:13 +02:00
Christoph Hellwig d353fb72f5 ide: add TRIM support
Add support for TRIM sub function of the data set management command,
and wire it up to the qemu discard infrastructure.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15 14:36:16 +02:00
Christoph Hellwig 4e1e00515e ide: allow other dma comands than read and write
Replace the is_read flag with a dma_cmd flag to allow the dma and
restart logic to handler other commands like TRIM.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15 14:36:16 +02:00
Kevin Wolf 0754f9ecef ide: Add forgotten VMSTATE_END_OF_LIST in subsection
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15 14:36:16 +02:00
Kevin Wolf fdc650d76d ide: Fix ide_drive_pio_state_needed()
When a failed PIO request caused the VM to stop, we still need to transfer the
PIO state even though DRQ=0 at this point.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15 14:36:15 +02:00
Kevin Wolf def93791f2 ide: Split error status from status register
When adding the werror=stop mode, some flags were added to s->status
which are used to determine what kind of operation should be restarted
when the VM is continued.

Unfortunately, it turns out that s->status is in fact a device register
and as such is visible to the guest (some of the abused bits are even
writable for the guest).

For migration we keep on using the old VMState field (renamed to
migration_compat_status) if the status register doesn't use any of the
previously abused bits. If it does, we use a subsection with a clean copy of
the status register.

The error status is always sent in a subsection if there is any error. It can't
use the old field because errors happen even without PCI.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15 14:36:15 +02:00
Markus Armbruster 6df658f55c usb-ccid: Plug memory leak on qdev exit()
ccid_initfn() allocates CCIDBus dynamically, but there is no exit
callback to free it.

Fix by getting rid of the allocation.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
2011-06-14 09:34:35 -05:00
Michael Tokarev 35f7546206 print meaningful error message in case of --disable-vhost-net
When qemu gets compiled without support of vhost-net, any attempt
to use it fails with a very clear error message:

 qemu-system-x86_64: -netdev ...,vhost=on: vhost-net requested but could not be initialized

there's absolutely no reason given _why_ it coult not be
initialized, and even strace'ing the process in question
does not reveal any errors.  So print a message telling
what's going on.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-06-14 16:48:04 +03:00
Michael S. Tsirkin b91cb44215 virtio: compat event idx support
Disable event index for compat machine types.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-06-14 16:48:00 +03:00
Gerd Hoffmann 94cc916a8c usb-uhci: fix expire time initialization.
expire_time must be initialited when the guest activates the
usb scheduler, not at device creation time.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14 12:56:50 +02:00
Peter Maydell 9bba1eb180 hw/usb-ohci.c: Implement remote wakeup
Implement the wakeup callback in the OHCI USBPortOps, so that when
a downstream device wakes up it correctly causes the OHCI controller
to come out of suspend.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14 12:56:50 +02:00
Peter Maydell 4b0315d7ed hw/usb-ohci.c: Ignore writes to HcPeriodCurrentED register
HcPeriodCurrentED is read-only, but Linux writes to it anyway; silently
ignore this rather than printing a warning message.

(Specifically, drivers/usb/host/ohci-hub.c:ohci_rh_resume() writes a
0, in at least kernels 2.6.25 through 2.6.39.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14 12:56:50 +02:00
Brad Hards 4001f22ffd usb: Use defines for serial bus release number register for EHCI
Signed-off-by: Brad Hards <bradh@frogmouth.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14 12:56:50 +02:00
Brad Hards e59d33a734 usb: Use defines for serial bus release number register for UHCI
Signed-off-by: Brad Hards <bradh@frogmouth.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14 12:56:50 +02:00
Brad Hards 8e257816b0 usb: Add defines for USB Serial Bus Release Number register
Signed-off-by: Brad Hards <bradh@frogmouth.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14 12:56:50 +02:00
Hans de Goede 290a5c60a3 usb-bus: Don't detach non attached devices on device exit
This causes an "Error: tried to detach unattached usb device " to be printed,
this can happen when deleting ie a usb host qdev, which did not
get attached (because a device matching the filter never got plugged in).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14 12:56:49 +02:00
Hans de Goede 290d26d2e7 usb-bus: Add knowledge of USB_SPEED_SUPER to usb_speed helper
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14 12:56:49 +02:00
Gerd Hoffmann 025b168ca6 usb-ehci: split trace calls to handle arg count limits
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14 12:56:49 +02:00
Gerd Hoffmann e654887f38 usb-ehci: itd handling fixes.
This patch fixes a bunch of issues in the itd descriptor handling.
Most important fix is to handle transfers which cross page borders
correctly by looking up the address of the next page.  Luckily the
linux uses physically contigous memory so the data used to hits the
correct location even with this bug instead of corrupting guest
memory.  Also the transfer length updates for outgoing transfers wasn't
correct.

While being at it DPRINTFs have been replaced by tracepoints.

The isoch_pause logic has been disabled.  Not clear to me which propose
this serves and I think it is incorrect too as we just skip processing
itds.  Even when no xfer happens we have to clear the active bit.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14 12:56:49 +02:00
Kevin O'Connor 69bf405b50 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, it
shouldn't claim that.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14 12:56:49 +02:00
Kevin O'Connor 46115ac4c4 Fix USB mouse Set_Protocol behavior
The QEMU USB mouse claims to support the "boot" protocol
(bInterfaceSubClass is 1).  However, the mouse rejects the
Set_Protocol command.

The qemu mouse does support the "boot" protocol specification, so a
simple fix is to enable the Set_Protocol request.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14 12:56:49 +02:00
Gerd Hoffmann d05393071a usb-ehci: drop EXECUTING checks.
The state machine doesn't stop in EXECUTING state any more when async
packets are in flight, so the checks are not needed any more and can
be dropped.

Also kick out the check for the frame timer.  As we don't stop & sleep
any more on async packets this is obsolete.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14 12:56:49 +02:00
Gerd Hoffmann 07771f6fce usb: cancel async packets on unplug
This patch adds USBBusOps struct with (for now) only a single callback
which is called when a device is about to be destroyed.  The USB Host
adapters are implementing this callback and use it to cancel any async
requests which might be in flight before the device actually goes away.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14 12:56:49 +02:00