severe memory leak caused by broken palette_destroy() function
The following commit breaks the code of the function palette_destroy().
http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=commit;h=e31e3694afef58ba191cbcc6875ec243e5971268
The broken code causes a severe memory leak of 'VncPalette' structures...
vl.c: Fix compilation failure if CONFIG_SDL isn't defined
Fix a compilation failure if CONFIG_SDL isn't defined (gcc complainedthat the label 'invalid_display' wasn't used).
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote branch 'amit/for-anthony' into staging
tcg/arm: Support host code being compiled for Thumb
Although the TCG generated code is always in ARM mode, it is possiblethat the host code was compiled by gcc in Thumb mode (this is often thedefault for Linux distributions targeting ARM v7 only). Handle this...
Revert "x86: Save/restore PAT MSR"
This reverts commit c995b495b9d6e60ab1e390bd398a22425d0b3c8c.
From Jan Kiszka:
Ouch, indeed. Moreover, CPU_SAVE_VERSION was not updated (likely the reason for the breakage). Thanks for debugging this!
Anthony (or whoever), please revert this unneeded commit in qemu.git....
vnc: fix build error from VNC_DIRTY_WORDS
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
error message if user specifies SDL cmd line option when SDL is disabled
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
error message if user specifies curses on cmd line when curses is disabled
Make VNC support optional
Per default VNC is enabled.
qmp-commands.hx: Clean up mess of client_migrate_info
client_migrate_info was put into qmp-commands.hx in the middle ofmigrate_set_speed, between the command and it's description. Inaddition client_migrate_info put the description before the commanditself, which is the wrong order....
fix vnc regression
This patch fix the following regression:1. we should use bitmap_set() and bitmap_clear() to replace vnc_set_bits().
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Consolidate DisplaySurface allocation in qemu_alloc_display()
This removes various code duplication from console.e and sdl.c
Introduce -display argument
This patch introduces a -display argument which consolidates thesetting of the display mode. Valid options are:sdl/curses/default
Introduce -display none
New option -display none. This option differs from -nographic by nottrying to take control of stdio etc. but instead behaves as if agraphics display is enabled, except that it doesn't show one.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>...
Add support for -display vnc
target-arm: use make_float32() to make constant floats for VRSQRTS
The preferred way to create a constant floating point value is to usemake_float32() rather than doing a runtime int32_to_float32().Convert the code in the VRSQRTS helper to work this way....
target-arm: Fix VRECPS edge cases handling
Correct the handling of edge cases for the VRECPS instruction: * this is a Neon instruction so uses the "standard FPSCR value" * (zero, inf) is a special case which returns 2.0
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
target-arm: Fix TCG temporary leaks for scalar VMULL
Fix a TCG temporary leak when translating 32-bit scalar VMULL.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-arm: Set Q bit for overflow in SMUAD and SMLAD
SMUAD and SMLAD are supposed to set the Q bit if the addition ofthe two 16x16 multiply products and optional accumulator overflowsconsidered as a signed value. However we were only doing this checkfor the addition of the accumulator, not when adding the products,...
target-arm: Fix GE bits for v6media signed modulo arithmetic
Fix the signed modulo arithmetic helpers for the v6mediainstructions (SADD8, SSUB8, SADD16, SSUB16, SASX, SSAX) to setthe GE bits correctly (based on the result of the add or subtractbefore it is truncated to 16 bits, not after)....
target-arm: Fix UNDEF cases in Thumb load/store
Decode of Thumb load/store was merging together the cases of 'bit 11==0'(reg+reg LSL imm) and 'bit 11==1' (reg+imm). This happens to work forvalid instruction patterns but meant that we would not UNDEF for the...
linux-user: Fix unlock_user() call in return from poll()
Correct the broken attempt to calculate the third argumentto unlock_user() in the code path which unlocked the pollfdarray on return from poll() and ppoll() emulation. (Thisonly caused a problem if unlock_user() wasn't a no-op, eg...
vmmouse: Fix initialization
Latest refactorings left vmmouse nonfunctional behind. Fix it by addingthe required device initialization.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
vmmouse: Register vmstate via qdev
vmmouse: Fix typo preventing x86-64 build
fix applesmc REV key
Fix applesmc REV key string literal hex encoding.
Signed-off-by: René Rebe <rene@exactcode.de>Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
enable kvm for ppc(32) on ppc64
ppc64 is backward compatible, likewise.
target-ppc: add support for 6 SPE instructions
Add support for 6 SPE instructions: evmra, evmwsmi{a{a}}, evmwumi{a{a}}
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
pc-bios: update linuxboot.bin and multiboot.bin
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
fix linuxboot.bin and multiboot.bin to not hijack int19
Currently linuxboot.bin and multiboot.bin option roms override int19vector to intercept boot process. No sane option rom should do that.Provide bev entry instead that will be called by BIOS if option rom...
Merge remote branch 'qemu-kvm/uq/master' into staging
Fix migration uint8 arrys handled
commit 82fa39b75181b730d6d4d09f443bd26bcfcd045c
only contains half of the fix. It forgots the save state fix forUINT8 indexes.
Anthony, please apply, without this migration using hpet is broken.(only current user)....
seabios: update to latest git
- cc97564 Add config option to permit running option roms with bad checksums. - 424f217 Add config option to disable MTRR initialization. - fb2f10d Prep version for next release. - f18b09b Update version to 0.6.2 - 20fcf9b lets pretend that RTC can be used to wakeup from S4...
softfloat: Drop [s]bits{8, 16, 32, 64} types in favor of [u]int{8, 16, 32, 64}_t
They are defined with the same semantics as the POSIX types,so prefer those for consistency. Suggested by Peter Maydell.
Cc: Peter Maydell <peter.maydell@linaro.org>Cc: Aurelien Jarno <aurelien@aurel32.net>...
softfloat: Resolve type mismatches between declaration and implementation
The original SoftFloat 2.0b library avoided the use of custom integer typesin its public headers. This requires the definitions of int{8,16,32,64} tomatch the assumptions in the declarations. This breaks on BeOS R5 and Haiku/x86,...
softfloat: Prepend QEMU-style header with derivation notice
The SoftFloat license requires "prominent notice that the workis derivative". Having added features like improved 16-bit supportfor arm already, add such a notice to the sources.
softfloat-native.[ch] are not under the SoftFloat license...
e1000: Fix multi-descriptor packet checksum offload
The PCI/PCI-X Family of Gigabit Ethernet Controllers SoftwareDeveloper’s Manual states the following about the POPTS field:
Provides a number of options which control the handling of this packet. This field is ignored except on the first data descriptor of...
Merge branch 'for-anthony' of git://github.com/bonzini/qemu
Merge branch 'for-anthony' of git://repo.or.cz/qemu/kevin
rbd: don't link with -lcrypto
rbd support tries to both link with -lrados and -lcrypto. While thefirst one is of course necessary, the second is not necessary (onlylibrados ifself needs to link with libcrypto).
This fixes a licensing issue: qemu as a whole is GPL v2, and thus can't...
hw/arm_sysctl.c: Add the Versatile Express system registers
Add support for the Versatile Express SYS_CFG registers, which providea generic means of reading or writing configuration information fromvarious parts of the board. We only implement shutdown and reset....
char: Prevent multiple devices opening same chardev
Prevent:
-chardev socket,path=/tmp/foo,server,nowait,id=c0 \-device virtserialport,chardev=c0,id=vs0 \-device virtserialport,chardev=c0,id=vs1
Reported-by: Mike Cao <bcao@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-console: Keep chardev open for other users after hot-unplug
After a hot-unplug operation, the previous behaviour was to close thechardev. That meant the chardev couldn't be re-used. Also, sincechardev hot-plug isn't possible so far, this means virtio-console...
virtio-serial: Enable ioeventfd
Enable ioeventfd for virtio-serial devices by default. Commit25db9ebe15125deb32958c6df74996f745edf1f9 lists the benefits of usingioeventfd.
Copying a file from guest to host over a virtio-serial channel didn'tshow much difference in time or io_exit rate....
virtio-serial-bus: Simplify handle_output() function
There's no code change, just re-arrangement to simplify the functionafter recent modifications.
Reported-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-serial: Don't clear ->have_data() pointer after unplug
After a port unplug operation, the port->info->have_data() pointer wasset to NULL. The problem is, the ->info struct is shared by all ports,effectively disabling writes to other ports.
Reported-by: juzhang <juzhang@redhat.com>...
virtio-serial: Use a struct to pass config information from proxy
Instead of using a single variable to pass to the virtio_serial_initfunction, use a struct so that expanding the number of variables to bepassed on later is easier.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-serial: Disallow generic ports at id 0
Port 0 is reserved for virtconsole devices for backward compatibilitywith the old -virtioconsole (from qemu 0.12) device type.
libvirt prior to commit 8e28c5d40200b4c5d483bd585d237b9d870372e5 usedport 0 for generic ports. libvirt will no longer do that, but disallow...
add more helper functions with explicit milli/nanosecond resolution
The code doesn't make much sense right now, but it will assoon as timers will be able to scale their resolution arbitrarily.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
change all rt_clock references to use millisecond resolution accessors
This was done with:
sed -i '/get_clock\>.*rt_clock/s/get_clock\>/get_clock_ms/' \ $(git grep -l 'get_clock\>.*rt_clock' ) sed -i '/new_timer\>.*rt_clock/s/new_timer\>/new_timer_ms/' \...
change all other clock references to use nanosecond resolution accessors
sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \ $(git grep -l 'qemu_get_clock\>' ) sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \ $(git grep -l 'qemu_new_timer\>' )...
add a generic scaling mechanism for timers
This enables rt_clock timers to use nanosecond resolution, just byusing the _ns functions; there is really no reason to forbid that.
Migrated timers are all using vm_clock (of course; but I checked thatanyway) so the timers in the savevm files are already in nanosecond...
remove qemu_get_clock
These patches are already not doing a great service to out-of-treemodifications to QEMU. However, at least we can warn them by gettingrid of the old confusing functions, or otherwise causing compilationerrors. This patch removes qemu_get_clock; the previous one changed...
Fix conversions from pointer to int and vice versa
Here the int values fds0, sigfd, s, sock and fd are convertedto void pointers which are later converted back to an int value.
These conversions should always use intptr_t instead of unsigned long.
They are needed for environments where sizeof(long) != sizeof(void *)....
petalogix_ml605_mmu: remove unused variable
Remove a write-only variable, spotted by GCC 4.6.0:/src/qemu/hw/petalogix_ml605_mmu.c: In function 'petalogix_ml605_init':/src/qemu/hw/petalogix_ml605_mmu.c:153:11: error: variable 'serial' set but not used [-Werror=unused-but-set-variable]...
qemu-thread: delete unused functions
qemu_mutex_timedlock() and qemu_cond_timedwait() are no longer used.
Remove them and their helper timespec_add_ms().
Reported-by: François Revol <revol@free.fr>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
w32: Add missing functions qemu_mutex_destroy, qemu_cond_destroy
These functions were missing in commit9257d46d55f1fe4e8209be9a6870e339ac3266fe.
Both functions are needed for compilations withconfiguration --enable-vnc-thread.
Cc: Paolo Bonzini <pbonzini@redhat.com>...
i8254: Fix migration from older versions
qdev conversion broke migration as the previous version used vmstateinstance IDs derived from the iobase. Fix it by registering a legacyalias.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Expose thread_id in info cpus
Based on patch by Glauber Costa:
To allow management applications like libvirt to apply CPU affinities tothe VCPU threads, expose their ID via info cpus. This patch provides thepre-existing and used interface from qemu-kvm....
kvm: Consider EXIT_DEBUG unknown without CAP_SET_GUEST_DEBUG
Without KVM_CAP_SET_GUEST_DEBUG, we neither motivate the kernel toreport KVM_EXIT_DEBUG nor do we expect such exits. So fall through tothe arch code which will simply report an unknown exit reason....
kvm: Keep KVM_RUN return value in separate variable
Avoid using 'ret' both for the return value of KVM_RUN as well as thecode kvm_cpu_exec is supposed to return. Both have no direct relation.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
kvm: Reorder error handling of KVM_RUN
Test for general errors first as this is the slower path.
kvm: Rework inner loop of kvm_cpu_exec
Let kvm_cpu_exec return EXCP_* values consistently and generate thosecodes already inside its inner loop. This means we will now re-enter thekernel while ret == 0.
Update kvm_handle_internal_error accordingly, but keep...
kvm: Align kvm_arch_handle_exit to kvm_cpu_exec changes
Make the return code of kvm_arch_handle_exit directly usable forkvm_cpu_exec. This is straightforward for x86 and ppc, just s390would require more work. Avoid this for now by pushing the return code...
kvm: x86: Reorder functions in kvm.c
Required for next patch which will access guest debug services fromkvm_arch_handle_exit. No functional changes.
kvm: x86: Push kvm_arch_debug to kvm_arch_handle_exit
There are no generic bits remaining in the handling of KVM_EXIT_DEBUG.So push its logic completely into arch hands, i.e. only x86 so far.
kvm: Add in-kernel irqchip awareness to cpu_thread_is_idle
With in-kernel irqchip support enabled, the vcpu threads sleep in kernelspace while halted. Account for this difference in cpu_thread_is_idle.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
kvm: x86: Do not leave halt if interrupts are disabled
When an external interrupt is pending but IF is cleared, we must notleave the halt state prematurely.
kvm: Mark VCPU state dirty on creation
This avoids that early cpu_synchronize_state calls try to retrieve anuninitialized state from the kernel. That even causes a deadlock ifio-thread is enabled.
x86: Properly reset PAT MSR
Conforming to the Intel spec, set the power-on value of PAT also onreset, but save it across INIT.
x86: Save/restore PAT MSR
kvm: x86: Synchronize PAT MSR with the kernel
microblaze: Compile uart 16550 serial driver
Upcomming little endian platform will use 16550 serial driver.
Signed-off-by: Michal Simek <monstr@monstr.eu>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
xilinx: Add AXIENET & DMA models
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
microblaze: Add PetaLogix ml605 MMU little-endian ref design
Add the first Microblaze little endian platform.Platform uses uart16550, axi ethernet, timer, intc.
Add qcow2 documentation
This adds a description of the qcow2 file format to the docs/ directory.Besides documenting what's there, which is never wrong, the document shouldprovide a good basis for the discussion of format extensions (called "qcow3" in previous discussions)...
win32: implement missing timersub
Implement and wrap timersub() for Win32.
Acked-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
simpletrace: Move st_init() error reporting
User emulator builds do not have error_report() so it should not be usedby simpletrace.c. In fact, error reporting inside simpletrace.c isinappropriate and should be done by the caller instead.
This patch moves st_init() error reporting out to its caller,...
Implement qemu_kvm_eat_signals only for CONFIG_LINUX
qemu_kvm_eat_signals requires POSIX support with realtime extensions forsigtimedwait. Not all our target platforms provide this. Moreover,undefined sigbus_reraise was referenced on non-Linux as well....
x86: Unbreak TCG support for hardware breakpoints
Commit 83f338f73e broke x86 hardware breakpoint emulation by moving thedebug exception handling out of cpu_exec. Fix this by moving all TCGrelated bits back, only leaving the generic guest debugging parts in...
s390: Detect invalid invocations of qemu_ram_free/remap
This both detects invalid invocations of qemu_ram_free andqemu_ram_remap when mem_path is non-NULL and fixes a build error ons390 ("'area' may be used uninitialized in this function").
block/vdi: Don't ignore immediate read/write failures
This patch is similar to 171e3d6b9997c98a97d0c525867f7cd9b640caddwhich fixed qcow2:
Returning -EIO is far from optimal, but at least it's an error code.
Cc: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
block/qcow: Don't ignore immediate read/write and other failures
In addition to read/write failures, -EIO is also returned when...
Add error message for loading snapshot without VM state
It already fails, but it didn't tell the user why.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Juan Quintela <quintela@redhat.com>
tools: Use real async.c instead of stubs
It's wrong to call BHs directly, even in tools. The only operations thatschedule BHs are called in a loop that (indirectly) contains a call toqemu_bh_poll anyway, so we're not losing the scheduled BHs: Tools either use...
Don't allow multiwrites against a block device without underlying medium
If the block device has been closed, we no longer have a medium to submitIO against, check for this before submitting io. This prevents a segfaultfurther in the code where we dereference elements of the block driver....
Fix ATA SMART and CHECK POWER MODE
This patch fixes two things:
1) CHECK POWER MODE
The error return value wasn't always zero, so it would show up asoffline. Error is now explicitly set to zero.
2) SMART
The smart values that were returned were invalid and tools like skdump...
Improve error handling in do_snapshot_blkdev()
In case we cannot open the newly created snapshot image, try to fallback to the original image file and continue running on that, whichshould prevent the guest from aborting.
This is a corner case which can happen if the admin by mistake...
hw/xen_disk: aio_inflight not released in handling ioreq when nr_segments==0
In hw/xen_disk.c, async writing ioreq is leaked whenioreq->req.nr_segments==0, because `aio_inflight` flag is not releasedproperly (skipped by misplaced "break").
Signed-off-by: Feiran Zheng <famcool@gmail.com>...
kvm: x86: Consolidate TCG and KVM MCE injection code
This switches KVM's MCE injection path to cpu_x86_inject_mce, both forSIGBUS and monitor initiated events. This means we prepare the MCA MSRsin the VCPUState also for KVM.
We have to drop the MSRs writeback restrictions for this purpose which...
kvm: x86: Clean up kvm_setup_mce
There is nothing to abstract here. Fold kvm_setup_mce into its callerand fix up the error reporting (return code of kvm_vcpu_ioctl holds theerror value).
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>CC: Huang Ying <ying.huang@intel.com>...
kvm: x86: Fail kvm_arch_init_vcpu if MCE initialization fails
There is no reason to continue if the kernel claims to support MCE butthen fails to process our request.
Add qemu_ram_remap
qemu_ram_remap() unmaps the specified RAM pages, then re-maps thesepages again. This is used by KVM HWPoison support to clear HWPoisonedpage tables across guest rebooting, so that a new page may beallocated later to recover the memory error....
KVM, MCE, unpoison memory address across reboot
In Linux kernel HWPoison processing implementation, the virtualaddress in processes mapping the error physical memory page is markedas HWPoison. So that, the further accessing to the virtualaddress will kill corresponding processes with SIGBUS....
x86: Optionally avoid injecting AO MCEs while others are pending
Allow to tell cpu_x86_inject_mce that it should ignore Action OptionalMCE events when the target VCPU is still processing another one. Thiswill be used by KVM soon.
Synchronize VCPU states before reset
This is required to support keeping VCPU states across a system reset.If we do not read the current state before the reset,cpu_synchronize_all_post_reset may write back incorrect stateinformation.
The first user of this will be MCE MSR synchronization which currently...
kvm: x86: Move MCE functions together
Pure function suffling to avoid multiple #ifdef KVM_CAP_MCE sections,no functional changes. While at it, annotate some #ifdef sections.
kvm: Rename kvm_arch_process_irqchip_events to async_events
We will broaden the scope of this function on x86 beyond irqchip events.
kvm: x86: Inject pending MCE events on state writeback
The current way of injecting MCE events without updating of andsynchronizing with the CPUState is broken and causes spuriouscorruptions of the MCE-related parts of the CPUState.
As a first step towards a fix, enhance the state writeback code with...
x86: Run qemu_inject_x86_mce on target VCPU
We will use the current TCG-only MCE injection path for KVM as well, andthen this read-modify-write of the target VCPU state has to be performedsynchronously in the corresponding thread.