]> git.proxmox.com Git - qemu.git/log
qemu.git
12 years agoMerge remote-tracking branch 'bonzini/scsi-next' into staging
Anthony Liguori [Mon, 23 Apr 2012 14:57:47 +0000 (09:57 -0500)]
Merge remote-tracking branch 'bonzini/scsi-next' into staging

* bonzini/scsi-next:
  scsi: add SANITIZE command
  SCSI emulation: should tell the guest that we actually support thin provisioning
  SCSI emulation: Support unmap via WRITE_SAME_10.
  scsi: advertise DPOFUA
  scsi: small refactoring of MMC mode-sense
  scsi: support FUA on reads
  scsi: add a started field to SCSIDiskReq
  scsi: force unit access on VERIFY
  scsi: add support for FUA on writes
  scsi: move scsi_flush_complete around
  scsi: make code more homogeneous in AIO callback functions
  scsi: add missing test for cancelled request
  virtio-scsi: add multiqueue capability
  virtio: add virtio_queue_get_id
  virtio-scsi: prepare migration format for multiqueue
  scsi: fix memory leak

12 years agoMerge remote-tracking branch 'stefanha/tracing' into staging
Anthony Liguori [Mon, 23 Apr 2012 14:57:04 +0000 (09:57 -0500)]
Merge remote-tracking branch 'stefanha/tracing' into staging

* stefanha/tracing:
  tracetool: handle DTrace keywords 'in', 'next', 'self'
  tracetool: Add MAINTAINERS info
  tracetool: Add support for the 'dtrace' backend
  tracetool: Add support for the 'ust' backend
  tracetool: Add support for the 'simple' backend
  tracetool: Add support for the 'stderr' backend
  tracetool: Add module for the 'h' format
  tracetool: Add module for the 'c' format
  tracetool: Rewrite infrastructure as python modules

12 years agoscsi: add SANITIZE command
Paolo Bonzini [Thu, 19 Apr 2012 13:43:41 +0000 (15:43 +0200)]
scsi: add SANITIZE command

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoSCSI emulation: should tell the guest that we actually support thin provisioning
Ronnie Sahlberg [Thu, 19 Apr 2012 10:41:17 +0000 (20:41 +1000)]
SCSI emulation: should tell the guest that we actually support thin provisioning

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
[Actually, we should report it only if discard_granularity is nonzero.
 Older SBC drafts assigned 0 to thin provisioning and 1 to thick
 (resource-provisioned, they call it).  Newer drafts assign respectively
 1 and 2 - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoSCSI emulation: Support unmap via WRITE_SAME_10.
Ronnie Sahlberg [Thu, 19 Apr 2012 10:41:16 +0000 (20:41 +1000)]
SCSI emulation: Support unmap via WRITE_SAME_10.

This was added in SBC r26 in place of the reserved bits that were
present up to that version.

It is the same as WRITE_SAME_16 as far as QEMU is concerned.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi: advertise DPOFUA
Paolo Bonzini [Thu, 19 Apr 2012 08:28:15 +0000 (10:28 +0200)]
scsi: advertise DPOFUA

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi: small refactoring of MMC mode-sense
Paolo Bonzini [Thu, 19 Apr 2012 08:24:18 +0000 (10:24 +0200)]
scsi: small refactoring of MMC mode-sense

Make DBD a boolean value, and force device-specific parameter to zero.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi: support FUA on reads
Paolo Bonzini [Thu, 19 Apr 2012 09:55:28 +0000 (11:55 +0200)]
scsi: support FUA on reads

To force unit access on reads, flush the cache *before* doing the read.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi: add a started field to SCSIDiskReq
Paolo Bonzini [Thu, 19 Apr 2012 09:51:42 +0000 (11:51 +0200)]
scsi: add a started field to SCSIDiskReq

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi: force unit access on VERIFY
Paolo Bonzini [Thu, 19 Apr 2012 09:46:13 +0000 (11:46 +0200)]
scsi: force unit access on VERIFY

Also DMA data from the host, to avoid that the host reports an
underrun.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi: add support for FUA on writes
Paolo Bonzini [Thu, 19 Apr 2012 08:10:54 +0000 (10:10 +0200)]
scsi: add support for FUA on writes

To force unit access, add a flush operation after the actual write.
WRITE AND VERIFY commands always flush according to SBC, so do it
even though we do not perform the reread.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi: move scsi_flush_complete around
Paolo Bonzini [Thu, 19 Apr 2012 08:05:04 +0000 (10:05 +0200)]
scsi: move scsi_flush_complete around

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi: make code more homogeneous in AIO callback functions
Paolo Bonzini [Thu, 19 Apr 2012 12:00:24 +0000 (14:00 +0200)]
scsi: make code more homogeneous in AIO callback functions

First scsi_flush_complete, like scsi_dma_complete, is always called with
an active AIOCB.

Second, always test for "ret < 0" to check for errors.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi: add missing test for cancelled request
Paolo Bonzini [Thu, 19 Apr 2012 08:09:49 +0000 (10:09 +0200)]
scsi: add missing test for cancelled request

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agovirtio-scsi: add multiqueue capability
Paolo Bonzini [Fri, 6 Apr 2012 08:39:46 +0000 (10:39 +0200)]
virtio-scsi: add multiqueue capability

Adding multiqueue is as simple as creating more than one virtqueues,
and saving the queue number for each request.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agovirtio: add virtio_queue_get_id
Paolo Bonzini [Fri, 6 Apr 2012 08:38:37 +0000 (10:38 +0200)]
virtio: add virtio_queue_get_id

Serializing virtio-scsi requests needs a simple way to get from a
VirtQueue to the number of the queue.  The virtio_queue_get_id
provides this.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agovirtio-scsi: prepare migration format for multiqueue
Paolo Bonzini [Fri, 6 Apr 2012 08:20:43 +0000 (10:20 +0200)]
virtio-scsi: prepare migration format for multiqueue

In order to restore requests correctly from a multitude of virtqueues,
we need to store the id of the request queue that each request came
from.

Do this even for single-queue, by storing a hard-coded zero, to
simplify future implementation of multiqueue.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi: fix memory leak
Paolo Bonzini [Fri, 6 Apr 2012 12:12:42 +0000 (14:12 +0200)]
scsi: fix memory leak

scsibus_get_dev_path is leaking id if it is not NULL.  Fix it.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoMerge remote-tracking branch 'origin/master' into staging
Anthony Liguori [Wed, 18 Apr 2012 15:05:58 +0000 (10:05 -0500)]
Merge remote-tracking branch 'origin/master' into staging

* origin/master:
  Allow controlling volume with PulseAudio backend
  configure: pa_simple is not needed anymore
  Do not use pa_simple PulseAudio API
  audio/spice: add support for volume control
  hw/ac97: add support for volume control
  hw/ac97: the volume mask is not only 0x1f
  hw/ac97: remove USE_MIXER code
  audio: don't apply volume effect if backend has VOICE_VOLUME_CAP
  audio: add VOICE_VOLUME ctl

12 years agotracetool: handle DTrace keywords 'in', 'next', 'self'
Stefan Hajnoczi [Mon, 16 Apr 2012 11:47:58 +0000 (12:47 +0100)]
tracetool: handle DTrace keywords 'in', 'next', 'self'

Language keywords cannot be used as argument names.  The DTrace backend
appends an underscore to the argument name in order to make the argument
name legal.

This patch adds 'in', 'next', and 'self' keywords to dtrace.py.

Also drop the unnecessary argument name lstrip() call.  The
Arguments.build() method already ensures there is no space around
argument names.  Furthermore it is misleading to do the lstrip() *after*
checking against keywords because the keyword check would not match if
spaces were in the name.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotracetool: Add MAINTAINERS info
Lluís Vilanova [Tue, 3 Apr 2012 18:48:17 +0000 (20:48 +0200)]
tracetool: Add MAINTAINERS info

Update the MAINTAINERS file to reflect the new Python tracetool code.

[Commit description written by Stefan Hajnoczi]

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agotracetool: Add support for the 'dtrace' backend
Lluís Vilanova [Tue, 3 Apr 2012 18:48:12 +0000 (20:48 +0200)]
tracetool: Add support for the 'dtrace' backend

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agotracetool: Add support for the 'ust' backend
Lluís Vilanova [Tue, 3 Apr 2012 18:48:06 +0000 (20:48 +0200)]
tracetool: Add support for the 'ust' backend

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agotracetool: Add support for the 'simple' backend
Lluís Vilanova [Tue, 3 Apr 2012 18:48:01 +0000 (20:48 +0200)]
tracetool: Add support for the 'simple' backend

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agotracetool: Add support for the 'stderr' backend
Lluís Vilanova [Tue, 3 Apr 2012 18:47:55 +0000 (20:47 +0200)]
tracetool: Add support for the 'stderr' backend

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agotracetool: Add module for the 'h' format
Lluís Vilanova [Tue, 3 Apr 2012 18:47:50 +0000 (20:47 +0200)]
tracetool: Add module for the 'h' format

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agotracetool: Add module for the 'c' format
Lluís Vilanova [Tue, 3 Apr 2012 18:47:44 +0000 (20:47 +0200)]
tracetool: Add module for the 'c' format

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agotracetool: Rewrite infrastructure as python modules
Lluís Vilanova [Tue, 3 Apr 2012 18:47:39 +0000 (20:47 +0200)]
tracetool: Rewrite infrastructure as python modules

The tracetool script is written in shell and has hit several portability
problems due to shell quirks or external tools across host platforms.
Additionally the amount of string processing and lack of real data
structures makes it tough to implement code generator backends for
tracers that are more complex.

This patch replaces the shell version of tracetool with a Python
version.  The new tracetool design is:

  scripts/tracetool.py - top-level script
  scripts/tracetool/backend/ - tracer backends live here (simple, ust)
  scripts/tracetool/format/  - output formats live here (.c, .h)

There is common code for trace-events definition parsing so that
backends can focus on generating code rather than parsing input.

Support for all existing backends (nop, stderr, simple, ust,
and dtrace) is added back in follow-up patches.

[Commit description written by Stefan Hajnoczi]

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoMerge remote-tracking branch 'spice/spice.v52' into staging
Anthony Liguori [Wed, 18 Apr 2012 12:56:18 +0000 (07:56 -0500)]
Merge remote-tracking branch 'spice/spice.v52' into staging

* spice/spice.v52:
  qxl-render: fix broken vnc+spice since commit f934493
  qxl: set default values of vram*_size_mb to -1
  trace-events: remove unused qxl_vga_ioport_while_not_in_vga_mode

12 years agoMerge remote-tracking branch 'kraxel/usb.46' into staging
Anthony Liguori [Wed, 18 Apr 2012 12:55:56 +0000 (07:55 -0500)]
Merge remote-tracking branch 'kraxel/usb.46' into staging

* kraxel/usb.46: (21 commits)
  usb-ehci: drop assert()
  usb-redir: Notify our peer when we reject a device due to a speed mismatch
  usb-ehci: Drop unused sofv value
  usb-host: rewrite usb_linux_update_endp_table
  usb: use USBDescriptor for endpoint descriptors.
  usb: use USBDescriptor for interface descriptors.
  usb: use USBDescriptor for config descriptors.
  usb: use USBDescriptor for device qualifier descriptors.
  usb: add USBDescriptor, use for device descriptors.
  usb-ehci: frindex always is a 14 bits counter
  usb-ehci: fix ehci_child_detach
  usb-hub: add tracepoints
  usb_packet_set_state: handle p->ep == NULL
  usb-host: add property to turn off pipelining
  usb-host: add usb packet to request tracepoints
  usb-host: trace canceled requests
  usb-host: trace emulated requests
  Add bootindex support to usb-host and usb-redir
  usb-uhci: queuing fix
  usb-uhci: stop queue filling when we find a in-flight td
  ...

12 years agoqxl-render: fix broken vnc+spice since commit f934493
Alon Levy [Wed, 18 Apr 2012 09:27:00 +0000 (12:27 +0300)]
qxl-render: fix broken vnc+spice since commit f934493

Notify any listeners such as vnc that the displaysurface has been
changed, otherwise they will segfault when first accessing the freed old
displaysurface data.

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoqxl: set default values of vram*_size_mb to -1
Alon Levy [Thu, 29 Mar 2012 20:24:38 +0000 (22:24 +0200)]
qxl: set default values of vram*_size_mb to -1

The addition of those values caused a regression where not specifying
any value for the vram bar size would result in a 4096 _byte_ surface
area. This is ok for the windows driver but causes the X driver to be
unusable. Also, it's a regression. This patch returns the default
behavior of having a 64 megabyte vram BAR.

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agotrace-events: remove unused qxl_vga_ioport_while_not_in_vga_mode
Alon Levy [Wed, 28 Mar 2012 09:30:08 +0000 (11:30 +0200)]
trace-events: remove unused qxl_vga_ioport_while_not_in_vga_mode

The resulting stp file fails to load because of an unresolvable probe.

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoAllow controlling volume with PulseAudio backend
Marc-André Lureau [Tue, 17 Apr 2012 12:32:43 +0000 (14:32 +0200)]
Allow controlling volume with PulseAudio backend

Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
12 years agoconfigure: pa_simple is not needed anymore
Marc-André Lureau [Tue, 17 Apr 2012 12:32:42 +0000 (14:32 +0200)]
configure: pa_simple is not needed anymore

Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
12 years agoDo not use pa_simple PulseAudio API
Marc-André Lureau [Tue, 17 Apr 2012 12:32:41 +0000 (14:32 +0200)]
Do not use pa_simple PulseAudio API

Unfortunately, pa_simple is a limited API which doesn't let us
retrieve the associated pa_stream. It is needed to control the volume
of the stream.

In v4:
- add missing braces

Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
12 years agoaudio/spice: add support for volume control
Marc-André Lureau [Tue, 17 Apr 2012 12:32:40 +0000 (14:32 +0200)]
audio/spice: add support for volume control

Use Spice server volume control API when available.

Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
12 years agohw/ac97: add support for volume control
Marc-André Lureau [Tue, 17 Apr 2012 12:32:39 +0000 (14:32 +0200)]
hw/ac97: add support for volume control

Combine output volume with Master and PCM registers values.
Use default values in mixer_reset ().
Set volume on post-load to update backend values.

v4,v5:
- fix some code style

Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
12 years agohw/ac97: the volume mask is not only 0x1f
Marc-André Lureau [Tue, 17 Apr 2012 12:32:38 +0000 (14:32 +0200)]
hw/ac97: the volume mask is not only 0x1f

It's a case by case (see Table 66. AC ?97 Baseline Audio Register Map)

Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
12 years agohw/ac97: remove USE_MIXER code
Marc-André Lureau [Tue, 17 Apr 2012 12:32:37 +0000 (14:32 +0200)]
hw/ac97: remove USE_MIXER code

That code doesn't compile. The interesting bits for volume control are
going to be rewritten in the following patch.

Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
12 years agoaudio: don't apply volume effect if backend has VOICE_VOLUME_CAP
Marc-André Lureau [Tue, 17 Apr 2012 12:32:36 +0000 (14:32 +0200)]
audio: don't apply volume effect if backend has VOICE_VOLUME_CAP

If the audio backend is capable of volume control, don't apply
software volume (mixeng_volume ()), but instead, rely on backend
volume control. This will allow guest to have full range volume
control.

Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
12 years agoaudio: add VOICE_VOLUME ctl
Marc-André Lureau [Tue, 17 Apr 2012 12:32:35 +0000 (14:32 +0200)]
audio: add VOICE_VOLUME ctl

Add a new PCM control operation to update the stream volume on the
audio backend.  The argument given is a SWVoiceOut/SWVoiceIn.

v4:
- verified other backends didn't fail/assert on this new control
  they randomly return 0 or -1, but we ignore return value.

Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
12 years agoseabios: update to 1.7.0
Gerd Hoffmann [Tue, 17 Apr 2012 08:51:41 +0000 (10:51 +0200)]
seabios: update to 1.7.0

Update roms/seabios and pc-bios/bios.bin to the 1.7.0 release.
Most noticable new feature is virtio-scsi support.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ehci: drop assert()
Gerd Hoffmann [Fri, 30 Mar 2012 11:20:21 +0000 (13:20 +0200)]
usb-ehci: drop assert()

Not sure what the purpose of the assert() was, in any case it is bogous.
We can arrive there if transfer descriptors passed to us from the guest
failed to pass sanity checks, i.e. it is guest-triggerable.  We deal
with that case by resetting the host controller.  Everything is ok, no
need to throw a core dump here.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-redir: Notify our peer when we reject a device due to a speed mismatch
Hans de Goede [Fri, 30 Mar 2012 07:53:54 +0000 (09:53 +0200)]
usb-redir: Notify our peer when we reject a device due to a speed mismatch

Also cleanup (reset) our device state when we reject a device due to a
speed mismatch.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ehci: Drop unused sofv value
Hans de Goede [Fri, 30 Mar 2012 07:53:53 +0000 (09:53 +0200)]
usb-ehci: Drop unused sofv value

The sofv value only ever gets a value assigned and is never used (read)
anywhere, so we can just drop it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-host: rewrite usb_linux_update_endp_table
Gerd Hoffmann [Thu, 29 Mar 2012 14:06:28 +0000 (16:06 +0200)]
usb-host: rewrite usb_linux_update_endp_table

This patch carries a complete rewrite of the usb descriptor parser.
Changes / improvements:

 * We are using the USBDescriptor struct instead of hard-coded offsets
   now to access descriptor data.
 * (debug) printfs are all gone, tracepoints have been added instead.
 * We don't try (and fail) to skip over unneeded descriptors.  We parse
   them all one by one.  We keep track of which configuration, interface
   and altsetting we are looking at and use this information to figure
   which desciptors are in use and which we can ignore.
 * On parse errors we clear all endpoint information, which will
   disallow any communication with the device, except control endpoint
   messages.  This makes sure we don't end up with a silly device state
   where half of the endpoints got enabled and the other half was left
   disabled.
 * Some sanity checks have been added.

The new parser is more robust and also leaves complete device
information in the trace log if you enable the ush_host_parse_*
tracepoints.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: use USBDescriptor for endpoint descriptors.
Gerd Hoffmann [Thu, 29 Mar 2012 14:01:21 +0000 (16:01 +0200)]
usb: use USBDescriptor for endpoint descriptors.

Add endpoint descriptor substruct to USBDescriptor,
use it in the descriptor generator code.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: use USBDescriptor for interface descriptors.
Gerd Hoffmann [Thu, 29 Mar 2012 10:30:33 +0000 (12:30 +0200)]
usb: use USBDescriptor for interface descriptors.

Add interface descriptor substruct to USBDescriptor,
use it in the descriptor generator code.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: use USBDescriptor for config descriptors.
Gerd Hoffmann [Thu, 29 Mar 2012 10:24:08 +0000 (12:24 +0200)]
usb: use USBDescriptor for config descriptors.

Add config descriptor substruct to USBDescriptor,
use it in the descriptor generator code.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: use USBDescriptor for device qualifier descriptors.
Gerd Hoffmann [Thu, 29 Mar 2012 10:15:01 +0000 (12:15 +0200)]
usb: use USBDescriptor for device qualifier descriptors.

Add device qualifier substruct to USBDescriptor,
use it in the descriptor generator code.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: add USBDescriptor, use for device descriptors.
Gerd Hoffmann [Thu, 29 Mar 2012 10:04:54 +0000 (12:04 +0200)]
usb: add USBDescriptor, use for device descriptors.

This patch adds a new type for the binary representation of usb
descriptors.  It is put into use for the descriptor generator code
where the struct replaces the hard-coded offsets.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ehci: frindex always is a 14 bits counter
Hans de Goede [Wed, 28 Mar 2012 18:47:51 +0000 (20:47 +0200)]
usb-ehci: frindex always is a 14 bits counter

frindex always is a 14 bits counter, and not a 13 bits one as we were
emulating. There are some subtle hints to this in the spec, first of all
"Table 2-12. FRINDEX - Frame Index Register" says:
"Bit 13:0 Frame Index. The value in this register increments at the end of
each time frame (e.g. micro-frame). Bits [N:3] are used for the Frame List
current index. This means that each location of the frame list is accessed
8 times (frames or micro-frames) before moving to the next index. The
following illustrates values of N based on the value of the Frame List
Size field in the USBCMD register.

USBCMD[Frame List Size] Number Elements  N
00b 1024 12
01b  512 11
10b  256 10
11b     Reserved"

Notice how the text talks about "Bits [N:3]" are used ..., it does
NOT say that when N == 12 (our case) the counter will wrap from 8191 to 0,
or in otherwords that it is a 13 bits counter (bits 0 - 12).

The other hint is in "Table 2-10. USBSTS USB Status Register Bit Definitions":

"Bit 3 Frame List Rollover - R/WC. The Host Controller sets this bit to a one
when the Frame List Index (see Section 2.3.4) rolls over from its maximum value
to zero. The exact value at which the rollover occurs depends on the frame
list size. For example, if the frame list size (as programmed in the Frame
List Size field of the USBCMD register) is 1024, the Frame Index Register
rolls over every time FRINDEX[13] toggles. Similarly, if the size is 512,
the Host Controller sets this bit to a one every time FRINDEX[12] toggles."

Notice how this text talks about setting bit 3 when bit 13 of frindex toggles
(when there are 1024 entries, so our case), so this indicates that frindex
has a bit 13 making it a 14 bit counter.

Besides these clear hints the real proof is in the pudding. Before this
patch I could not stream data from a USB2 webcam under Windows XP, after
this cam using a USB2 webcam under Windows XP works fine, and no regressions
with other operating systems were seen.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ehci: fix ehci_child_detach
Gerd Hoffmann [Fri, 23 Mar 2012 14:43:45 +0000 (15:43 +0100)]
usb-ehci: fix ehci_child_detach

Looks like a cut+paste bug from ehci_detach.  When the device itself is
detached from a ehci port (ehci_detach op) we have to clear the
device pointer for the companion port too.  When a device gets removed
from a downstream port of a usb hub (ehci_child_detach op) the ehci port
where the usb hub is plugged in is not affected.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-hub: add tracepoints
Gerd Hoffmann [Fri, 23 Mar 2012 14:42:58 +0000 (15:42 +0100)]
usb-hub: add tracepoints

Add tracepoints to the usb hub emulation.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb_packet_set_state: handle p->ep == NULL
Gerd Hoffmann [Fri, 23 Mar 2012 12:34:50 +0000 (13:34 +0100)]
usb_packet_set_state: handle p->ep == NULL

usb_packet_set_state can be called with p->ep = NULL.  The tracepoint
there tries to log endpoint information, which leads to a segfault.
This patch makes usb_packet_set_state handle the NULL pointer properly.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-host: add property to turn off pipelining
Gerd Hoffmann [Thu, 22 Mar 2012 14:28:45 +0000 (15:28 +0100)]
usb-host: add property to turn off pipelining

Add a property to usb-host to disable the bulk endpoint pipelining.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-host: add usb packet to request tracepoints
Gerd Hoffmann [Fri, 23 Mar 2012 11:35:55 +0000 (12:35 +0100)]
usb-host: add usb packet to request tracepoints

Add pointer to USBPacket to all tracepoints tracking requests to make it
easier to identify them when multiple requests are in flight.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-host: trace canceled requests
Gerd Hoffmann [Fri, 23 Mar 2012 11:26:59 +0000 (12:26 +0100)]
usb-host: trace canceled requests

Add tracepoints to track canceled requests.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-host: trace emulated requests
Gerd Hoffmann [Thu, 22 Mar 2012 14:10:55 +0000 (15:10 +0100)]
usb-host: trace emulated requests

Add tracepoint to track completion of emulated control requests.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoAdd bootindex support to usb-host and usb-redir
Gerd Hoffmann [Thu, 22 Mar 2012 09:48:03 +0000 (10:48 +0100)]
Add bootindex support to usb-host and usb-redir

When passing through a usb pendrive seabios will present it in the F12
boot menu and will happily boot from it.

This patch adds bootorder support so you can even make it the default
boot device.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-uhci: queuing fix
Gerd Hoffmann [Thu, 29 Mar 2012 14:02:20 +0000 (16:02 +0200)]
usb-uhci: queuing fix

When we queue up usb packets we may happen to find a already queued
packet, which also might be finished at that point already.  We don't
want continue processing the packet at this point though, so lets
just signal back we've found a in-flight packet when in queuing mode.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-uhci: stop queue filling when we find a in-flight td
Gerd Hoffmann [Wed, 21 Mar 2012 17:25:25 +0000 (18:25 +0100)]
usb-uhci: stop queue filling when we find a in-flight td

Not only QHs can form rings, but TDs too.  With the new
queuing/pipelining support we are following TD chains and
can actually walk in circles.  An assert() prevents us from
entering an endless loop then.

Fix is easy:  Just stop queuing when we figure the TD we are
about to queue up is in flight already.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb/vmstate: add parent dev path
Gerd Hoffmann [Mon, 22 Aug 2011 07:09:51 +0000 (09:09 +0200)]
usb/vmstate: add parent dev path

... to make vmstate id string truely unique with multiple host
controllers, i.e. move from "1/usb-ptr" to "0000:00:01.3/1/usb-ptr"
(usb tabled connected to piix3 uhci).

This obviously breaks migration.  To handle this the usb bus
property "full-path" is added.  When setting this to false old
behavior is maintained.  This way current qemu will be compatible
with old versions when started using '-M pc-$oldversion'.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoqemu-timer.c: Remove 250us timeouts
Peter Portante [Thu, 5 Apr 2012 15:00:45 +0000 (11:00 -0400)]
qemu-timer.c: Remove 250us timeouts

Basically, the main wait loop calls qemu_run_all_timers() unconditionally. The
first thing this routine used to do is to see if a timer had been serviced,
and then reset the loop timeout to the next deadline.

However, the new deadlines had not been calculated at that point, as
qemu_run_timers() had not been called yet for each of the clocks. So
qemu_rearm_alarm_timer() would end up with a negative or zero deadline, and
default to setting a 250us timeout for the loop.

As qemu_run_timers() is called for each clock, the real deadlines would be put
in place, but because a loop timeout was already set, the loop timeout would
not be changed.

Once that 250us timeout fired, the real deadline would be used for the
subsequent timeout.

For idle VMs, this effectively doubles the number of times through the loop,
doubling the number of select() system calls, timer calls, etc. putting added
scheduling pressure on the kernel. And under cgroups, this really causes a big
problem because the cgroup code does not scale well.

By simply running the timers before trying to rearm the timer, we always rearm
with a non-zero deadline, effectively halving the number of system calls.

Signed-off-by: Peter Portante <pportant@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoMerge remote-tracking branch 'kiszka/queues/pending' into staging
Anthony Liguori [Mon, 16 Apr 2012 17:56:28 +0000 (12:56 -0500)]
Merge remote-tracking branch 'kiszka/queues/pending' into staging

* kiszka/queues/pending:
  vapic: Disable for pre-1.1 machines
  Kick io-thread on qemu_chr_accept_input
  pcnet: Properly handle TX requests during Link Fail
  pcnet: Clear ERR in CSR0 on stop
  signrom: Rewrite as python script

Conflicts:
hw/pc_piix.c

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoMerge remote-tracking branch 'mst/tags/for_anthony' into staging
Anthony Liguori [Mon, 16 Apr 2012 17:52:22 +0000 (12:52 -0500)]
Merge remote-tracking branch 'mst/tags/for_anthony' into staging

* mst/tags/for_anthony:
  pci: fix corrupted pci conf index register by unaligned write
  acpi: explicitly account for >1 device per slot
  acpi_piix4: Re-define PCI hotplug eject register read
  acpi_piix4: Remove PCI_RMV_BASE write code
  acpi_piix4: Fix PCI hotplug race
  acpi_piix4: Disallow write to up/down PCI hotplug registers
  virtio-pci: change virtio balloon PCI class code
  ivshmem: add missing msix calls
  vhost: readd assert statement
  vhost: Fix size of dirty log sync on resize
  pc: reduce duplication in compat machine types
  piix_pci: fix typo in i400FX chipset init code

12 years agoMerge remote-tracking branch 'sstabellini/for_anthony' into staging
Anthony Liguori [Mon, 16 Apr 2012 17:50:12 +0000 (12:50 -0500)]
Merge remote-tracking branch 'sstabellini/for_anthony' into staging

* sstabellini/for_anthony:
  xen: introduce an event channel for buffered io event notifications
  xen-mapcache: don't unmap locked entry during mapcache invalidation
  Xen, mapcache: Fix the compute of the size of bucket.
  xen: handle backend deletion from xenstore
  Xen: Add xen-apic support and hook it up.
  Xen: basic HVM MSI injection support.

12 years agovapic: Disable for pre-1.1 machines
Jan Kiszka [Thu, 29 Mar 2012 12:07:46 +0000 (14:07 +0200)]
vapic: Disable for pre-1.1 machines

The kvmvapic was not present in older QEMU versions, thus must be
disabled in compat machines.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoKick io-thread on qemu_chr_accept_input
Jan Kiszka [Fri, 16 Mar 2012 12:18:00 +0000 (13:18 +0100)]
Kick io-thread on qemu_chr_accept_input

Once a chr frontend is able to receive input again, we need to inform
the io-thread about this fact. Otherwise, main_loop_wait may continue to
select without the related backend file descriptor in its set. This can
cause high input latencies if only low-rate events arrive otherwise.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agopcnet: Properly handle TX requests during Link Fail
Jan Kiszka [Wed, 29 Feb 2012 14:37:43 +0000 (15:37 +0100)]
pcnet: Properly handle TX requests during Link Fail

As long as we have no link and we aren't in internal loopback mode, no
packet must be sent. Instead, LCAR needs to be set in any active TX
descriptor and also CERR in CSR0.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agopcnet: Clear ERR in CSR0 on stop
Jan Kiszka [Wed, 29 Feb 2012 14:33:48 +0000 (15:33 +0100)]
pcnet: Clear ERR in CSR0 on stop

pcnet_stop already clears any reason (BABL, CERR, MISS, MERR) why ERR
(bit 15) should be set in CRS0. So we have to clear that bit as well.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agosignrom: Rewrite as python script
Jan Kiszka [Fri, 27 Jan 2012 18:44:53 +0000 (19:44 +0100)]
signrom: Rewrite as python script

Now that we have a hard dependency on python anyway, we can replace the
slow shell script to calculate the option ROM checksum with a fast AND
portable python version. Tested both with python 2.7 and 3.1.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoMerge branch 'w64' of git://qemu.weilnetz.de/qemu
Blue Swirl [Sun, 15 Apr 2012 19:56:06 +0000 (19:56 +0000)]
Merge branch 'w64' of git://qemu.weilnetz.de/qemu

* 'w64' of git://qemu.weilnetz.de/qemu:
  w64: Fix time conversion for some versions of MinGW-w64
  nbd: Fix compiler warning (w64)
  disas: Replace 'unsigned long' by 'uintptr_t'
  cpu-exec: Remove non-portable type cast and fix format string
  target-mips: Fix type cast for w64 (uintptr_t)
  w64: Fix type cast in os_host_main_loop_wait
  w64: Fix data types in softmmu*.h
  w64: Use uintptr_t in exec.c
  softmmu: Use uintptr_t for physaddr and rename it
  w64: Fix struct CPUTLBEntry
  w64: Fix definition of setjmp
  w32: Move defines for socket specific errors to qemu-os-win32.h
  w64: Use larger alignment for section with generated code
  w64: Fix data types in cpu-all.h, exec.c
  w64: Fix type casts used in some macros in cpu-all.h
  tcg/i386: Add support for w64 ABI
  tcg/i386: Use GDB JIT debugging interface only for hosts with ELF

12 years agotarget-alpha: QOM'ify CPU init
Andreas Färber [Fri, 6 Apr 2012 23:19:45 +0000 (01:19 +0200)]
target-alpha: QOM'ify CPU init

Move code from cpu_alpha_init() into a CPU initializer.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Richard Henderson <rth@twiddle.net>
12 years agotarget-alpha: QOM'ify CPU
Andreas Färber [Fri, 6 Apr 2012 17:46:48 +0000 (19:46 +0200)]
target-alpha: QOM'ify CPU

Embed CPUAlphaState as first member of AlphaCPU.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Richard Henderson <rth@twiddle.net>
12 years agow64: Fix time conversion for some versions of MinGW-w64
Stefan Weil [Thu, 12 Apr 2012 20:33:12 +0000 (22:33 +0200)]
w64: Fix time conversion for some versions of MinGW-w64

tb.time is a time value, but not necessarily of the same size as time_t:
while time_t is 64 bit for w64, tb.time still is 32 bit only.

Therefore we need en explicit conversion.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agonbd: Fix compiler warning (w64)
Stefan Weil [Thu, 12 Apr 2012 20:30:16 +0000 (22:30 +0200)]
nbd: Fix compiler warning (w64)

Portable printing of dev_offset (data type off_t) needs a type cast.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agodisas: Replace 'unsigned long' by 'uintptr_t'
Stefan Weil [Thu, 12 Apr 2012 13:44:35 +0000 (15:44 +0200)]
disas: Replace 'unsigned long' by 'uintptr_t'

This is needed for w64. It changes nothing for other hosts.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agocpu-exec: Remove non-portable type cast and fix format string
Stefan Weil [Thu, 12 Apr 2012 13:44:24 +0000 (15:44 +0200)]
cpu-exec: Remove non-portable type cast and fix format string

This change is needed for w64, but also changes the code for other hosts.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agotarget-mips: Fix type cast for w64 (uintptr_t)
Stefan Weil [Thu, 12 Apr 2012 13:43:09 +0000 (15:43 +0200)]
target-mips: Fix type cast for w64 (uintptr_t)

This changes nothing for other hosts.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agow64: Fix type cast in os_host_main_loop_wait
Stefan Weil [Thu, 12 Apr 2012 18:42:34 +0000 (20:42 +0200)]
w64: Fix type cast in os_host_main_loop_wait

Casting a pointer to an integer must use (DWORD_PTR) instead of (DWORD).
This also matches the definition of 'fd' (gint for w32, gint64 for w64).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agow64: Fix data types in softmmu*.h
Stefan Weil [Thu, 12 Apr 2012 12:14:51 +0000 (14:14 +0200)]
w64: Fix data types in softmmu*.h

w64 requires uintptr_t.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agow64: Use uintptr_t in exec.c
Stefan Weil [Thu, 12 Apr 2012 13:42:19 +0000 (15:42 +0200)]
w64: Use uintptr_t in exec.c

Replace all type casts to 'long' or 'unsigned long' by 'intptr_t' or 'uintptr_t'.

For type casts which are only used to extract the lower bits of an address
or to modify those bits, signedness does not matter. There I always use 'uintptr_t'.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agosoftmmu: Use uintptr_t for physaddr and rename it
Stefan Weil [Sun, 15 Apr 2012 19:02:09 +0000 (21:02 +0200)]
softmmu: Use uintptr_t for physaddr and rename it

Variable physaddr is a host address which should be represented by
data type 'uintptr_t'.

This is needed for w64 and changes nothing for other hosts.

v2:
Rename physaddr -> hostaddr (suggested by Blue Swirl).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agow64: Fix struct CPUTLBEntry
Stefan Weil [Thu, 12 Apr 2012 18:29:36 +0000 (20:29 +0200)]
w64: Fix struct CPUTLBEntry

For w64, some entries need 'uintptr_t' instead of 'unsigned long'.

For other host systems, both data types are identical, so nothing changes.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agow64: Fix definition of setjmp
Stefan Weil [Thu, 12 Apr 2012 19:13:28 +0000 (21:13 +0200)]
w64: Fix definition of setjmp

The default definition of setjmp which is implemented in MinGW-w64
cannot be used with programs like QEMU which call longjmp from
code without structured exception handling (SEH).

This code therefore disables stack unwinding.

We could also implement SEH for QEMU's generated JIT code, but
that is much more difficult. Stack unwinding would also cost
execution time.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agow32: Move defines for socket specific errors to qemu-os-win32.h
Stefan Weil [Thu, 12 Apr 2012 19:13:15 +0000 (21:13 +0200)]
w32: Move defines for socket specific errors to qemu-os-win32.h

As those defines are only used for w32,
they should be in the header file for w32.

All files which include slirp.h or qemu_socket.h also
include qemu-os-win32.h.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agow64: Use larger alignment for section with generated code
Stefan Weil [Wed, 4 Apr 2012 05:45:21 +0000 (07:45 +0200)]
w64: Use larger alignment for section with generated code

The MinGW-w64 compiler allows __attribute__((aligned (32)).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agow64: Fix data types in cpu-all.h, exec.c
Stefan Weil [Fri, 16 Mar 2012 19:23:49 +0000 (20:23 +0100)]
w64: Fix data types in cpu-all.h, exec.c

w64 needs uintptr_t instead of unsigned long.
For other hosts, nothing changes.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agow64: Fix type casts used in some macros in cpu-all.h
Stefan Weil [Sun, 15 Apr 2012 13:18:29 +0000 (15:18 +0200)]
w64: Fix type casts used in some macros in cpu-all.h

Instead of type casts to long, w64 needs type casts to intptr_t.
For other hosts, this changes nothing.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agotcg/i386: Add support for w64 ABI
Stefan Weil [Thu, 12 Apr 2012 18:46:32 +0000 (20:46 +0200)]
tcg/i386: Add support for w64 ABI

w64 uses the registers rcx, rdx, r8 and r9 for function arguments,
so it needs a different declaration of tcg_target_call_iarg_regs.

rax, rcx, rdx, r8, r9, r10 and r11 may be changed by function calls.

rbx, rbp, rdi, rsi, r12, r13, r14 and r15 remain unchanged by function calls.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agotcg/i386: Use GDB JIT debugging interface only for hosts with ELF
Stefan Weil [Fri, 6 Apr 2012 06:06:41 +0000 (08:06 +0200)]
tcg/i386: Use GDB JIT debugging interface only for hosts with ELF

Not all i386 / x86_64 hosts use ELF.
Ask the compiler whether ELF is used.

On w64, gdb crashes when ELF_HOST_MACHINE is defined.

Cc: Blue Swirl <blauwirbel@gmail.com>
Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
12 years agoMerge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf
Blue Swirl [Sun, 15 Apr 2012 18:39:55 +0000 (18:39 +0000)]
Merge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf

* 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf:
  pseries: Fix reset of VIO network device
  pseries: Reset vscsi properly
  pseries: Correctly use the device model reset hooks
  pseries: Remove old hcalls hook stub
  pseries: Remove old debug leftovers from spapr_vscsi
  pseries: Fix RTAS based config access
  target-ppc/machine.c: Drop unnecessary ifdefs
  target-ppc: Init dcache and icache size for e500 user mode
  target-ppc: Fix type casts for w64 (uintptr_t)
  target-ppc: QOM'ify CPU reset
  target-ppc: Start QOM'ifying CPU init
  target-ppc: QOM'ify CPU
  target-ppc: Add hooks for handling tcg and kvm limitations
  target-ppc: Drop cpu_ppc_close()
  pseries: Consolidate hack for RTAS display-character usage
  pseries: Remove unused fields from VIOsPAPRBus structure
  pseries: Implement RTAS system-reboot call
  pseries: Fix bug with reset of VIO CRQs
  pseries: Clean up hcall_dprintf() debugging messages
  PPC: Fix TLB invalidation bug within the PPC interrupt handler.

12 years agopseries: Fix reset of VIO network device
David Gibson [Thu, 12 Apr 2012 02:44:15 +0000 (12:44 +1000)]
pseries: Fix reset of VIO network device

Currently, the PAPR VIO network device does not have a reset handler.  This
means that after a hard reset, H_REGISTER_LOGICAL_LAN will return an error
when the new guest boot attempts to initialize the device.

This patch corrects this, adding a suitable reset hook.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andreas Färber <afaerber@suse.de>
12 years agopseries: Reset vscsi properly
David Gibson [Thu, 12 Apr 2012 02:44:14 +0000 (12:44 +1000)]
pseries: Reset vscsi properly

Currently the PAPR vscsi implementation does not properly clear its table
of request tags when the system is reset.  This patch adds a reset hook
to do so.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andreas Färber <afaerber@suse.de>
12 years agopseries: Correctly use the device model reset hooks
David Gibson [Thu, 12 Apr 2012 02:44:13 +0000 (12:44 +1000)]
pseries: Correctly use the device model reset hooks

Recently we added code to properly clean away VIO CRQs on reset  However,
this directly uses qemu_register, rather than the existing device model
reset callbacks.  This patch cleans this up by adding proper use of the
reset hook to the VIO bus model.  The existing CRQ reset code is converted
to the new method.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andreas Färber <afaerber@suse.de>
12 years agopseries: Remove old hcalls hook stub
David Gibson [Thu, 12 Apr 2012 02:44:12 +0000 (12:44 +1000)]
pseries: Remove old hcalls hook stub

Some time ago we removed all use of the 'hcalls' callback in the pseries
VIO code, which was used to workaround an ordering problem which has since
been solved properly.  However, the function pointer for the hook remains.
This patch cleans it away.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andreas Färber <afaerber@suse.de>
12 years agopseries: Remove old debug leftovers from spapr_vscsi
David Gibson [Thu, 12 Apr 2012 02:44:11 +0000 (12:44 +1000)]
pseries: Remove old debug leftovers from spapr_vscsi

The PAPR VSCSI emulation contains a few lines of code which were once used
for debug but now do nothing at all.  This patch removes them.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andreas Färber <afaerber@suse.de>
12 years agopseries: Fix RTAS based config access
David Gibson [Mon, 2 Apr 2012 04:17:35 +0000 (14:17 +1000)]
pseries: Fix RTAS based config access

On the pseries platform, access to PCI config space is via RTAS calls(
which go to the hypervisor) rather than MMIO.  This means we don't use
the same code path as nearly everyone else which goes through pci_host.c
and we're missing some of the parameter checking along the way.

We do have some parameter checking in the RTAS calls, but it's not enough.
It checks for overruns, but does not check for unaligned accesses,
oversized accesses (which means the guest could trigger an assertion
failure from pci_host_config_{read,write}_common().  Worse it doesn't do
the basic checking for the number of RTAS arguments and results before
accessing them.

This patch fixes these bugs.

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
[AF: Fix typos spotted by mst]
Signed-off-by: Andreas Färber <afaerber@suse.de>