]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
12 years agopc: Generalize ISA IRQs to GSIs
Jan Kiszka [Fri, 7 Oct 2011 07:19:35 +0000 (09:19 +0200)]
pc: Generalize ISA IRQs to GSIs

The ISA bus IRQ range is 0..15. What isa_irq_handler and IsaIrqState are
actually dealing with are the Global System Interrupts. Refactor the
code to clarify this.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agopc: Drop useless test from isa_irq_handler
Jan Kiszka [Fri, 7 Oct 2011 07:19:34 +0000 (09:19 +0200)]
pc: Drop useless test from isa_irq_handler

IsaIrqState::ioapic is always non-NULL. Probably, the concrete
qemu_irq was supposed to be tested, but that's already done by
qemu_set_irq.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: add Avnet LX60/LX110/LX200 boards
Max Filippov [Sat, 15 Oct 2011 22:56:46 +0000 (02:56 +0400)]
target-xtensa: add Avnet LX60/LX110/LX200 boards

These boards carry similar hardware: SDRAM (48M for LX110, 64M for LX60,
96M for LX200), 16 Mbyte FLASH, FPGA, 10/100 Mbps Ethernet PHY and 16550
UART. FPGA may be loaded with almost any Tensilica processor. It is also
used to implement Ethernet MAC, e.g. OpenCores 10/100 Mbps Ethernet MAC
and LED/DIP switches access.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agohw: add OpenCores 10/100 Mbps Ethernet controller
Max Filippov [Sat, 15 Oct 2011 22:56:45 +0000 (02:56 +0400)]
hw: add OpenCores 10/100 Mbps Ethernet controller

This is OpenCores Ethernet MAC + subset of National Semiconductors
DP83838C PHY.
OpenCores Ethernet MAC project: http://opencores.org/project,ethmac

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: rename dc232b board to sim
Max Filippov [Sat, 15 Oct 2011 22:56:07 +0000 (02:56 +0400)]
target-xtensa: rename dc232b board to sim

This is to get aligned with the linux name for this machine.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: add fsf core
Max Filippov [Sat, 15 Oct 2011 22:56:06 +0000 (02:56 +0400)]
target-xtensa: add fsf core

This is FSF big endian core implemented through linux overlay.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: add dc232b core
Max Filippov [Sat, 15 Oct 2011 22:56:05 +0000 (02:56 +0400)]
target-xtensa: add dc232b core

This is Diamond 232L Standard Core Rev.B (LE), implemented through
linux/gdb overlay.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: extract core configuration from overlay
Max Filippov [Sat, 15 Oct 2011 22:56:04 +0000 (02:56 +0400)]
target-xtensa: extract core configuration from overlay

Introduce overlay_tool.h that defines core configuration blocks from
data available in the linux architecture variant overlay.

Overlay data is automatically generated in the core configuration
process by Tensilica tools and can be directly converted to qemu xtensa
core description by overlay_tool.h

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement external interrupt mapping
Max Filippov [Sat, 15 Oct 2011 22:56:03 +0000 (02:56 +0400)]
target-xtensa: implement external interrupt mapping

Xtensa cores may have different mapping of external interrupt pins to
internal IRQ numers. Implement API to acquire core IRQ by its external
interrupt number.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: remove hand-written xtensa cores implementations
Max Filippov [Sat, 15 Oct 2011 22:56:02 +0000 (02:56 +0400)]
target-xtensa: remove hand-written xtensa cores implementations

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: increase xtensa options accuracy
Max Filippov [Sat, 15 Oct 2011 22:56:01 +0000 (02:56 +0400)]
target-xtensa: increase xtensa options accuracy

- add separate options for each operation in the MISC_OP;
- add an option for MULSH/MULUH;
- put S32C1I under conditional store option.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: update qemu-doc.texi
Max Filippov [Mon, 10 Oct 2011 10:48:23 +0000 (14:48 +0400)]
target-xtensa: update qemu-doc.texi

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: add MAC16 unit tests
Max Filippov [Mon, 10 Oct 2011 02:25:41 +0000 (06:25 +0400)]
target-xtensa: add MAC16 unit tests

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement MAC16 option
Max Filippov [Mon, 10 Oct 2011 02:25:40 +0000 (06:25 +0400)]
target-xtensa: implement MAC16 option

See ISA, 4.3.7 for the details.

- add ACC and MR special registers;
- implement MAC16 and all inner MAC* opcode groups.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: fix guest hang on masked CCOMPARE interrupt
Max Filippov [Mon, 10 Oct 2011 02:25:04 +0000 (06:25 +0400)]
target-xtensa: fix guest hang on masked CCOMPARE interrupt

QEMU timer is used to post CCOMPARE interrupt when the core is halted.
If that CCOMPARE interrupt is masked off then the timer must be rearmed
in the callback, otherwise it will be rearmed next time the core goes to
halt by the waiti instruction.

Add test case into timer testsuite.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoDrop obsolete nographic timer
Jan Kiszka [Fri, 30 Sep 2011 10:31:18 +0000 (12:31 +0200)]
Drop obsolete nographic timer

We flush coalesced MMIO in the device models now, and VNC - for which
this was once introduced - is also fine without it as it has its own
refresh timer.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoMove graphic-related coalesced MMIO flushes to affected device models
Jan Kiszka [Fri, 30 Sep 2011 10:31:14 +0000 (12:31 +0200)]
Move graphic-related coalesced MMIO flushes to affected device models

This is conceptually cleaner and will allow us to drop the nographic
timer. Moreover, it will be mandatory to fully exploit future per-device
coalesced MMIO rings.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Fri, 14 Oct 2011 17:36:50 +0000 (12:36 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

12 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Fri, 14 Oct 2011 15:47:33 +0000 (10:47 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

12 years agoMerge remote-tracking branch 'kraxel/usb.28' into staging
Anthony Liguori [Fri, 14 Oct 2011 15:46:35 +0000 (10:46 -0500)]
Merge remote-tracking branch 'kraxel/usb.28' into staging

12 years agoMerge remote-tracking branch 'qemu-kvm-tmp/memory/batch' into staging
Anthony Liguori [Fri, 14 Oct 2011 15:44:52 +0000 (10:44 -0500)]
Merge remote-tracking branch 'qemu-kvm-tmp/memory/batch' into staging

12 years agoblock: drop bdrv_has_async_rw()
Stefan Hajnoczi [Thu, 13 Oct 2011 20:09:32 +0000 (21:09 +0100)]
block: drop bdrv_has_async_rw()

Commit cd74d83345e0e3b708330ab8c4cd9111bb82cda6 ("block: switch
bdrv_read()/bdrv_write() to coroutines") removed the bdrv_has_async_rw()
callers.  This patch removes bdrv_has_async_rw() since it is no longer
used.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: drop .bdrv_read()/.bdrv_write() emulation
Stefan Hajnoczi [Thu, 13 Oct 2011 20:09:31 +0000 (21:09 +0100)]
block: drop .bdrv_read()/.bdrv_write() emulation

There is no need to emulate .bdrv_read()/.bdrv_write() since these
interfaces are only called if aio and coroutine interfaces are not
present.  All valid BlockDrivers must implement either sync, aio, or
coroutine interfaces.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: use coroutine interface for raw format
Stefan Hajnoczi [Thu, 13 Oct 2011 20:09:30 +0000 (21:09 +0100)]
block: use coroutine interface for raw format

The raw format delegates all operations to bs->file (the protocol).
Previously this block driver exposed both sync and aio interfaces.
Since the block layer now works in terms of coroutines, expose the
coroutine interfaces and drop the others.  This avoids unnecessary
emulation of sync and aio interfaces.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoraw-posix: remove bdrv_read()/bdrv_write()
Stefan Hajnoczi [Thu, 13 Oct 2011 20:09:29 +0000 (21:09 +0100)]
raw-posix: remove bdrv_read()/bdrv_write()

Block drivers only need to provide one of sync, aio, or coroutine
interfaces.  Since raw-posix.c provides aio interfaces, simply drop the
synchronous interfaces since they can be emulated using aio and
coroutines.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: drop emulation functions that use coroutines
Stefan Hajnoczi [Thu, 13 Oct 2011 20:09:28 +0000 (21:09 +0100)]
block: drop emulation functions that use coroutines

Block drivers that implement coroutine functions used to get sync and
aio wrappers.  This is no longer necessary since all request processing
now happens in a coroutine.  If a block driver implements the coroutine
interface then none of the other interfaces will be invoked.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock/qcow: Fix use of free() instead of g_free()
Stefan Weil [Fri, 7 Oct 2011 05:32:47 +0000 (07:32 +0200)]
block/qcow: Fix use of free() instead of g_free()

cppcheck reported this error:

qemu/block/qcow.c:599: error: Mismatching allocation and deallocation: cluster_data

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agosheepdog: correct spelling
Dong Xu Wang [Fri, 14 Oct 2011 07:41:06 +0000 (15:41 +0800)]
sheepdog: correct spelling

Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agotcg: Fix spelling in comment (varables -> variables)
Stefan Weil [Tue, 11 Oct 2011 17:43:15 +0000 (19:43 +0200)]
tcg: Fix spelling in comment (varables -> variables)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoremove hpet.h
Paolo Bonzini [Tue, 11 Oct 2011 07:49:43 +0000 (09:49 +0200)]
remove hpet.h

It is unused since the HPET and RTC timers were removed (commit
25f3151, 2011-05-31).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoarm_pic: Fix typo
Andreas Färber [Sun, 9 Oct 2011 23:27:01 +0000 (01:27 +0200)]
arm_pic: Fix typo

interrput -> interrupt

Cc: Paul Brook <paul@codesourcery.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqemu-char: Fix use of free() instead of g_free()
Stefan Weil [Fri, 7 Oct 2011 05:38:46 +0000 (07:38 +0200)]
qemu-char: Fix use of free() instead of g_free()

cppcheck reported these errors:

qemu-char.c:1667: error: Mismatching allocation and deallocation: s
qemu-char.c:1668: error: Mismatching allocation and deallocation: chr
qemu-char.c:1769: error: Mismatching allocation and deallocation: s
qemu-char.c:1770: error: Mismatching allocation and deallocation: chr

Tested-by: Dongxu Wang <wdongxu@linux.vnet.ibm.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqemu-options: avoid #if in spicevmc texi help
Stefan Hajnoczi [Thu, 6 Oct 2011 10:24:12 +0000 (11:24 +0100)]
qemu-options: avoid #if in spicevmc texi help

Preprocessor directives cannot be used in STEXI/ETEXI sections since
they are not passed through the preprocessor.  The spicevmc chardev
option help currently uses #if, which is included verbatim in the man
page output.

Fix this by simply stating that spicevmc chardevs are available only in
builds with spice support.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agolinux-aio: Allow reads beyond the end of growable images
Kevin Wolf [Thu, 13 Oct 2011 13:42:52 +0000 (15:42 +0200)]
linux-aio: Allow reads beyond the end of growable images

This is the linux-aio version of commits 22afa7b5 (raw-posix, synchronous) and
ba1d1afd (posix-aio-compat). Reads now produce zeros after the end of file
instead of failing or resulting in short reads, making linux-aio compatible
with the behaviour of synchronous raw-posix requests and posix-aio-compat.

The problem can be reproduced like this:

dd if=/dev/zero of=/tmp/test.raw bs=1 count=1234
./qemu-io -k -n -g -c 'read -p 1024 512' /tmp/test.raw

Previously, the result of this was 'read failed: Invalid argument', now the
read completes successfully.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoblock: switch bdrv_aio_writev() to coroutines
Stefan Hajnoczi [Thu, 13 Oct 2011 12:08:25 +0000 (13:08 +0100)]
block: switch bdrv_aio_writev() to coroutines

More sync, aio, and coroutine unification.  Make bdrv_aio_writev() go
through coroutine request processing.

Remove the dirty block callback mechanism which was needed only for aio
processing and can be done more naturally in coroutine context.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: mark blocks dirty on coroutine write completion
Stefan Hajnoczi [Thu, 13 Oct 2011 12:08:24 +0000 (13:08 +0100)]
block: mark blocks dirty on coroutine write completion

The aio write operation marks blocks dirty when the write operation
completes.  The coroutine write operation marks blocks dirty before
issuing the write operation.

It seems safest to mark the block dirty when the operation completes so
that anything tracking dirty blocks will not act before the change has
been made to the image file.

Make the coroutine write operation dirty blocks on write completion.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: switch bdrv_aio_readv() to coroutines
Stefan Hajnoczi [Thu, 13 Oct 2011 12:08:23 +0000 (13:08 +0100)]
block: switch bdrv_aio_readv() to coroutines

More sync, aio, and coroutine unification.  Make bdrv_aio_readv() go
through coroutine request processing.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: switch bdrv_read()/bdrv_write() to coroutines
Stefan Hajnoczi [Thu, 13 Oct 2011 12:08:22 +0000 (13:08 +0100)]
block: switch bdrv_read()/bdrv_write() to coroutines

The bdrv_read()/bdrv_write() functions call .bdrv_read()/.bdrv_write().
They should go through bdrv_co_do_readv() and bdrv_co_do_writev()
instead in order to unify request processing code across sync, aio, and
coroutine interfaces.  This is also an important step towards removing
BlockDriverState .bdrv_read()/.bdrv_write() in the future.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: split out bdrv_co_do_readv() and bdrv_co_do_writev()
Stefan Hajnoczi [Wed, 5 Oct 2011 16:17:03 +0000 (17:17 +0100)]
block: split out bdrv_co_do_readv() and bdrv_co_do_writev()

The public interface for I/O in coroutine context is bdrv_co_readv() and
bdrv_co_writev().  Split out the request processing code into
bdrv_co_do_readv() and bdrv_co_writev() so that it can be called
internally when we refactor all request processing to use coroutines.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: directly invoke .bdrv_* from emulation functions
Stefan Hajnoczi [Thu, 13 Oct 2011 12:08:21 +0000 (13:08 +0100)]
block: directly invoke .bdrv_* from emulation functions

The emulation functions which supply default BlockDriver .bdrv_*()
functions given another implemented .bdrv_*() function should not use
public bdrv_*() interfaces.  This patch ensures they invoke .bdrv_*()
directly to avoid adding an extra layer of coroutine request processing
and possibly entering an infinite loop.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: directly invoke .bdrv_aio_*() in bdrv_co_io_em()
Stefan Hajnoczi [Wed, 5 Oct 2011 16:17:02 +0000 (17:17 +0100)]
block: directly invoke .bdrv_aio_*() in bdrv_co_io_em()

We will unify block layer request processing across sync, aio, and
coroutines and this means a .bdrv_co_*() emulation function should not
call back into the public interface.  There's no need here, just call
.bdrv_aio_*() directly.

The gory details: bdrv_co_io_em() cannot call back into the public
bdrv_aio_*() interface since that will be handled using coroutines,
which causes us to call into bdrv_co_io_em() again in an infinite loop
:).

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agousb-hub: don't trigger assert on packet completion.
Gerd Hoffmann [Thu, 13 Oct 2011 10:52:47 +0000 (12:52 +0200)]
usb-hub: don't trigger assert on packet completion.

Calling usb_packet_complete() recursively when passing up the completion
event up the chain for devices connected via usb hub will trigger an
assert.  So don't do that, make the usb hub emulation call the upstream
completion callback directly instead.

Based on a patch from Stefan Hajnoczi <stefanha@gmail.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-hid: activate usb tablet / mouse after migration.
Gerd Hoffmann [Wed, 12 Oct 2011 10:54:35 +0000 (12:54 +0200)]
usb-hid: activate usb tablet / mouse after migration.

qemu uses the ps/2 mouse by default.  The usb tablet (or mouse) is
activated as soon as qemu sees some guest activity on the device,
i.e. polling for HID events.  That used to work fine for both fresh
boot and migration.

Remote wakeup support changed the picture though: There will be no
polling after migration in case the guest suspended the usb bus,
waiting for wakeup events.  Result is that the ps/2 mouse stays
active.

Fix this by activating the usb tablet / mouse in post_load() in case
the guest enabled remote wakeup.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agohw/usb-ohci: Honour endpoint maximum packet size
Peter Maydell [Wed, 14 Sep 2011 17:48:59 +0000 (18:48 +0100)]
hw/usb-ohci: Honour endpoint maximum packet size

Honour the maximum packet size for endpoints; this applies when
sending non-isochronous data and means we transfer only as
much as the endpoint allows, leaving the transfer descriptor
on the list for another go next time around. This allows
usb-net to work when connected to an OHCI controller model.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agohw/usb-ohci: Fix OHCI_TD_T1 bit position definition
Peter Maydell [Wed, 14 Sep 2011 17:49:00 +0000 (18:49 +0100)]
hw/usb-ohci: Fix OHCI_TD_T1 bit position definition

The OHCI Transfer Descriptor T (DataToggle) bits are 24 and 25;
fix an error which accidentally overlaid them both on the same bit.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-host: handle USBDEVFS_SETCONFIGURATION returning EBUSY
Gerd Hoffmann [Tue, 13 Sep 2011 09:55:15 +0000 (11:55 +0200)]
usb-host: handle USBDEVFS_SETCONFIGURATION returning EBUSY

In case the host uses the usb device usbfs will refuse to set the
configuration due to the device being busy.  Handle this case by
disconnection the interfaces, then trying again.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-host: factor out code
Gerd Hoffmann [Tue, 13 Sep 2011 09:37:47 +0000 (11:37 +0200)]
usb-host: factor out code

Move code to claim usb ports and to disconnect usb interfaces into
usb_host_claim_port and usb_host_disconnect_ifaces functions.  No
functional change.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: fix port reset
Gerd Hoffmann [Thu, 15 Sep 2011 10:10:21 +0000 (12:10 +0200)]
usb: fix port reset

commit 891fb2cd4592b6fe76106a69e0ca40efbf82726a removed the implicit
detach before (re-)attaching in usb_attach().  Some usb host controllers
used that behavior though to do a port reset by a detach+attach
sequence.

This patch establishes old behavior by adding a new usb_reset() function
for port resets and putting it into use, thereby also unifying port
reset behavior of all host controllers.  The patch also adds asserts to
usb_attach() and usb_detach() to make sure the calls are symmetrical.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-hub: need to check dev->attached
Gerd Hoffmann [Thu, 15 Sep 2011 07:20:02 +0000 (09:20 +0200)]
usb-hub: need to check dev->attached

commit 891fb2cd4592b6fe76106a69e0ca40efbf82726a did that for all host
controllers, the usb hub was left out by accident.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-storage: fix NULL pointer dereference.
Gerd Hoffmann [Fri, 2 Sep 2011 11:05:13 +0000 (13:05 +0200)]
usb-storage: fix NULL pointer dereference.

When a usb packet is canceled we need to check whenever we actually have
a scsi request in flight before we try to cancel it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoisa: Remove isa_init_ioport_range and isa_init_ioport
Richard Henderson [Tue, 16 Aug 2011 16:02:36 +0000 (09:02 -0700)]
isa: Remove isa_init_ioport_range and isa_init_ioport

All users have been converted to either isa_register_ioport
or isa_register_old_portio_list.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoide: Convert to isa_register_portio_list
Richard Henderson [Tue, 16 Aug 2011 15:59:00 +0000 (08:59 -0700)]
ide: Convert to isa_register_portio_list

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agovmport: Convert to isa_register_ioport
Richard Henderson [Tue, 16 Aug 2011 15:38:14 +0000 (08:38 -0700)]
vmport: Convert to isa_register_ioport

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agopc: Convert port92 to isa_register_ioport
Richard Henderson [Tue, 16 Aug 2011 15:32:44 +0000 (08:32 -0700)]
pc: Convert port92 to isa_register_ioport

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agovga: Convert to isa_register_portio_list
Richard Henderson [Tue, 16 Aug 2011 15:27:39 +0000 (08:27 -0700)]
vga: Convert to isa_register_portio_list

[jan: fix cut'n'paste errors]
[avi: adjust pci variants not to use isa functions]

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agosb16: Convert to isa_register_portio_list
Richard Henderson [Mon, 15 Aug 2011 23:10:47 +0000 (16:10 -0700)]
sb16: Convert to isa_register_portio_list

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoparallel: Convert to isa_register_portio_list
Richard Henderson [Mon, 15 Aug 2011 22:55:09 +0000 (15:55 -0700)]
parallel: Convert to isa_register_portio_list

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agone2000: Convert to isa_register_ioport
Richard Henderson [Mon, 15 Aug 2011 22:42:46 +0000 (15:42 -0700)]
ne2000: Convert to isa_register_ioport

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agortc: Convert to isa_register_ioport
Richard Henderson [Mon, 15 Aug 2011 22:40:21 +0000 (15:40 -0700)]
rtc: Convert to isa_register_ioport

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agom48t59: Convert to isa_register_ioport
Richard Henderson [Mon, 15 Aug 2011 22:33:40 +0000 (15:33 -0700)]
m48t59: Convert to isa_register_ioport

The sysbus interface is as yet unconverted.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agogus: Convert to isa_register_portio_list
Richard Henderson [Mon, 15 Aug 2011 22:25:26 +0000 (15:25 -0700)]
gus: Convert to isa_register_portio_list

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agofdc: Convert to isa_register_portio_list
Richard Henderson [Mon, 15 Aug 2011 22:08:45 +0000 (15:08 -0700)]
fdc: Convert to isa_register_portio_list

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoisa: Add isa_register_portio_list()
Avi Kivity [Mon, 26 Sep 2011 11:52:44 +0000 (14:52 +0300)]
isa: Add isa_register_portio_list()

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agomemory: Fix old portio word accesses
Jan Kiszka [Sun, 18 Sep 2011 12:51:58 +0000 (14:51 +0200)]
memory: Fix old portio word accesses

As we register old portio regions via ioport_register, we are also
responsible for providing the word access wrapper.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoIntroduce PortioList
Avi Kivity [Mon, 26 Sep 2011 11:52:26 +0000 (14:52 +0300)]
Introduce PortioList

Add a type and methods for manipulating a list of disjoint I/O ports,
used in some older hardware devices.

Based on original patch by Richard Henderson.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agovvfat: Fix potential buffer overflow
Kevin Wolf [Wed, 1 Jun 2011 08:57:00 +0000 (10:57 +0200)]
vvfat: Fix potential buffer overflow

path2[PATH_MAX] can be used for the null termination, so make the array big
enough to allow this.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock/vvfat: Remove unused code
Stefan Weil [Sat, 1 Oct 2011 07:05:45 +0000 (09:05 +0200)]
block/vvfat: Remove unused code

The unused code was detected using cppcheck.

Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock/vvfat: Fix potential memory leaks and other memory errors
Stefan Weil [Fri, 30 Sep 2011 21:29:53 +0000 (23:29 +0200)]
block/vvfat: Fix potential memory leaks and other memory errors

cppcheck reported memory leaks and mismatched g_malloc() with free()
instead of g_free().

Fix these errors.

Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoHMP: Print 'io-status' information
Luiz Capitulino [Mon, 26 Sep 2011 20:43:55 +0000 (17:43 -0300)]
HMP: Print 'io-status' information

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoQMP: query-status: Add 'io-status' key
Luiz Capitulino [Mon, 26 Sep 2011 20:43:54 +0000 (17:43 -0300)]
QMP: query-status: Add 'io-status' key

Contains the I/O status for the given device. The key is only present
if the device supports it and the VM is configured to stop on errors.

Please, check the documentation being added in this commit for more
information.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoscsi: Support I/O status
Luiz Capitulino [Mon, 26 Sep 2011 20:43:53 +0000 (17:43 -0300)]
scsi: Support I/O status

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide: Support I/O status
Luiz Capitulino [Mon, 26 Sep 2011 20:43:52 +0000 (17:43 -0300)]
ide: Support I/O status

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agovirtio: Support I/O status
Luiz Capitulino [Mon, 26 Sep 2011 20:43:51 +0000 (17:43 -0300)]
virtio: Support I/O status

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: Keep track of devices' I/O status
Luiz Capitulino [Mon, 26 Sep 2011 20:43:50 +0000 (17:43 -0300)]
block: Keep track of devices' I/O status

This commit adds support to the BlockDriverState type to keep track
of devices' I/O status.

There are three possible status: BDRV_IOS_OK (no error), BDRV_IOS_ENOSPC
(no space error) and BDRV_IOS_FAILED (any other error). The distinction
between no space and other errors is important because a management
application may want to watch for no space in order to extend the
space assigned to the VM and put it to run again.

Qemu devices supporting the I/O status feature have to enable it
explicitly by calling bdrv_iostatus_enable() _and_ have to be
configured to stop the VM on errors (ie. werror=stop|enospc or
rerror=stop).

In case of multiple errors being triggered in sequence only the first
one is stored. The I/O status is always reset to BDRV_IOS_OK when the
'cont' command is issued.

Next commits will add support to some devices and extend the
query-block/info block commands to return the I/O status information.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agolinux-aio: Fix laio_submit error handling
Kevin Wolf [Thu, 22 Sep 2011 12:21:30 +0000 (14:21 +0200)]
linux-aio: Fix laio_submit error handling

The error handling order was in the wrong order, so that either the ACB would
be leaked or the counter would be decremented when it shouldn't.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: allow resizing of images residing on host devices
Christoph Hellwig [Tue, 20 Sep 2011 23:10:37 +0000 (01:10 +0200)]
block: allow resizing of images residing on host devices

Allow to resize images that reside on host devices up to the available
space.  This allows to grow images after resizing the device manually or
vice versa.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoisa: Tidy support code for isabus_get_fw_dev_path
Richard Henderson [Mon, 15 Aug 2011 18:59:09 +0000 (11:59 -0700)]
isa: Tidy support code for isabus_get_fw_dev_path

The only user of ISADevice.ioports is isabus_get_fw_dev_path, and it
only looks at the first entry of the array.  Which suggests that this
entire array+sort operation can be replaced by a simple minimum.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoppc_newworld: convert to memory API
Avi Kivity [Tue, 13 Sep 2011 13:30:29 +0000 (16:30 +0300)]
ppc_newworld: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agohw/versatile_pci: Expose multiple sysbus mmio regions
Peter Maydell [Thu, 1 Sep 2011 17:36:53 +0000 (18:36 +0100)]
hw/versatile_pci: Expose multiple sysbus mmio regions

Clean up versatile_pci to expose the various PCI mmio regions
properly as separate mmio regions rather than as a single mmio
which uses callbacks to map and unmap everything.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agohw/arm11mpcore: Clean up to avoid using sysbus_mmio_init_cb2
Peter Maydell [Thu, 1 Sep 2011 17:36:52 +0000 (18:36 +0100)]
hw/arm11mpcore: Clean up to avoid using sysbus_mmio_init_cb2

Clean up the initialisation of the realview_mpcore device to avoid
using sysbus_init_mmio_cb2(): we can pass through the MemoryRegion
of the private arm11mpcore_priv device directly now.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoppc405_boards: convert to memory API
Avi Kivity [Mon, 12 Sep 2011 13:43:53 +0000 (16:43 +0300)]
ppc405_boards: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agopetalogix_s2adsp1800: convert to memory API
Avi Kivity [Mon, 12 Sep 2011 13:31:50 +0000 (16:31 +0300)]
petalogix_s2adsp1800: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agopetalogix_ml605: convert to memory API
Avi Kivity [Mon, 12 Sep 2011 12:27:25 +0000 (15:27 +0300)]
petalogix_ml605: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agopalm: convert to memory API
Avi Kivity [Mon, 12 Sep 2011 12:18:33 +0000 (15:18 +0300)]
palm: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agohw/lan9118.c: Convert to MemoryRegion
Peter Maydell [Thu, 25 Aug 2011 17:59:34 +0000 (18:59 +0100)]
hw/lan9118.c: Convert to MemoryRegion

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoMerge remote-tracking branch 'qmp/queue/qmp' into staging
Anthony Liguori [Mon, 10 Oct 2011 13:21:46 +0000 (08:21 -0500)]
Merge remote-tracking branch 'qmp/queue/qmp' into staging

12 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Mon, 10 Oct 2011 13:09:02 +0000 (08:09 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

12 years agoMerge remote-tracking branch 'qemu-kvm-tmp/uq/master' into staging
Anthony Liguori [Mon, 10 Oct 2011 13:07:51 +0000 (08:07 -0500)]
Merge remote-tracking branch 'qemu-kvm-tmp/uq/master' into staging

12 years agoRestore consistent formatting
malc [Sun, 9 Oct 2011 15:04:16 +0000 (19:04 +0400)]
Restore consistent formatting
Signed-off-by: malc <av1474@comtv.ru>
12 years agoMerge remote-tracking branch 'upstream' into memory/batch
Avi Kivity [Sun, 9 Oct 2011 11:11:50 +0000 (13:11 +0200)]
Merge remote-tracking branch 'upstream' into memory/batch

* upstream: (87 commits)
  target-alpha: Fix compilation errors for 32 bit hosts
  target-alpha: Add high-resolution access to wall clock and an alarm.
  target-alpha: Implement HALT IPR.
  target-alpha: Implement WAIT IPR.
  target-alpha: Add CLIPPER emulation.
  target-alpha: Add custom PALcode image for CLIPPER emulation.
  target-alpha: Honor icount for RPCC instruction.
  tcg/s390: Remove unused tcg_out_addi()
  tcg/ia64: Remove unused tcg_out_addi()
  ARM: fix segfault
  ppc64: Fix linker script
  pseries: Implement set-time-of-day RTAS function
  pseries: Refactor spapr irq allocation
  PPC: Clean up BookE timer code
  PPC: booke timers
  KVM: PPC: Use HIOR setting for -M pseries with PR KVM
  KVM: Update kernel headers
  KVM: Update kernel headers
  PPC: Fix heathrow PIC to use little endian MMIO
  PPC: Fix via-cuda memory registration
  ...

Conflicts:
hw/milkymist-uart.c
hw/ppce500_mpc8544ds.c

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agotarget-alpha: Fix compilation errors for 32 bit hosts
Stefan Weil [Sun, 9 Oct 2011 06:50:50 +0000 (08:50 +0200)]
target-alpha: Fix compilation errors for 32 bit hosts

On i386, these errors were reported:

qemu/hw/alpha_dp264.c: In function ‘clipper_init’:
qemu/hw/alpha_dp264.c:158: error: integer constant is too large for ‘unsigned long’ type

qemu/hw/alpha_typhoon.c: In function ‘typhoon_init’:
qemu/hw/alpha_typhoon.c:737: error: integer constant is too large for ‘long’ type
qemu/hw/alpha_typhoon.c:741: error: integer constant is too large for ‘long’ type
qemu/hw/alpha_typhoon.c:745: error: integer constant is too large for ‘long’ type
qemu/hw/alpha_typhoon.c:749: error: integer constant is too large for ‘long’ type
qemu/hw/alpha_typhoon.c:757: error: integer constant is too large for ‘long’ type
qemu/hw/alpha_typhoon.c:767: error: integer constant is too large for ‘long’ type
qemu/hw/alpha_typhoon.c:772: error: integer constant is too large for ‘long’ type

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoMerge branch 'axp-system-7' of git://repo.or.cz/qemu/rth
Blue Swirl [Sat, 8 Oct 2011 16:03:58 +0000 (16:03 +0000)]
Merge branch 'axp-system-7' of git://repo.or.cz/qemu/rth

* 'axp-system-7' of git://repo.or.cz/qemu/rth:
  target-alpha: Add high-resolution access to wall clock and an alarm.
  target-alpha: Implement HALT IPR.
  target-alpha: Implement WAIT IPR.
  target-alpha: Add CLIPPER emulation.
  target-alpha: Add custom PALcode image for CLIPPER emulation.
  target-alpha: Honor icount for RPCC instruction.

12 years agotarget-alpha: Add high-resolution access to wall clock and an alarm.
Richard Henderson [Thu, 28 Apr 2011 17:40:08 +0000 (10:40 -0700)]
target-alpha: Add high-resolution access to wall clock and an alarm.

The alarm is a fully general one-shot time comparator, which will be
usable under Linux as a hrtimer source.  It's much more flexible than
the RTC source available on real hardware.

The wall clock allows the guest access to the host timekeeping.  Much
like the KVM wall clock source for other guests.

Both are accessed via the PALcode Cserve entry point.

Signed-off-by: Richard Henderson <rth@twiddle.net>
12 years agotarget-alpha: Implement HALT IPR.
Richard Henderson [Wed, 27 Apr 2011 16:22:52 +0000 (09:22 -0700)]
target-alpha: Implement HALT IPR.

Signed-off-by: Richard Henderson <rth@twiddle.net>
12 years agotarget-alpha: Implement WAIT IPR.
Richard Henderson [Fri, 22 Apr 2011 01:58:09 +0000 (18:58 -0700)]
target-alpha: Implement WAIT IPR.

Signed-off-by: Richard Henderson <rth@twiddle.net>
12 years agotarget-alpha: Add CLIPPER emulation.
Richard Henderson [Thu, 25 Aug 2011 21:38:59 +0000 (11:38 -1000)]
target-alpha: Add CLIPPER emulation.

This is a DP264 variant, SMP capable, no unusual hardware present.

The emulation does not currently include any PCI IOMMU code.
Hopefully the generic support for that can be merged to HEAD soon.

Signed-off-by: Richard Henderson <rth@twiddle.net>
12 years agotarget-alpha: Add custom PALcode image for CLIPPER emulation.
Richard Henderson [Fri, 24 Jun 2011 18:58:37 +0000 (11:58 -0700)]
target-alpha: Add custom PALcode image for CLIPPER emulation.

Signed-off-by: Richard Henderson <rth@twiddle.net>
12 years agotarget-alpha: Honor icount for RPCC instruction.
Richard Henderson [Thu, 22 Sep 2011 15:11:18 +0000 (08:11 -0700)]
target-alpha: Honor icount for RPCC instruction.

Signed-off-by: Richard Henderson <rth@twiddle.net>
12 years agoMerge branch 'for-upstream' of git://git.serverraum.org/git/mw/qemu-lm32
Blue Swirl [Sat, 8 Oct 2011 15:40:08 +0000 (15:40 +0000)]
Merge branch 'for-upstream' of git://git.serverraum.org/git/mw/qemu-lm32

* 'for-upstream' of git://git.serverraum.org/git/mw/qemu-lm32:
  milkymist: new interrupt map
  milkymist_uart: support new core version
  lm32: add missing qemu_init_vcpu() call

12 years agoMerge branch 'tracing' of git://repo.or.cz/qemu/stefanha
Blue Swirl [Sat, 8 Oct 2011 15:38:14 +0000 (15:38 +0000)]
Merge branch 'tracing' of git://repo.or.cz/qemu/stefanha

* 'tracing' of git://repo.or.cz/qemu/stefanha:
  trace: add arguments to bdrv_co_io_em() trace event
  trace: trace monitor qmp dispatch/completion
  trace: trace bdrv_open_common()
  hmp: re-enable trace-file command