Commit graph

11652 commits

Author SHA1 Message Date
Jan Kiszka 4d2ffa08b6 vmstate: Add support for alias ID
Some legacy users (mostly PC devices) of vmstate_register manage
instance IDs on their own, and that unfortunately in a way that is
incompatible with automatically generated ones. This so far prevents
switching those users to vmstates that are registered by qdev.

To establish a migration path, this patch introduces the concept of
alias IDs. They can be passed to an extended vmstate registration
service, and qdev provides a set service to be used during device init.
find_se will consider the alias in addition to the default ID. We can
then start generating the default ID automatically and writing it on
vmsave, thus converting that format without breaking support for upward
migration.

The user is required specify the highest vmstate version for which the
alias is required. Once this version falls behind the minimum required
for a specific vmstate, an assertion triggers to motivate cleaning up
the obsolete alias.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 14:23:31 +00:00
Jan Kiszka ec86f3e1af vmstate: Drop unused post_save handler
No device makes use of it anymore.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 14:02:39 +00:00
Shin-ichiro KAWASAKI 604be20023 sh: sm501: add 2D engine support
In linux kernel v2.6.33, sm501 frame buffer driver modified to support
2D graphics engine on sm501 chip.  One example is "fill rectangle" operation.
But current qemu's sm501 emulation doesn't support it.  This results in
graphics console disturbance.

This patch introduces sm501 2D graphics engine emulation and solve this problem.

    Add SM501 2D hardware engine support.

     - Add 2D engine register set read/write handlers.
     - Support 'fill rectangle'. Other operations are left for future work.
     - Update SM501 support status comment.

Signed-off-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-15 13:57:22 +00:00
Andrzej Zaborowski e5d3b98d53 tmp105: update the register in post_load where it needs updating.
This was the only user of .post_save as noticed by Jan Kiszka and
seems to have been added there wrongly during conversion to
VMStateDescription.

Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
2010-05-15 14:31:27 +02:00
Blue Swirl 26a823305d cpus: add one 'const'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-14 19:32:21 +00:00
Blue Swirl af2960f942 e1000: make some tables 'const'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-14 19:32:18 +00:00
Blue Swirl 117e1e8244 ide: make a table 'const'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-14 19:32:14 +00:00
Blue Swirl 68f04a3c62 vga: make some tables 'const'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-14 19:32:11 +00:00
Blue Swirl d08555c17a Compile virtio-9p-debug and virtio-9p-local once
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-14 19:31:53 +00:00
Anthony Liguori 7ac9f9be20 Merge remote branch 'qemu-kvm/uq/master' into staging 2010-05-14 10:56:56 -05:00
Anthony Liguori 14ac15d3ac Update SeaBIOS
- 7d09d0e Fix virtio compile errors on various gcc versions.
 - 89acfa3 Support for booting from virtio disks
 - 6d66316 smbios: avoid counting io hole as ram
 - e5cd945 Fix error causing USB HID "boot" protocol to not be enabled.
 - 0e88576 Add support for USB mice.
 - dd5a8a6 When USB keyboard active, don't send keyboard commands to ps2 port.
 - 5718d56 Document usb-hid.c functions.
 - e438b0c Further parallelize init when using CONFIG_THREAD_OPTIONROMS.
 - f59b5ac Handle unknown function addresses in tools/checkstack.py.
 - 9ba1dea Simplify build by manually resolving external symbols in layoutrom.py.
 - 698d3f9 USB EHCI should yield() whil waiting for controller to ack reset.
 - f9a774c Add __attribute__((__malloc__)) declaration to internal malloc funcs.
 - b7045ce Minor - remove redundant check from ata_try_dma.
 - 67f6d37 Fix possible unitialized variable issue in usb msc.
 - a7eb8fc Some improvements to optionrom preemption support.
 - d28b0fe Refactor USB hub code.
 - ba28541 Prep version for next release.
 - 12bffd5 Update version to 0.6.0.
 - 87ab2fb Improve USB EHCI timing.
 - d705e5a Disable inlining on old compilers.
 - bca0736 Force use of indirect function calls in inline assembler.
 - d7eb27e Don't move EBDA while an optionrom is running (CONFIG_THREAD_OPTIONROMS).
 - 7415270 Call to int1552 (from int1346) should set regs->dl.
 - 9dc243e Adjust debug levels of device discovery.
 - d9c9361 Default CONFIG_COREBOOT_FLASH on; make depend on CONFIG_COREBOOT.
 - c35e1e5 Restore segment limits in handle_1589 code.
 - 11cc662 Extend time for rtc to be ready.
 - 4ed378a Backup and restore registers when calling out to user funcs.
 - 68c5139 Enable irqs in kbd/clock calls that caller might "spin" on.
 - f628244 Process event on ps2 keyboard irq even if event already read.
 - a5d8458 Revert "Unify ps2 port data processing."
 - b9ed5e2 Handle variable length return of ps2 port GETID command.
 - 67a9eec Prevent ps2 irqs from messing up ps2 init.
 - 6704cf9 Revert "Rework disabling of ps2 port irqs."
 - 808939c Fix smp cpu detect on gcc 4.5.
 - a979c1c Improvements to tools/checkstack.py.
 - 190cc62 Add USB EHCI controller support.
 - 0770d67 Some USB UHCI and OHCI fixes and cleanups.
 - bfe7ca7 Minor - USB OHCI interrupt queue should be one larger.
 - 09e2f7c Reduce size of USB 'struct uhci_td'.
 - 406fad6 Dynamically allocate USB controller structures.
 - 4547eb9 Replace USB encoded 'u32 endp' scheme with explicit struct fields.
 - 8ebcac0 Further parallelize USB init by launching a thread per usb port.
 - e908665 Introduce simple "mutex" locking code.
 - 3b79f8b Only compile usb-hub.c and paravirt.c with 32bit code.
 - 357bdfa Prefer passing a USB "pipe" structure over a USB endp encoding.
 - 7fb8ba8 Add a generic "internal error" warning function.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-14 10:55:58 -05:00
Blue Swirl 5acd0646b6 pckbd: don't use any static state
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-12 19:27:23 +00:00
Blue Swirl 9c0afd0e1d apb: don't use any static state
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-12 19:27:23 +00:00
Stefan Weil 113c61069c target-sparc: Fix wrong printf argument
cpu_get_ccr() returns a target_ulong, so a type cast is needed to avoid
wrong output on big endian hosts. We could also use TARGET_FMT_lx,
but that would print 8 instead of 2 digits.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-12 19:20:11 +00:00
Blue Swirl a72b517756 Update OpenBIOS images to r771
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-12 18:57:14 +00:00
Gleb Natapov c1667e4097 kvm: fix 80000001.EDX supported bit filtering
On AMD some bits from 1.EDX are reported in 80000001.EDX. The mask used
to copy bits from 1.EDX to 80000001.EDX is incorrect resulting in
unsupported features passed into a guest.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-05-11 17:07:36 -03:00
Gleb Natapov 4513d9232b Do not stop VM if emulation failed in userspace.
Continue vcpu execution in case emulation failure happened while vcpu
was in userspace. In this case #UD will be injected into the guest
allowing guest OS to kill offending process and continue.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-05-11 14:03:44 -03:00
Marcelo Tosatti 0af691d779 kvm: enable smp > 1
Process INIT/SIPI requests and enable -smp > 1.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-11 14:02:22 -03:00
Jan Kiszka dbaa07c404 kvm: validate context for kvm cpu get/put operations
Validate that KVM vcpu state is only read/written from cpu thread itself
or that cpu is stopped.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-11 14:02:22 -03:00
Marcelo Tosatti ced6c05143 move stop/stopped CPU_COMMON fields after area zeroed by reset
cpu_reset zeroes CPUState upto breakpoints member. Contents of
stop/stopped should not be zeroed on cpu_reset.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-11 14:02:22 -03:00
Marcelo Tosatti 3ae9501c5b add cpu_is_stopped helper
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-11 14:02:22 -03:00
Jan Kiszka 2705d56a6a kvm: synchronize state from cpu context
It is not safe to retrieve the KVM internal state of a given cpu
while its potentially modifying it.

Queue the request to run on cpu context, similarly to qemu-kvm.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-11 14:02:22 -03:00
Marcelo Tosatti e82bcec25f port qemu-kvm's on_vcpu code
run_on_cpu allows to execute work on a given CPUState context.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-11 14:02:22 -03:00
Marcelo Tosatti 1fbb22e5f8 standardize on qemu_cpu_kick for signalling cpu thread(s)
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-11 14:02:22 -03:00
Marcelo Tosatti 1a28cac316 make SIG_IPI to tcg vcpu thread reliable
Store tcg loop exit request on a global variable, and transfer it to
per-CPUState exit_request after assignment of cpu_single_env.

This makes exit request signal from robust. Drop the timedlock hack.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-11 14:02:22 -03:00
Marcelo Tosatti 273faf1b6d kvm: set cpu_single_env around KVM_RUN ioctl
Zero cpu_single_env before leaving global lock protection, and
restore on return.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-11 14:02:21 -03:00
Marcelo Tosatti 618a568da4 Fix -mem-path with hugetlbfs
Fallback to qemu_vmalloc in case file_ram_alloc fails.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-11 14:02:21 -03:00
Markus Armbruster 54d7cf136f doc: Clean up monitor command function index
Remove bogus entries "count", "format" and "size".  Accidentally added
in commit 70fcbbe7.

Add missing entry "qmp_capabilities".  Was forgotten in commit
4a7e1190.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-10 11:36:04 -05:00
Markus Armbruster c427ea9cd1 doc: Heading for monitor command cpu got lost, restore it
Broken in commit 2313086a.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-10 11:36:04 -05:00
Markus Armbruster 0e4aec988c doc: Fix acl monitor command documentation
Commit 15dfcd45 added acl_add and acl_reset, but fat-fingered their
documentation to read acl_allow and acl_remove.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-10 11:36:04 -05:00
Markus Armbruster 21413d683b doc: Fix host forwarding monitor command documentation
Commit f3546deb replaced host_net_redir by hostfwd_add,
hostfwd_remove, but neglected to update documentation.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-10 11:36:04 -05:00
Jan Kiszka 64d564094c lsi: Handle removal of selected devices
We must not store references to selected devices as they may be
hot-removed. Instead, look up the device based on its tag right before
using it. If the device disappeared, throw an interrupt and disconnect.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-10 11:36:04 -05:00
Jan Kiszka 12aa6dd61c lsi: Adjust some register reset values
According to the LSI spec, the reset value of dcmd, dstat, and ctest2
were wrong, and sdid as well as ssid require zero initialization. There
are surely more discrepancies, this is just another increment.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-10 11:36:03 -05:00
Jan Kiszka d43ba0af97 lsi: Purge message queue on reset
Declare the input message queue empty and initialize the related state
machine properly on controller reset. This fixes unrecoverable errors
when the controller was reset during ongoing requests.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-10 11:36:03 -05:00
Jan Kiszka 3e94cb0204 scsi-disk: Clear aiocb on read completion
Once the I/O completion callback returned, aiocb will be released by the
controller. So we have to clear the reference not only in
scsi_write_complete, but also in scsi_read_complete. Otherwise we risk
inconsistencies when a reset hits us before the related request is
released.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-10 11:36:03 -05:00
Jan Kiszka e9447f3571 SCSI: Add disk reset handler
Ensure that pending requests of an SCSI disk are purged on system reset
and also restore max_lba. The latter is no only present in the reset
handler as that one is called after init as well.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-10 11:36:03 -05:00
Amit Shah 4c64d5b52e iov: Move from hw/ to topdir
The iov functions can be useful to other code as well.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
CC: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-10 11:36:03 -05:00
Corentin Chary 14eb8b6829 vnc: set the right prefered encoding
message is a hint by the client as to its preference (the first
encoding specified being most preferred)"

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-10 11:36:03 -05:00
Blue Swirl 5a834bb47c sparc: Fix lazy flag calculation on interrupts, refactor
Recalculate Sparc64 CPU flags on interrupts, otherwise some earlier
flags could be stored to pstate.

Refactor PSR/CCR/CWP handling: concentrate the actual
functions to op_helper.c.

Thanks to Igor Kovalenko for reporting.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-09 20:19:04 +00:00
Blue Swirl 275ea26546 sparc: lazy C flag calculation
Calculate only the carry flag for ADDX/SUBX instead of full
set of flags.

Thanks to Igor Kovalenko for spotting a bug with an earlier
version.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-09 15:40:24 +00:00
Stefan Weil 72139e83a9 mips-dis: Add missing static attributes
mips_abi_choices and mips_arch_choices are only used locally.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-09 06:47:20 +00:00
Stefan Weil a5ad59166a tcg: Add missing 'static' attribute
tcg_out_reloc is only used locally (in */target.c which is
included in tcg.c).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-07 17:53:05 +00:00
Kevin Wolf 92b30744d7 qcow2: Remove static forward declaration
OpenBSDs gcc is said to generate warnings for this declaration, so don't
reference bdrv_qcow2 directly, but look it up using bdrv_find_format.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-07 17:11:37 +00:00
Kevin Wolf de5f3f40af Revert "Fix OpenBSD build"
This reverts commit 20d97356c9.
The BlockDriver definition should stay at the end of source files.

Conflicts:

	block/qcow2.c

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-07 17:11:02 +00:00
Richard Henderson 3cab721d0e Fill in unassigned mem read/write callbacks.
Implement the "functions may be omitted with NULL pointer"
interface mentioned in the function block comment by transforming
NULL entries in the read/write arrays into calls to the
unassigned_mem family of functions.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-07 16:58:38 +00:00
Stefan Weil 4cbd40cec0 darwin-user: Add missing static attribute
Function usage is only used locally, so add "static".

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-07 16:28:12 +00:00
Stefan Weil 051eb6c135 Add missing 'static' attribute
Function usage() is only used locally.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-07 16:28:10 +00:00
Blue Swirl 4450521668 sparc64: fix build with older gccs
Fix errors missed in 2065061ede22d401aae2ce995c3af54db9d28639:
 CC    sparc64-softmmu/helper.o
cc1: warnings being treated as errors
/src/qemu/target-sparc/helper.c: In function 'get_physical_address':
/src/qemu/target-sparc/helper.c:426: warning: 'context' may be used uninitialized in this function
/src/qemu/target-sparc/helper.c:426: note: 'context' was declared here

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-07 16:14:59 +00:00
Igor V. Kovalenko 2065061ede sparc64: handle asi referencing nucleus and secondary MMU contexts
- increase max supported MMU modes to 6
- handle nucleus context asi
- handle secondary context asi
- handle non-faulting loads from secondary context

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-06 23:14:26 +03:00
Igor V. Kovalenko 299b520cd4 sparc64: implement global translation table entries v1
- match global tte against any context
- show global tte in MMU dump

v0->v1: added default case to switch statement in demap_tlb
- should fix gcc warning about uninitialized context variable

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-06 20:13:36 +00:00