History | View | Annotate | Download (37.1 kB)
target-ppc: Check for error on address translation in memsave command
When we translate the virtual address to physical check for error.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>Signed-off-by: Alexander Graf <agraf@suse.de>
icount: use cpu_get_icount() directly
This will help later when we will have to place these calls ina critical section, and thus call a version of cpu_get_icount()that does not take the lock.
Reviewed-by: Alex Bligh <alex@alex.org.uk>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
icount: reorganize icount_warp_rt
To prepare for future code changes, move the increment of qemu_icount_biasoutside the "if" statement.
Also, hoist outside the if the check for timers that expired due to the"warping". The check is redundant when !runstate_is_running(), but...
icount: prepare the code for future races in calling qemu_clock_warp
Computing the deadline of all vm_clocks is somewhat expensive and callsout to qemu-timer.c; two reasons not to do it in the seqlock's write-sidecritical section. This however opens the door for races in setting and...
icount: document (future) locking rules for icount
icount: make it thread-safe
This lets threads other than the I/O thread use vm_clock even in -icount mode.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
timer: protect timers_state's clock with seqlock
QEMU_CLOCK_VIRTUAL may be read outside BQL. This will make itsfoundation, i.e. cpu_clock_offset exposed to race condition.Using private lock to protect it.
After this patch, reading QEMU_CLOCK_VIRTUAL is thread safe...
cpu: Use QTAILQ for CPU list
Introduce CPU_FOREACH(), CPU_FOREACH_SAFE() and CPU_NEXT() shorthandmacros.
Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Replace qemu_for_each_cpu()
It was introduced to loop over CPUs from target-independent code, butsince commit 182735efaf956ccab50b6d74a4fed163e0f35660 target-independentCPUState is used.
A loop can be considered more efficient than function calls in a loop,...
s390: wire up nmi command to raise a RESTART interrupt on S390
There is the 'nmi' command that is used to trigger a guest dump via kdump feature on x86.s390 uses RESTART interrupt to trigger kdump.So, this patch provides a mean to use 'nmi' command on s390 to raise RESTART interrupt....
aio / timers: Rearrange timer.h & make legacy functions call non-legacy
Rearrange timer.h so it is in order by function type.
Make legacy functions call non-legacy functions rather than vice-versa.
Convert cpus.c to use new API.
Signed-off-by: Alex Bligh <alex@alex.org.uk>...
aio / timers: Use all timerlists in icount warp calculations
Notify all timerlists derived from vm_clock in icount warpcalculations.
When calculating timer delay based on vm_clock deadline, useall timerlists.
For compatibility, maintain an apparent bug where when using...
cpus: Use cpu_is_stopped() efficiently
It makes more sense and will make things simpler later.
Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
timer: make timers_state static
Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
exec: Change cpu_memory_rw_debug() argument to CPUState
Propagate X86CPU in kvmvapic for simplicity.
cpu: Move singlestep_enabled field from CPU_COMMON to CPUState
Prepares for changing cpu_single_step() argument to CPUState.
Acked-by: Michael Walle <michael@walle.cc> (for lm32)Signed-off-by: Andreas Färber <afaerber@suse.de>
cpus: Let vm_stop[_force_state]() always flush block devices
Even if the VM is already stopped, we cannot assume that all data hasalready been successfully flushed to disk. The flush during the previousvm_stop() could have failed.
Run bdrv_flush_all() unconditionally so that we get an error each time...
Merge remote-tracking branch 'quintela/migration.next' into staging
Message-id: 1373664508-5404-1-git-send-email-quintela@redhat.com...
cpus: Add return value for vm_stop()
If flushing the block devices fails, return an error. The VM is stoppedanyway.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Introduce async_run_on_cpu()
Introduce an asynchronous version of run_on_cpu() i.e. the callerdoesn't have to block till the call back routine finishes executionon the target vcpu.
Signed-off-by: Chegu Vinod <chegu_vinod@hp.com>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>...
cpu: Make first_cpu and next_cpu CPUState
Move next_cpu from CPU_COMMON to CPUState.Move first_cpu variable to qom/cpu.h.
gdbstub needs to use CPUState::env_ptr for now.cpu_copy() no longer needs to save and restore cpu_next.
Acked-by: Paolo Bonzini <pbonzini@redhat.com>...
cpu: Replace cpu_single_env with CPUState current_cpu
Move it to qom/cpu.h.
KVM: Don't assume that mpstate exists with in-kernel PIC always
On PPC, we don't support MP state. So far it's not necessary and I'mnot convinced yet that we really need to support it ever.
However, the current idle logic in QEMU assumes that an in-kernel PIC...
gdbstub: Set gdb_set_stop_cpu() argument to CPUState
Use CPUState::env_ptr for now.
Prepares for changing cpu_handle_guest_debug() argument to CPUState.
Reviewed-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Andreas Färber <afaerber@suse.de>
cpus: Change cpu_handle_guest_debug() argument to CPUState
CPUArchState is no longer needed.
Prepares for changing qemu_kvm_cpu_thread_fn() opaque to CPUState.
cpus: Change qemu_kvm_start_vcpu() argument to CPUState
Pass it on to qemu_kvm_cpu_thread_fn().
Prepares for changing qemu_init_vcpu() argument to CPUState.
cpus: Change qemu_dummy_start_vcpu() argument to CPUState
Pass it to qemu_dummy_cpu_thread_fn().Use CPUState::env_ptr for cpu_single_env.
cpu: Change qemu_init_vcpu() argument to CPUState
This allows to move the call into CPUState's realizefn.Therefore move the stub into libqemustub.a.
kvm: Change cpu_synchronize_state() argument to CPUState
Change Monitor::mon_cpu to CPUState as well.
Reviewed-by: liguang <lig.fnst@cn.fujitsu.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Change cpu_exit() argument to CPUState
It no longer depends on CPUArchState, so move it to qom/cpu.c.
Prepares for changing GDBState::c_cpu to CPUState.
cpus: Change cpu_thread_is_idle() argument to CPUState
It no longer needs CPUArchState.
Prepares for changing all_cpu_threads_idle() CPU loop to CPUState andneeded for changing qemu_kvm_wait_io_event() argument to CPUState.
Reviewed-by: Richard Henderson <rth@twiddle.net>...
cpus: Change qemu_kvm_wait_io_event() argument to CPUState
It no longer uses CPUArchState.
kvm: Change kvm_set_signal_mask() argument to CPUState
Prepares for changing qemu_kvm_init_cpu_signals() argument to CPUState.
Acked-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Richard Henderson <rth@twiddle.net>...
cpus: Change qemu_kvm_init_cpu_signals() argument to CPUState
cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks
Make cpustats monitor command available unconditionally.
Prepares for changing kvm_handle_internal_error() and kvm_cpu_exec()arguments to CPUState.
kvm: Change kvm_cpu_exec() argument to CPUState
Acked-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Andreas Färber <afaerber@suse.de>
cpus: use error_setg_file_open()
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Acked-by: Kevin Wolf <kwolf@redhat.com>
cpus: Fix pausing TCG CPUs while in vCPU thread
Due to a preceding while loop, no CPU would've been put into stoppedstate. Reinitialize the variable.This fixes commit d798e97456658ea7605303b7c69b04ec7df95c10 (Allow to usepause_all_vcpus from VCPU context) for non-KVM case....
cpus: Use qemu_for_each_cpu() in TCG thread
Replaces an open-coded loop and hides unused CPUArchState.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Introduce cpu_resume(), for single CPU
Also add a stub for it, to make possible to use it in qom/cpu.c,which is shared with user emulators.
w64: Fix compiler warnings (wrong format specifier)
GetLastError() returns a DWORD value which is unsigned long,so the correct format specifier is %lu.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
cpu: Pass CPUState to cpu_synchronize_post()
... so it could be called without requiring CPUArchState.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
Check effective suspension of TCG thread
On multi-core systems, SuspendThread does not guaranty immediate threadsuspension. We add busy loop to wait for effective thread suspensionafter call to ThreadSuspend().
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>...
cpu: Move halted and interrupt_request fields to CPUState
Both fields are used in VMState, thus need to be moved together.Explicitly zero them on reset since they were located beforebreakpoints.
Pass PowerPCCPU to kvmppc_handle_halt().
cpu: Pass CPUState to cpu_interrupt()
Move it to qom/cpu.h to avoid issues with include order.
Change pc_acpi_smi_interrupt() opaque to X86CPU.
cpus: Replace open-coded CPU loop in qmp_memsave() with qemu_get_cpu()
No functional change, just less usages of first_cpu and next_cpu fields.
env is passed to cpu_memory_rw_debug(), which in turn passes it totarget-specific cpu_get_phys_page_debug(). Changing both would be a...
cpus.c: Drop unnecessary set_cpu_log()
The set_cpu_log() function in cpus.c is a fairly simple wrapperwhich is only called from one location. Just inline the codeinto vl.c, since there is no need to indirect it via cpus.cand the handling of the error case is more appropriate to vl.c....
qemu-log: Rename the public-facing cpu_set_log function to qemu_set_log
Rename the public-facing function cpu_set_log to qemu_set_log. Thisrequires us to rename the internal-only qemu_set_log() todo_qemu_set_log().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
qemu-log: Rename cpu_str_to_log_mask to qemu_str_to_log_mask
Rename cpu_str_to_log_mask() to qemu_str_to_log_mask(), sincethe qemu_log functionality is no longer restricted to TCG CPUdebug logging.
qemu-log: Abstract out "print usage message about valid log categories"
Abstract out the "print a human readable list of all thevalid log categories" functionality which is currently duplicatedin three separate places. (We leave the monitor.c help_cmd()...
qemu-log: Unify {cpu_set,set_cpu}_log_filename as qemu_set_log_filename
The qemu_log() functionality is no longer specific to TCG CPU debug logs.Rename cpu_set_log_filename() to qemu_set_log_filename() and drop thepointless wrapper set_cpu_log_filename()....
kvm: Pass CPUState to kvm_on_sigbus_vcpu()
Since commit 20d695a9254c1b086a456d3b79a3c311236643ba (kvm: PassCPUState to kvm_arch_*) CPUArchState is no longer needed.
Allows to change qemu_kvm_eat_signals() argument as well.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
cpu: Move nr_{cores,threads} fields to CPUState
To facilitate the field movements, pass MIPSCPU to malta_mips_config();avoid that for mips_cpu_map_tc() since callers only access MIPS ThreadContexts, inside TCG helpers.
cpu: Move numa_node field to CPUState
cpu: Move cpu_index field to CPUState
Note that target-alpha accesses this field from TCG, now using anegative offset. Therefore the field is placed last in CPUState.
Pass PowerPCCPU to [kvm]ppc_fixup_cpu() to facilitate this change.
Move common parts of mips cpu_state_reset() to mips_cpu_reset()....
kvm: Pass CPUState to kvm_init_vcpu()
CPUArchState is no longer needed, and it thereby no longer depends onNEED_CPU_H.
softmmu: move include files to include/sysemu/
misc: move include files to include/qemu/
monitor: move include files to include/monitor/
exec: move include files to include/exec/
cpus: Pass CPUState to run_on_cpu()
Move the declaration to include/qemu/cpu.h and add documentation.
cpu: Move thread_id to CPUState
cpus: Pass CPUState to [qemu_]cpu_has_work()
For target-mips also change the return type to bool.
Make include paths for cpu-qom.h consistent for alpha and unicore32.
Signed-off-by: Andreas Färber <afaerber@suse.de>[AF: Updated new target-openrisc function accordingly]...
cpus: Pass CPUState to qemu_tcg_init_vcpu()
cpus: Pass CPUState to qemu_cpu_kick()
CPUArchState is no longer needed there.
cpu: Move queued_work_{first,last} to CPUState
cpus: Pass CPUState to flush_queued_work()
cpus: Pass CPUState to qemu_wait_io_event_common()
cpus: Pass CPUState to qemu_cpu_kick_thread()
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Igor Mammedov <imammedo@redhat.com>
cpu: Move created field to CPUState
Change its type to bool.
cpu: Move stop field to CPUState
cpu: Move stopped field to CPUState
cpus: Pass CPUState to cpu_is_stopped()
Also change the return type to bool.
cpus: Pass CPUState to cpu_can_run()
Also change its return type to bool.
cpu: Move halt_cond to CPUState
cpus: Pass CPUState to qemu_tcg_cpu_thread_fn
CPUArchState is no longer needed except for iterating the CPUs.
Needed for qemu_tcg_init_vcpu().
KVM and dummy threads still need CPUArchState for cpu_single_env.
cpus: Pass CPUState to qemu_cpu_is_self()
Change return type to bool, move to include/qemu/cpu.h andadd documentation.
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Igor Mammedov <imammedo@redhat.com>[AF: Updated new caller qemu_in_vcpu_thread()]
cpus: create qemu_in_vcpu_thread()
Old code used !io_thread to know if a thread was an vcpu or not. Thatfails when we introduce the iothread.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Merge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
cpu_dump_state: move DUMP_FPU and DUMP_CCOP flags from x86-only to generic
Move the DUMP_FPU and DUMP_CCOP flags for cpu_dump_state() from beingx86-specific flags to being generic ones. This allows us to drop someTARGET_I386 ifdefs in various places, and means that we can (potentially)...
cpu: Add missing 'static' attribute to qemu_global_mutex
Contrary to its name, 'qemu_global_mutex' is only used locallyin cpus.c.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Drop cpu_list_id macro
Since the only user of the extended cpu_list_id() formatwas the x86 ?model/?dump/?cpuid output, we can drop itcompletely.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>...
kvm: Decouple 'async interrupt delivery' from 'kernel irqchip'
On x86 userspace delivers interrupts to the kernel asynchronously(and therefore VCPU idle management is done in the kernel) if andonly if there is an in-kernel irqchip. On other architectures this...
Fixes related to processing of qemu's -numa option
The -numa option to qemu is used to create [fake] numa nodesand expose them to the guest OS instance.
There are a couple of issues with the -numa option:
a) Max VCPU's that can be specified for a guest while using...
cpu: Move thread_kicked to CPUState
Change field type to bool.
cpu: Move CPU_COMMON_THREAD into CPUState
CPU_COMMON_THREAD was only used for Windows, adding an hThread fieldto CPU_COMMON.
Move the field into QOM CPUState and change its type to HANDLE,which it is assigned from. This requires Windows headers, pulled in...
cpu: Move thread field into CPUState
cpus.c: Make all_cpu_threads_idle() static
Commit 946fb27c1 moved all the uses of all_cpu_threads_idle()into cpus.c. This means we can mark the function 'static'(again), if we shuffle it a bit earlier in the source file.
kvm: Drop redundant kvm_enabled from cpu_thread_is_idle
This is now implied by kvm_irqchip_in_kernel.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Avi Kivity <avi@redhat.com>
qtest: add test framework
The idea behind qtest is pretty simple. Instead of executing a CPU via TCG orKVM, rely on an external process to send events to the device model that the CPUwould normally generate.
qtest presents itself as an accelerator. In addition, a new option is added to...
qtest: add clock management
This patch combines qtest and -icount together to turn the vm_clockinto a source that can be fully managed by the client. To this end newcommands clock_step and clock_set are added. Hooking them with libqtestis left as an exercise to the reader....
Rename CPUState -> CPUArchState
Scripted conversion: for file in .[hc] hw/.[hc] hw/kvm/*.[hc] linux-user/*.[hc] linux-user/m68k/*.[hc] bsd-user/*.[hc] darwin-user/*.[hc] tcg/*/*.[hc] target-*/cpu.h; do sed -i "s/CPUState/CPUArchState/g" $file done...
Allow to use pause_all_vcpus from VCPU context
In order to perform critical manipulations on the VM state in thecontext of a VCPU, specifically code patching, stopping and resuming ofall VCPUs may be necessary. resume_all_vcpus is already compatible, now...
Remove useless casts from cpu iterators
CPUState::next_cpu is already CPUState *.
Process pending work while waiting for initial kick-off in TCG mode
When the TCG thread is started but not yet the machine, we wait inqemu_tcg_cpu_thread_fn on tcg_halt_cond. To allow run_on_cpu already atthis time, we need to process pending request in that loop....
kvm: Set cpu_single_env only once
As we have thread-local cpu_single_env now and KVM uses exactly onethread per VCPU, we can drop the cpu_single_env updates from the loopand initialize this variable only once during setup.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
apic: Inject external NMI events via LINT1
On real hardware, NMI button events are injected via the LINT1 line ofthe APICs. E.g. kdump expect this wiring and gets upset if the per-APICLINT1 mask is not respected, i.e. if NMIs are injected to VCPUs that...
cleanup, Remove duplicated code
These two blocks of code are exactly the same, remove one.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
fix win32 build
On Windows, cpus.c needs access to the hThread. Add a Windows-specificfunction to grab it. This requires changing the CPU threads tojoinable. There is no substantial change because the threads runin an infinite loop.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
Merge remote-tracking branch 'stefanha/trivial-patches-next' into staging