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....
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: Account for MCE in cpu_has_work
MCEs can be injected asynchronously, so they can also terminate the haltstate.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>CC: Huang Ying <ying.huang@intel.com>CC: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>...
x86: Perform implicit mcg_status reset
Reorder mcg_status in CPUState to achieve automatic clearing on reset.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>CC: Huang Ying <ying.huang@intel.com>CC: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>CC: Jin Dongming <jin.dongming@np.css.fujitsu.com>...
x86: Small cleanups of MCE helpers
Fix some code style issues, use proper headers, and align to cpu_x86naming scheme. No functional changes.
x86: Refine error reporting of MCE injection services
As this service is used by the human monitor, make sure that errors getreported to the right channel, and also raise the verbosity.
This requires to move Monitor typedef in qemu-common.h to resolve the...
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.
kvm: ppc: Fix breakage of kvm_arch_pre_run/process_irqchip_events
Commit 7a39fe5882 failed to convert the right arch function.
kvm: Fix build warning when KVM_CAP_SET_GUEST_DEBUG is lacking
Original fix by David Gibson.
CC: David Gibson <david@gibson.dropbear.id.au>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
do not use timedwait on qemu_halt_cond
The following conditions can cause cpu_has_work(env) to become true:
- env->queued_work_first: run_on_cpu is already kicking the VCPU
- env->stop = 1: pause_all_vcpus is already kicking the VCPU
- env->stopped = 0: resume_all_vcpus is already kicking the VCPU...
do not use timedwait on qemu_system_cond
qemu_main_loop_start is the only place where qemu_system_ready is setto 1.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
do not use timedwait on qemu_pause_cond
all_vcpus_paused can start returning true after penv->stopped changesfrom 0 to 1. When this is done, qemu_pause_cond is always signaled.
do not use timedwait on qemu_cpu_cond
Whenever env->created becomes true, qemu_cpu_cond is signaled by {kvm,tcg}_cpu_thread_fn.
iothread stops the vcpu thread via IPI
merge all signal initialization with qemu_signalfd_init, rename
provide dummy signal init functions for win32
protect qemu_cpu_kick_self for Win32
add Win32 IPI service
Refactor thread retrieval and check
We have qemu_cpu_self and qemu_thread_self. The latter is retrieving thecurrent thread, the former is checking for equality (using CPUState). Wealso have qemu_thread_equal which is only used like qemu_cpu_self.
This refactors the interfaces, creating qemu_cpu_is_self and...
add win32 qemu-thread implementation
For now, qemu_cond_timedwait and qemu_mutex_timedlock are left asPOSIX-only functions. They can be removed later, once the patchesthat remove their uses are in.
include qemu-thread.h early
add assertions on the owner of a QemuMutex
These are already present in the Win32 implementation, add them tothe pthread wrappers as well. Use PTHREAD_MUTEX_ERRORCHECK for mutexoperations. Later we'll add tracking of the owner for cond_signal/broadcast....
remove CONFIG_THREAD
inline cpu_halted into sole caller
All implementations are now the same, and there is only one caller,so inline the function there.
always qemu_cpu_kick after unhalting a cpu
This ensures env->halt_cond is broadcast, and the loop inqemu_tcg_wait_io_event and qemu_kvm_wait_io_event is exitednaturally rather than through a timeout.
exit round-robin vcpu loop if cpu->stopped is true
Sometimes vcpus are stopped directly without going through ->stop = 1.Exit the VCPU execution loop in this case as well.
always signal pause_cond after stopping a VCPU
unlock iothread during WaitForMultipleObjects
implement win32 dynticks timer
use win32 timer queues
Multimedia timers are only useful for compatibility with Windows NT 4.0and earlier. Plus, the implementation in Wine is extremely heavyweight.
hw/fmopl: Fix buffer access out-of-bounds errors
Index 75 is one too large for AR_TABLE75, DR_TABLE75.This error was reported by cppcheck.
hw/fmopl.c:600: error: Buffer access out-of-bounds: OPL.AR_TABLEhw/fmopl.c:601: error: Buffer access out-of-bounds: OPL.DR_TABLE...
moving eeprom initialization
The initialization should not be only on reset but also when initializingthe device.It resolves a bug when hot plugging a pci network device: the mac addresswas always null.
Signed-off-by: William Dauchy <wdauchy@gmail.com>...
pc: fix wrong CMOS values for floppy drives
Before commit 63ffb564dca94f8bda01ed6d209784104630a4d2, states forfloppy drives were calculated in fdc.c:fd_revalidate(). There it isalso considered whether a disk is inserted or not. The commit didn't copythe logic completely to pc.c, which caused a regression....
microblaze: Fix PetaLogix company name
trivial fix.
microblaze: Add PVR for writeback cache, endians
Specify PVR for writeback cache, endians and others.
Merge remote branch 'stefanha/tracing' into staging
vmstate: Add a way to send a partial array
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: be able to store/save a pci device from a pointer
vmstate: move timers to use test instead of version