Statistics
| Branch: | Revision:

root / cpus.c @ 93148aa5

History | View | Annotate | Download (30.6 kB)

# Date Author Comment
d798e974 02/18/2012 12:15 pm Jan Kiszka

Allow to use pause_all_vcpus from VCPU context

In order to perform critical manipulations on the VM state in the
context of a VCPU, specifically code patching, stopping and resuming of
all VCPUs may be necessary. resume_all_vcpus is already compatible, now...

5207a5e0 02/18/2012 12:15 pm Jan Kiszka

Remove useless casts from cpu iterators

CPUState::next_cpu is already CPUState *.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Avi Kivity <>

8e564b4e 02/18/2012 12:15 pm Jan Kiszka

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 in
qemu_tcg_cpu_thread_fn on tcg_halt_cond. To allow run_on_cpu already at
this time, we need to process pending request in that loop....

e479c207 02/18/2012 12:15 pm Jan Kiszka

kvm: Set cpu_single_env only once

As we have thread-local cpu_single_env now and KVM uses exactly one
thread per VCPU, we can drop the cpu_single_env updates from the loop
and initialize this variable only once during setup.

Signed-off-by: Jan Kiszka <>...

02c09195 01/19/2012 01:14 pm Jan Kiszka

apic: Inject external NMI events via LINT1

On real hardware, NMI button events are injected via the LINT1 line of
the APICs. E.g. kdump expect this wiring and gets upset if the per-APIC
LINT1 mask is not respected, i.e. if NMIs are injected to VCPUs that...

a7d64ddb 01/12/2012 06:34 pm Lai Jiangshan

cleanup, Remove duplicated code

These two blocks of code are exactly the same, remove one.

Signed-off-by: Lai Jiangshan <>
Signed-off-by: Lai Jiangshan <>
Signed-off-by: Anthony Liguori <>

1ecf47bf 12/15/2011 05:20 pm Paolo Bonzini

fix win32 build

On Windows, cpus.c needs access to the hThread. Add a Windows-specific
function to grab it. This requires changing the CPU threads to
joinable. There is no substantial change because the threads run
in an infinite loop.

Signed-off-by: Paolo Bonzini <>...

9423a2e8 12/14/2011 03:59 pm Anthony Liguori

Merge remote-tracking branch 'stefanha/trivial-patches-next' into staging

cf218714 12/13/2011 01:06 am Jan Kiszka

qemu-thread: add API for joinable threads

Split from Jan's original qemu-thread-posix.c patch. No semantic change,
just introduce the new API that POSIX and Win32 implementations will
conform to.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Paolo Bonzini <>...

6d3962bf 12/06/2011 03:40 pm Luiz Capitulino

qapi: Convert pmemsave

Signed-off-by: Anthony Liguori <>
Signed-off-by: Luiz Capitulino <>

ab49ab5c 12/06/2011 03:40 pm Luiz Capitulino

qapi: Convert inject-nmi

Signed-off-by: Luiz Capitulino <>

0cfd6a9a 12/06/2011 03:40 pm Luiz Capitulino

qapi: Convert memsave

Please, note that the QMP command has a new 'cpu-index' parameter.

Signed-off-by: Anthony Liguori <>
Signed-off-by: Luiz Capitulino <>

3a93113a 12/06/2011 11:56 am Dong Xu Wang

fix typo: delete redundant semicolon

Double semicolons should be single.

Signed-off-by: Dong Xu Wang <>
Signed-off-by: Stefan Hajnoczi <>

eb5d5bea 12/05/2011 05:39 pm Anthony Liguori

Merge remote-tracking branch 'kwolf/for-anthony' into staging

922453bc 12/05/2011 03:56 pm Stefan Hajnoczi

block: convert qemu_aio_flush() calls to bdrv_drain_all()

Many places in QEMU call qemu_aio_flush() to complete all pending
asynchronous I/O. Most of these places actually want to drain all block
requests but there is no block layer API to do so.

This patch introduces the bdrv_drain_all() API to wait for requests...

07f35073 12/02/2011 12:50 pm Dong Xu Wang

fix spelling in main directory

Signed-off-by: Dong Xu Wang <>
Signed-off-by: Stefan Hajnoczi <>

47113ab6 11/07/2011 06:57 pm Wen Congyang

reenable vm_clock when resuming all vcpus

We disable vm_clock when pausing all vcpus, but we forget to
reenable it when resuming all vcpus. It will cause that the
guest can not be rebooted.

Tested-by: Zhi Yong Wu <>
Reviewed-by: Paolo Bonzini <>...

bdb7ca67 11/01/2011 05:58 pm Jan Kiszka

Simplify cpu_exec_all to tcg_exec_all

After the removal of the non-threaded mode cpu_exec_all is now only used
by TCG. Refactor it accordingly, also dropping its unused return value.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

de0b36b6 10/27/2011 04:48 pm Luiz Capitulino

qapi: Convert query-cpus

Signed-off-by: Anthony Liguori <>
Signed-off-by: Luiz Capitulino <>

99435906 10/21/2011 07:14 pm Paolo Bonzini

simplify main loop functions

Provide a clean example of how to use the main loop in the tools.

Signed-off-by: Paolo Bonzini <>

946fb27c 10/21/2011 07:14 pm Paolo Bonzini

qemu-timer: move icount to cpus.c

None of this is needed by tools, and most of it can even be made static
inside cpus.c.

Signed-off-by: Paolo Bonzini <>

a5c57d64 10/21/2011 07:14 pm Paolo Bonzini

qemu-timer: do not refer to runstate_is_running()

Signed-off-by: Paolo Bonzini <>

44a9b356 10/21/2011 07:14 pm Paolo Bonzini

main-loop: create main-loop.h

Signed-off-by: Paolo Bonzini <>

d3b12f5d 10/21/2011 07:14 pm Paolo Bonzini

main-loop: create main-loop.c

Signed-off-by: Paolo Bonzini <>

8a9236f1 10/19/2011 03:48 pm Luiz Capitulino

runstate: Allow user to migrate twice

It should be a matter of allowing the transition POSTMIGRATE ->
FINISH_MIGRATE, but it turns out that the VM won't do the
transition the second time because it's already stopped.

So this commit also adds vm_stop_force_state() which performs...

c8af89af 09/20/2011 11:21 pm Anthony Liguori

Merge remote-tracking branch 'kwolf/for-anthony' into staging

e1d3b254 09/20/2011 03:32 pm Frediano Ziglio

block: avoid SIGUSR2

Now that iothread is always compiled sending a signal seems only an
additional step. This patch also avoid writing to two pipe (one from signal
and one in qemu_service_io).

Work with kvm enabled or disabled. strace output is more readable (less syscalls)....

1dfb4dd9 09/15/2011 10:39 pm Luiz Capitulino

Replace the VMSTOP macros with a proper state type

Today, when notifying a VM state change with vm_state_notify(),
we pass a VMSTOP macro as the 'reason' argument. This is not ideal
because the VMSTOP macros tell why qemu stopped and not exactly
what the current VM state is....

f5bbfba1 09/15/2011 10:39 pm Luiz Capitulino

RunState: Add additional states

Currently, only vm_start() and vm_stop() change the VM state.
That's, the state is only changed when starting or stopping the VM.

This commit adds the runstate_set() function, which makes it possible
to also do state transitions when the VM is stopped or running....

1354869c 09/15/2011 10:39 pm Luiz Capitulino

Drop the vm_running global variable

Use runstate_is_running() instead, which is introduced by this commit.

Signed-off-by: Luiz Capitulino <>

12d4536f 09/02/2011 06:34 pm Anthony Liguori

main: force enabling of I/O thread

Enabling the I/O thread by default seems like an important part of declaring
1.0. Besides allowing true SMP support with KVM, the I/O thread means that the
TCG VCPU doesn't have to multiplex itself with the I/O dispatch routines which...

fa7d1867 08/22/2011 10:37 pm Jan Kiszka

Replace qemu_system_cond with VCPU stop mechanism

We can express the VCPU thread wakeup with the stop mechanism, saving
both qemu_system_ready and the qemu_system_cond. For KVM threads, we can
just enter the main loop as long as the thread is stopped. The central...

eae74cf9 08/22/2011 10:37 pm Jan Kiszka

Do not kick vcpus in TCG mode

In TCG mode, iothread and vcpus run in lock-step. So it's pointless to
send a signal from qemu_cpu_kick to the vcpu thread - if we got here,
the receiver already left the vcpu loop.

Signed-off-by: Jan Kiszka <>...

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

46daff13 07/23/2011 07:18 pm Paolo Bonzini

iothread: replace fair_mutex with a condition variable

This conveys the intention better, and scales to more than >1
threads contending the mutex with the iothread (as long as all
of them have a "quiescent point" like the TCG thread has).

Also, on Mac OS X the fair_mutex somehow didn't work as intended...

89b9ba66 07/16/2011 10:43 pm Alexandre Raymond

Fix signal handling of SIG_IPI when io-thread is enabled

Both the signal thread (via sigwait()) and the cpu thread (via
a normal signal handler) were attempting to catch SIG_IPI.

This resulted in random freezes under Darwin.

This patch separates SIG_IPI from the rest of the signals handled...

5664aed9 07/16/2011 10:41 pm Alexandre Raymond

Fix signal handling when io-thread is disabled

Changes since v1:
- take pthread_sigmask() out of the ifdef as it is now common
to both parts.

This fix effectively blocks, in the main thread, the signals handled
by signalfd or the compatibility signal thread....

bb820c03 06/27/2011 07:25 pm Anthony Liguori

Merge remote-tracking branch 'stefanha/trivial-patches' into staging

2b41f10e 06/26/2011 09:25 pm Blue Swirl

Remove exec-all.h include directives

Most exec-all.h include directives are now useless, remove them.

Signed-off-by: Blue Swirl <>

0ff0fc19 06/24/2011 11:13 am Jan Kiszka

Do not include compatfd for WIN32

sigset_t, used by that header, is not available in mingw32 environments.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Stefan Hajnoczi <>

77bec686 06/20/2011 06:42 pm Alexandre Raymond

Fix typo in cpus.c

filed -> failed

Signed-off-by: Alexandre Raymond <>
Signed-off-by: Stefan Hajnoczi <>

c235d738 06/15/2011 07:51 pm Matthew Fernandez

Command line support for altering the log file location

Add command line support for logging to a location other than /tmp/qemu.log.

With logging enabled (command line option -d), the log is written to
the hard-coded path /tmp/qemu.log. This patch adds support for writing...

3b2319a3 04/15/2011 10:27 am Paolo Bonzini

really fix -icount in the iothread case

The correct fix for -icount is to consider the biggest difference
between iothread and non-iothread modes. In the traditional model,
CPUs run before the iothread calls select (or WaitForMultipleObjects
for Win32). In the iothread model, CPUs run while the iothread...

ab33fcda 04/15/2011 10:27 am Paolo Bonzini

enable vm_clock to "warp" in the iothread+icount case

The previous patch however is not enough, because if the virtual CPU
goes to sleep waiting for a future timer interrupt to wake it up, qemu
deadlocks. The timer interrupt never comes because time is driven by...

cb842c90 04/15/2011 10:27 am Paolo Bonzini

qemu_next_deadline should not consider host-time timers

It is purely for icount-based virtual timers. And now that we got the
code right, rename the function to clarify the intended scope.

Signed-off-by: Paolo Bonzini <>
Tested-by: Edgar E. Iglesias <>...

31b7c261 03/22/2011 12:42 am Anthony Liguori

Merge remote branch 'qemu-kvm/uq/master' into staging

e0efb993 03/20/2011 11:39 pm Stefan Weil

Fix conversions from pointer to int and vice versa

Here the int values fds0, sigfd, s, sock and fd are converted
to 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 *)....

dc7a09cf 03/16/2011 10:11 pm Jan Kiszka

Expose thread_id in info cpus

Based on patch by Glauber Costa:

To allow management applications like libvirt to apply CPU affinities to
the VCPU threads, expose their ID via info cpus. This patch provides the
pre-existing and used interface from qemu-kvm....

f2c1cc81 03/16/2011 10:11 pm Jan Kiszka

kvm: Add in-kernel irqchip awareness to cpu_thread_is_idle

With in-kernel irqchip support enabled, the vcpu threads sleep in kernel
space while halted. Account for this difference in cpu_thread_is_idle.

Signed-off-by: Jan Kiszka <>...

1ab3c6c0 03/15/2011 07:36 pm Jan Kiszka

Implement qemu_kvm_eat_signals only for CONFIG_LINUX

qemu_kvm_eat_signals requires POSIX support with realtime extensions for
sigtimedwait. Not all our target platforms provide this. Moreover,
undefined sigbus_reraise was referenced on non-Linux as well....

1009d2ed 03/15/2011 07:36 pm Jan Kiszka

x86: Unbreak TCG support for hardware breakpoints

Commit 83f338f73e broke x86 hardware breakpoint emulation by moving the
debug exception handling out of cpu_exec. Fix this by moving all TCG
related bits back, only leaving the generic guest debugging parts in...

9705fbb5 03/13/2011 04:44 pm Paolo Bonzini

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...

e009894f 03/13/2011 04:44 pm Paolo Bonzini

do not use timedwait on qemu_system_cond

qemu_main_loop_start is the only place where qemu_system_ready is set
to 1.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

be7d6c57 03/13/2011 04:44 pm Paolo Bonzini

do not use timedwait on qemu_pause_cond

all_vcpus_paused can start returning true after penv->stopped changes
from 0 to 1. When this is done, qemu_pause_cond is always signaled.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

18a85728 03/13/2011 04:44 pm Paolo Bonzini

do not use timedwait on qemu_cpu_cond

Whenever env->created becomes true, qemu_cpu_cond is signaled by {kvm,tcg}_cpu_thread_fn.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

8cf3f22b 03/13/2011 04:44 pm Paolo Bonzini

iothread stops the vcpu thread via IPI

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

712ae480 03/13/2011 04:44 pm Paolo Bonzini

merge all signal initialization with qemu_signalfd_init, rename

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

714bd040 03/13/2011 04:44 pm Paolo Bonzini

provide dummy signal init functions for win32

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

b55c22c6 03/13/2011 04:44 pm Paolo Bonzini

protect qemu_cpu_kick_self for Win32

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

cc015e9a 03/13/2011 04:44 pm Paolo Bonzini

add Win32 IPI service

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

b7680cb6 03/13/2011 04:44 pm Jan Kiszka

Refactor thread retrieval and check

We have qemu_cpu_self and qemu_thread_self. The latter is retrieving the
current thread, the former is checking for equality (using CPUState). We
also have qemu_thread_equal which is only used like qemu_cpu_self.

This refactors the interfaces, creating qemu_cpu_is_self and...

96284e89 03/13/2011 04:44 pm Paolo Bonzini

include qemu-thread.h early

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

df646dfd 03/13/2011 04:44 pm Paolo Bonzini

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.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

67bb172f 03/13/2011 04:44 pm Paolo Bonzini

always signal pause_cond after stopping a VCPU

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

c5d69e6b 02/16/2011 04:47 pm Anthony Liguori

Merge remote branch 'qemu-kvm/uq/master' into staging

ed94592b 02/14/2011 04:43 pm Anthony Liguori

io-thread: make sure to initialize qemu_work_cond and qemu_cpu_cond

Signed-off-by: Anthony Liguori <>

7e97cd88 02/14/2011 04:39 pm Jan Kiszka

Refactor kvm&tcg function names in cpus.c

Pure interface cosmetics: Ensure that only kvm core services (as
declared in kvm.h) start with "kvm_". Prepend "qemu_" to those that
violate this rule in cpus.c. Also rename the corresponding tcg functions
for the sake of consistency....

16400322 02/14/2011 04:39 pm Jan Kiszka

Refactor cpu_has_work/any_cpu_has_work in cpus.c

Avoid duplicate use of the function name cpu_has_work, it's confusing,
also their scope. Refactor cpu_has_work to cpu_thread_is_idle and do the
same with any_cpu_has_work.

Signed-off-by: Jan Kiszka <>...

0ab07c62 02/14/2011 04:39 pm Jan Kiszka

Fix a few coding style violations in cpus.c

No functional changes.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Marcelo Tosatti <>

e07bbac5 02/14/2011 04:39 pm Jan Kiszka

Improve vm_stop reason declarations

Define and use dedicated constants for vm_stop reasons, they actually
have nothing to do with the EXCP_* defines used so far. At this chance,
specify more detailed reasons so that VM state change handlers can
evaluate them....

8cf71710 02/14/2011 04:39 pm Jan Kiszka

Refactor debug and vmstop request interface

Instead of fiddling with debug_requested and vmstop_requested directly,
introduce qemu_system_debug_request and turn qemu_system_vmstop_request
into a public interface. This aligns those services with exiting ones in...

83f338f7 02/14/2011 04:39 pm Jan Kiszka

Move debug exception handling out of cpu_exec

To prepare splitting up KVM and TCG CPU entry/exit, move the debug
exception into cpus.c and invoke cpu_handle_debug_exception on return
from qemu_cpu_exec.

This also allows to clean up the debug request signaling: We can assign...

6792a57b 02/14/2011 04:39 pm Jan Kiszka

kvm: Separate TCG from KVM cpu execution

Mixing up TCG bits with KVM already led to problems around eflags
emulation on x86. Moreover, quite some code that TCG requires on cpu
enty/exit is useless for KVM. So dispatch between tcg_cpu_exec and
kvm_cpu_exec as early as possible....

d31ae052 02/14/2011 04:39 pm Jan Kiszka

kvm: Drop redundant kvm_enabled from kvm_cpu_thread_fn

Signed-off-by: Jan Kiszka <>
Signed-off-by: Marcelo Tosatti <>

84b4915d 02/14/2011 04:39 pm Jan Kiszka

kvm: Handle kvm_init_vcpu errors

Do not ignore errors of kvm_init_vcpu, they are fatal.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Marcelo Tosatti <>

a1b87fe0 02/14/2011 04:39 pm Jan Kiszka

kvm: Provide sigbus services arch-independently

Provide arch-independent kvm_on_sigbus* stubs to remove the #ifdef'ery
from cpus.c. This patch also fixes --disable-kvm build by providing the
missing kvm_on_sigbus_vcpu kvm-stub.

Signed-off-by: Jan Kiszka <>...

55f8d6ac 02/14/2011 04:39 pm Jan Kiszka

Refactor signal setup functions in cpus.c

Move {tcg,kvm}_init_ipi and block_io_signals to avoid prototypes, rename
the former two to clarify that they deal with more than SIG_IPI. No
functional changes - except for the tiny fixup of strerror usage.

The forward declaration of sigbus_handler is just temporarily, it will...

ff48eb5f 02/14/2011 04:39 pm Jan Kiszka

kvm: Set up signal mask also for !CONFIG_IOTHREAD

Block SIG_IPI, unblock it during KVM_RUN, just like in io-thread mode.
It's unused so far, but this infrastructure will be required for
self-IPIs and to process SIGBUS plus, in KVM mode, SIGIO and SIGALRM. As...

5db5bdac 02/14/2011 04:39 pm Jan Kiszka

kvm: Refactor qemu_kvm_eat_signals

We do not use the timeout, so drop its logic. As we always poll our
signals, we do not need to drop the global lock. Removing those calls
allows some further simplifications. Also fix the error processing of
sigpending at this chance....

9a36085b 02/14/2011 04:39 pm Jan Kiszka

kvm: Call qemu_kvm_eat_signals also under !CONFIG_IOTHREAD

Move qemu_kvm_eat_signals around and call it also when the IO-thread is
not used. Do not yet process SIGBUS, will be armed in a separate step.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Marcelo Tosatti <>

d0f294ce 02/14/2011 04:39 pm Jan Kiszka

Set up signalfd under !CONFIG_IOTHREAD

Will be required for SIGBUS handling. For obvious reasons, this will
remain a nop on Windows hosts.

Signed-off-by: Jan Kiszka <>
Reviewed-by: Paolo Bonzini <>
Signed-off-by: Marcelo Tosatti <>

de758970 02/14/2011 04:39 pm Jan Kiszka

kvm: Fix race between timer signals and vcpu entry under !IOTHREAD

Found by Stefan Hajnoczi: There is a race in kvm_cpu_exec between
checking for exit_request on vcpu entry and timer signals arriving
before KVM starts to catch them. Plug it by blocking both timer related...

6d9cb73c 02/14/2011 04:39 pm Jan Kiszka

kvm: Add MCE signal support for !CONFIG_IOTHREAD

Currently, we only configure and process MCE-related SIGBUS events if
CONFIG_IOTHREAD is enabled. The groundwork is laid, we just need to
factor out the required handler registration and system configuration....

46d62fac 02/14/2011 04:39 pm Jan Kiszka

Introduce VCPU self-signaling service

Introduce qemu_cpu_kick_self to send SIG_IPI to the calling VCPU
context. First user will be kvm.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Marcelo Tosatti <>

aa2c364b 02/14/2011 04:39 pm Jan Kiszka

Prevent abortion on multiple VCPU kicks

If we call qemu_cpu_kick more than once before the target was able to
process the signal, pthread_kill will fail, and qemu will abort. Prevent
this by avoiding the redundant signal.

This logic can be found in qemu-kvm as well....

b4a3d965 02/14/2011 04:39 pm Jan Kiszka

Stop current VCPU on synchronous reset requests

If some I/O operation ends up calling qemu_system_reset_request in VCPU
context, we record this and inform the io-thread, but we do not
terminate the VCPU loop. This can lead to fairly unexpected behavior if...

38145df2 02/14/2011 04:39 pm Jan Kiszka

Trigger exit from cpu_exec_all on pending IO events

Except for timer events, we currently do not leave the loop over all
VCPUs if an IO event was filed. That may cause unexpected IO latencies
under !CONFIG_IOTHREAD in SMP scenarios. Fix it by setting the global...

b66042c7 01/23/2011 06:27 am Jan Kiszka

kvm: Do not use qemu_fair_mutex

The imbalance in the hold time of qemu_global_mutex only exists in TCG
mode. In contrast to TCG VCPUs, KVM drops the global lock during guest
execution. We already avoid touching the fairness lock from the
IO-thread in KVM mode, so also stop using it from the VCPU threads....

55df6f33 12/09/2010 12:47 pm Michael S. Tsirkin

cpus: flush all requests on each vm stop

Flush all requests once we have stopped all
cpus and devices.
Make sure disk is in consistent state.

Signed-off-by: Michael S. Tsirkin <>
Tested-by: Jason Wang <>
Acked-by: Marcelo Tosatti <>

9a78eead 10/30/2010 11:01 am Stefan Weil

target-xxx: Use fprintf_function (format checking)

fprintf_function uses format checking with GCC_FMT_ATTR.

Format errors were fixed in
  • target-i386/helper.c
  • target-mips/translate.c
  • target-ppc/translate.c

Cc: Blue Swirl <>
Signed-off-by: Stefan Weil <>...

a8486bc9 10/21/2010 12:15 am Marcelo Tosatti

iothread: use signalfd

Block SIGALRM, SIGIO and consume them via signalfd.

Signed-off-by: Marcelo Tosatti <>
Signed-off-by: Avi Kivity <>

c0532a76 10/21/2010 12:15 am Marcelo Tosatti

MCE: Relay UCR MCE to guest

Port qemu-kvm's

commit 4b62fff1101a7ad77553147717a8bd3bf79df7ef
Author: Huang Ying <>
Date: Mon Sep 21 10:43:25 2009 +0800

MCE: Relay UCR MCE to guest
UCR (uncorrected recovery) MCE is supported in recent Intel CPUs,...
f8ca7b43 07/22/2010 06:52 am Jan Kiszka

Init qemu_system_cond

Signed-off-by: Jan Kiszka <>
Acked-by: Paolo Bonzini <>
Reviewed-by: Marcelo Tosatti <>
Signed-off-by: Aurelien Jarno <>

c629a4bc 07/22/2010 06:52 am Jan Kiszka

Fix cpu_exit for tcp_cpu_exec

If a cpu_exit request is pending, ensure that we leave the CPU loop
quickly. For this purpose, keep the global exit_request pending until
we are about to leave tcg_cpu_exec. Also, immediately break out of the
SMP loop if the request is set, do not run till the end of the chain....

6cabe1f3 07/22/2010 06:52 am Jan Kiszka

Fix qemu_wait_io_event processing in io-thread mode

When checking for I/O events in the tcg CPU loop, make sure that we
call qemu_wait_io_event_common for all CPUs, not only the current one.
Otherwise pause_all_vcpus may lock up or run_on_cpu requests may starve....

345f4426 07/22/2010 06:52 am Jan Kiszka

Drop redundant global cur_cpu variable

Signed-off-by: Jan Kiszka <>
Acked-by: Paolo Bonzini <>
Reviewed-by: Marcelo Tosatti <>
Signed-off-by: Aurelien Jarno <>

472fb0c4 07/22/2010 06:52 am Jan Kiszka

Rename tcg_cpu_exec and tcg_has_work

These functions are also used for kvm under !CONFIG_IOTHREAD, having
'tcg' in their name is just misleading.

Signed-off-by: Jan Kiszka <>
Acked-by: Paolo Bonzini <>
Reviewed-by: Marcelo Tosatti <>...

3c638d06 07/22/2010 06:52 am Jan Kiszka

Rework debug exception processing for gdb use

Guest debugging is currently broken under CONFIG_IOTHREAD. The reason is
inconsistent or even lacking signaling the debug events from the source
VCPU to the main loop and the gdbstub.

This patch addresses the issue by pushing this signaling into a...

262ea18e 07/06/2010 06:36 pm Jan Kiszka

Fix io-thread build breakage of a88790a14f

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

55541c8a 06/14/2010 11:46 pm Paolo Bonzini

make qemu_thread_create block all signals

All signals will thus be routed through the IO thread.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>