Commit Graph

13470 Commits

Author SHA1 Message Date
Aurelien Jarno 8e5977e5f5 gt64xxx: set isa_mem_base during registration
isa_mem_base is computed from registers during reset, but due to QEMU
limitations some devices (e.g. VGA card) need to know it earlier when
they are registered.

Workaround this by setting the value during registration instead of
reset.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 21:40:53 +01:00
Peter Maydell 730986e494 hw/pl190.c: Fix writing of default vector address
The PL190 implementation keeps the default vector address
in vect_addr[16], but we weren't using this for writes to
the DEFVECTADDR register. As a result of this fix the
default_addr structure member is unused and we can delete it.

Reported-by: Himanshu Chauhan <hschauhan@nulltrace.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 17:20:18 +01:00
Anthony Liguori 5dbbda3405 Merge remote branch 'mst/for_anthony' into staging 2011-01-20 09:05:37 -06:00
Aurelien Jarno d788b57051 target-ppc: fix wrong NaN tests
Some tests in FPU emulation code were wrongly using float64_is_nan()
before commit 185698715d, and wrongly
using float64_is_quiet_nan() after. Fix them by using float64_is_any_nan()
instead.

Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 15:11:14 +01:00
Aurelien Jarno 96912e3970 target-ppc: fix sNaN propagation
The current FPU code returns 0.0 if one of the operand is a
signaling NaN and the VXSNAN exception is disabled.

fload_invalid_op_excp() doesn't return a qNaN in case of a VXSNAN
exception as the operand should be propagated instead of a new
qNaN to be generated. Fix that by calling fload_invalid_op_excp()
only for the exception generation (if enabled), and use the softfloat
code to correctly compute the result.

Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 15:11:07 +01:00
Isaku Yamahata e10990c3f0 pci: use qemu_malloc() in pcibus_get_dev_path()
use qemu_malloc() instead of direct use of malloc().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-20 15:44:25 +02:00
Isaku Yamahata e407bf13ba msix: simplify write config
use pci_device_deassert_intx().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-20 15:33:34 +02:00
Isaku Yamahata 59369b0816 msi: simplify write config a bit.
use pci_device_deassert_intx().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-20 15:33:18 +02:00
Isaku Yamahata 4c92325b51 pci: deassert intx on reset.
deassert intx on device reset.
So far pci_device_reset() is used for system reset.
In that case, interrupt controller is reset at the same time so that
all irq is are deasserted.
But now pci bus reset/flr is supported, and in that case irq needs to be
disabled explicitly.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-20 15:33:05 +02:00
Dmitry Eremin-Solenikov b2bf03a90c pxa2xx_lcd: restore updating of display
Recently PXA2xx lcd have stopped to be updated incrementally (picture
frozen). This patch fixes that by passing non min/max x/y, but rather
(correctly) x/y and w/h.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Dmitry Eremin-Solenikov f69866ea32 pxa2xx: fix vmstate_pxa2xx_i2c
vmstate_pxa2xx_i2c incorrectly recursed to itself instead of going
to store slave device. Fix that stop stop qemu from segfaulting
during savevm for pxa2xx-based devices.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Dmitry Eremin-Solenikov aa9438d9f8 scoop: fix access to registers from second instance
Second instance of scoop contains registers shifted to 0x40 from the start
of the page. Instead of messing with register mapping, just limit register
address to 0x00..0x3f.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Dmitry Eremin-Solenikov f75d216a80 mainstone: fix name of the allocated memory for roms
Mainstone board has two flash chips (emulated by two ram regions), however
currently code tries to allocate them with the same name, which fails.
Fix that to make mainstone emulation work again.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Fred Boiteux 2a3c633c1e add bepo (french dvorak) keyboard layout
I'm using the Qemu program with VNC I/O, and I had some problems with
my keyboard layout, so I've prepared a definition to be included in
Qemu, built from Xorg description.

Signed-off-by: Frédéric Boiteux <fboiteux@free.fr>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Peter Maydell 3ac59434c7 stc91c111: Implement save/restore
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Peter Maydell ff1758533c pl080: Implement save/restore
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Peter Maydell 8c60d0652e pl110: Implement save/restore
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Peter Maydell 0dc5595c2c pl031: Implement save/restore
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Peter Maydell d6ac172a84 pl050: Implement save/restore
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Peter Maydell b5ad0ae767 arm_sysctl: Implement save/restore
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Peter Maydell a796d0acbb vpb_sic: Implement save/restore
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Peter Maydell ac49d75001 pl190: Implement save/restore
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Aurelien Jarno c2dd2a2352 gt64xxx: qdev conversion
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Aurelien Jarno cf154394bd sh_pci: qdev conversion
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Aurelien Jarno b7d2b02093 sh_serial: process all received characters
When operating on the SCIF, process all the received characters, as long
as the FIFO can handle them.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:20 +01:00
Aurelien Jarno b7277ac289 sh_serial: remove one level of indirection
The indirection functions are empty since commit
8da3ff1809.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:20 +01:00
Aurelien Jarno 373dfc441d usb-hid: modifiers should generate an event
When a modifier key is pressed or released, the USB HID keyboard still
answers NAK, unless another key is also pressed or released.

The patch fixes that by calling usb_hid_changed() when a modifier key
is pressed or released.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:20 +01:00
Aurelien Jarno de4af5f792 softfloat: fix floatx80_is_{quiet,signaling}_nan()
floatx80_is_{quiet,signaling}_nan() functions are incorrectly detecting
the type of NaN, depending on SNAN_BIT_IS_ONE, one of the two is
returning the correct value, and the other true for any kind of NaN.

This patch fixes that by applying the same kind of comparison as for
other float formats, but taking into account the explicit bit.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:20 +01:00
Edgar E. Iglesias 3a34dfd7f6 tcg: README, name deposit second argument len/LEN
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-20 12:16:57 +01:00
Richard Henderson c832e3de64 target-i386: Use deposit operation.
Use this for assignment to the low byte or low word of a register.

Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-20 12:16:12 +01:00
Richard Henderson b7767f0f3c tcg: Define "deposit" as an optional operation.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-20 12:16:05 +01:00
Edgar E. Iglesias 9f8beb6636 microblaze: Add support for load/store reversed
Load/store reversed (lwr/swr) are insns that endian translate
the sub-word part of the address and byteswap the data lanes.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2011-01-19 23:18:00 +01:00
Edgar E. Iglesias 9ef5535763 microblaze: Tweak comment, fast cases -> common cases
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-19 22:48:07 +01:00
Michael S. Tsirkin 2991181aaa pci: fix device paths
Patch a6a7005d14 generated
broken device paths. We snprintf with a length shorter
than the output, so the last character is discarded and replaced
by the null byte. Fix it up by snprintf to a buffer
which is larger by 1 byte and then memcpy the data (without
the null byte) to where we need it.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-19 21:18:19 +02:00
Blue Swirl 1b5f56b134 sparc: fix NaN handling
Fix several bugs in NaN handling:
 * e in fcmpe* only changes qNaN handling
 * FCC is unchanged if an exception is raised
 * clear previous FTT before setting it

Reported-by: Mateusz Loskot <mateusz@loskot.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-18 21:34:51 +00:00
Peter Maydell 5642463aee target-arm: Log instruction start in TCG code
Add support for logging the start of instructions in TCG
code debug dumps for ARM targets.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-18 15:23:44 +01:00
Edgar E. Iglesias 5580722456 mips: Break TBs after mfc0_count
Break the TB after reading the count register. This makes it
possible to take timer interrupts immediately after a read of
a possibly expired timer.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-18 12:32:46 +01:00
Edgar E. Iglesias e027e1f075 mips: Expire late timers when reading cp0_count
When reading cp0_count from a timer with a late trigger that should
already have expired, expire it and raise the timer irq.

This makes it possible for guest code (e.g, Linux) that first read
cp0_count, then compare it with cp0_compare and check for raised
timer interrupt lines to run reliably.

Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-18 12:28:32 +01:00
Edgar E. Iglesias b1dfe6437c mips: Break out cpu_mips_timer_expire
Reorganize for future patches, no functional change.

Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-18 12:27:52 +01:00
Blue Swirl 4a6648f44e Replace 'extern inline' with 'static inline'
Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-17 20:26:30 +00:00
Stefan Weil 29718712eb bsd-user: Fix possible memory leaks and wrong realloc call
These errors were reported by cppcheck:

[bsd-user/elfload.c:1108]: (error) Common realloc mistake: "syms" nulled but not freed upon failure
[bsd-user/elfload.c:1076]: (error) Memory leak: s
[bsd-user/elfload.c:1079]: (error) Memory leak: syms

v2:
* The previous fix for memory leaks was incomplete (thanks to Peter Maydell for te hint).
* Fix wrong realloc usage, too.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-17 20:23:47 +00:00
Aurelien Jarno 07d8a50cb0 sm501: add 2D engine copyrect support
Linux kernel started to use the SM501 2D engine for the console, and
especially the copyrect operation.

Implement this operation so that recent kernels can be used with QEMU.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-17 19:29:48 +01:00
Alex Williamson dc9121210e savevm: Fix no_migrate
The no_migrate save state flag is currently only checked in the
last phase of migration.  This means that we potentially waste
a lot of time and bandwidth with the live state handlers before
we ever check the no_migrate flags.  The error message printed
when we catch a non-migratable device doesn't get printed for
a detached migration.  And, no_migrate does nothing to prevent
an incoming migration to a target that includes a non-migratable
device.  This attempts to fix all of these.

One notable difference in behavior is that an outgoing migration
now checks for non-migratable devices before ever connecting to
the target system.  This means the target will remain listening
rather than exit from failure.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-17 18:22:17 +02:00
Anthony Liguori 9e8a69cfd6 Merge remote branch 'mst/for_anthony' into staging 2011-01-17 09:49:38 -06:00
Marcelo Tosatti 668643b025 acpi_piix4: expose no_hotplug attribute via i/o port
Expose no_hotplug attribute via I/O port, so ACPI BIOS can indicate
removability status to guest OS.

An updated seabios is required to make use of this feature (seabios.git
commit ID 3c241edf3d7ef29c21).

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Tested-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-17 17:30:40 +02:00
Marcelo Tosatti 9c046d96d4 document QEMU<->ACPIBIOS PCI hotplug interface
Document how QEMU communicates with ACPI BIOS for PCI hotplug.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-17 17:29:42 +02:00
Hervé Poussineau 51f9b84e75 m48t59: Fix a wrong opaque passed to nvram read and write routines
This fixes boot on PPC prep.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-16 22:15:58 +01:00
Fabien Chouteau e2af15b2ad gdbstub: Close connection in gdb_exit
On Windows, this is required to flush the remaining data in the IO stream,
otherwise Gdb do not receive the last packet.

Version 2:
   Fix linux-user build error.

Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2011-01-16 20:56:01 +01:00
Michael Tokarev a8fb7ff3fd USB keyboard emulation key mapping error
The USB keyboard emulation's translation table in hw/usb-hid.c doesn't
match the codes actually sent for the Logo (a.k.a. "Windows") or Menu
keys. This results in the guest OS not being able to receive these keys
at all when the USB keyboard emulation is being used.

In particular, both the keymap in /usr/share/kvm/keymaps/modifiers and
the evdev table in x_keymap.c map these keys to 0xdb, 0xdc, and 0xdd,
while usb_hid_usage_keys[] seems to be expecting them to be mapped to
0x7d, 0x7e, and 0x7f.

The attached patch seems to fix the problem, at least in my (limited)
testing.

http://bugs.debian.org/578846
http://bugs.debian.org/600593 (cloned from the above against different pkg)
https://bugs.launchpad.net/qemu/+bug/584139

Signed-Off-By: Brad Jorsch <anomie@users.sourceforge.net>
Signed-Off-By: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-16 19:52:48 +01:00
Aurelien Jarno b2d9eda5d4 target-sh4: implement negc using TCG
Using setcond it's now possible to generate a relatively short negc
instruction in TCG.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-16 13:19:20 +01:00