Commit graph

13486 commits

Author SHA1 Message Date
Jan Kiszka a426e12217 kvm: Fix coding style violations
No functional changes.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-01-21 14:12:49 -02:00
Jan Kiszka b9bec74bcb kvm: x86: Fix a few coding style violations
No functional changes.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-01-21 14:05:22 -02:00
Jan Kiszka 95c077c919 kvm: x86: Prevent sign extension of DR7 in guest debugging mode
This unbreaks guest debugging when the 4th hardware breakpoint used for
guest debugging is a watchpoint of 4 or 8 byte lenght. The 31st bit of
DR7 is set in that case and used to cause a sign extension to the high
word which was breaking the guest state (vm entry failure).

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-01-21 14:05:22 -02:00
Jan Kiszka 3980e3024b kvm: x86: Remove obsolete SS.RPL/DPL aligment
This seems to date back to the days KVM didn't support real mode. The
check is no longer needed and, even worse, is corrupting the guest state
in case SS.RPL != DPL.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-01-21 14:05:22 -02:00
Jan Kiszka acaa75507b kvm: x86: Fix DPL write back of segment registers
The DPL is stored in the flags and not in the selector. In fact, the RPL
may differ from the DPL at some point in time, and so we were corrupting
the guest state so far.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-01-21 14:05:22 -02:00
Jin Dongming 7cc2cc3e26 kvm: introduce kvm_inject_x86_mce_on
Pass a table instead of multiple args.

Note:

    kvm_inject_x86_mce(env, bank, status, mcg_status, addr, misc,
                       abort_on_error);

is equal to:

    struct kvm_x86_mce mce = {
        .bank = bank,
        .status = status,
        .mcg_status = mcg_status,
        .addr = addr,
        .misc = misc,
    };
    kvm_inject_x86_mce_on(env, &mce, abort_on_error);

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Jin Dongming <jin.dongming@np.css.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-01-21 14:05:22 -02:00
Jin Dongming e387c33892 kvm: kvm_mce_inj_* subroutines for templated error injections
Refactor codes for maintainability.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Jin Dongming <jin.dongming@np.css.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-01-21 14:05:22 -02:00
Jin Dongming 6643e2f001 kvm: introduce kvm_mce_in_progress
Share same error handing, and rename this function after
MCIP (Machine Check In Progress) flag.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Jin Dongming <jin.dongming@np.css.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-01-21 14:05:22 -02:00
Jin Dongming 2bd3e04c3b Add function for checking mca broadcast of CPU
Add function for checking whether current CPU support mca broadcast.

Signed-off-by: Jin Dongming <jin.dongming@np.css.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-01-21 14:05:22 -02:00
Jin Dongming 31ce5e0c49 Add "broadcast" option for mce command
When the following test case is injected with mce command, maybe user could not
get the expected result.
    DATA
               command cpu bank status             mcg_status  addr   misc
        (qemu) mce     1   1    0xbd00000000000000 0x05        0x1234 0x8c

    Expected Result
           panic type: "Fatal Machine check"

That is because each mce command can only inject the given cpu and could not
inject mce interrupt to other cpus. So user will get the following result:
    panic type: "Fatal machine check on current CPU"

"broadcast" option is used for injecting dummy data into other cpus. Injecting
mce with this option the expected result could be gotten.

Usage:
    Broadcast[on]
           command broadcast cpu bank status             mcg_status  addr   misc
    (qemu) mce     -b        1   1    0xbd00000000000000 0x05        0x1234 0x8c

    Broadcast[off]
           command cpu bank status             mcg_status  addr   misc
    (qemu) mce     1   1    0xbd00000000000000 0x05        0x1234 0x8c

Signed-off-by: Jin Dongming <jin.dongming@np.css.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-01-21 14:05:22 -02:00
Jin Dongming b3cd24e04a Clean up cpu_inject_x86_mce()
Clean up cpu_inject_x86_mce() for later patch.

Signed-off-by: Jin Dongming <jin.dongming@np.css.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-01-21 14:05:22 -02:00
Lai Jiangshan 14a095184c kvm: convert kvm_ioctl(KVM_CHECK_EXTENSION) to kvm_check_extension()
simple cleanup and use existing helper: kvm_check_extension().

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-01-21 14:05:21 -02:00
Lai Jiangshan 276ce81563 kvm: Enable user space NMI injection for kvm guest
Make use of the new KVM_NMI IOCTL to send NMIs into the KVM guest if the
user space raised them. (example: qemu monitor's "nmi" command)

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-01-21 14:05:21 -02:00
Blue Swirl b646968336 checkpatch: adjust to QEMUisms
Change checkpatch.pl for QEMU use:
 - Root directory detection
 - Forbid tabs
 - Indent at 4 spaces
 - Allow typedefs
 - Enforce brace use even for single statement blocks
 - Don't suggest nonexistent cleanup tools

Mention the script in CODING_STYLE.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-20 20:58:56 +00:00
Blue Swirl 1ec3f6f9ab Add checkpatch.pl from Linux kernel
Unchanged import from
http://www.kernel.org/pub/linux/kernel/people/apw/checkpatch/checkpatch.pl-0.31

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-20 20:54:26 +00:00
Blue Swirl 4c3b5a4891 Add scripts directory
Move build and user scripts into scripts directory.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-20 20:54:21 +00:00
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