- 05 11月, 2015 1 次提交
-
-
由 Liang Li 提交于
This reverts commit de9d61e8. Now 'cpu_clean_all_dirty' is useless, we can revert the related code. Conflicts: include/sysemu/kvm.h Signed-off-by: NLiang Li <liang.z.li@intel.com> Message-Id: <1446695464-27116-3-git-send-email-liang.z.li@intel.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 09 10月, 2015 1 次提交
-
-
由 Christopher Covington 提交于
This should help clarify the purpose of the function that returns the host system's CPU cycle count. Signed-off-by: NChristopher Covington <cov@codeaurora.org> Acked-by: NPaolo Bonzini <pbonzini@redhat.com> ppc portion Acked-by: NDavid Gibson <david@gibson.dropbear.id.au> Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
-
- 30 9月, 2015 1 次提交
-
-
由 Jason J. Herne 提交于
Provide a method to throttle guest cpu execution. CPUState is augmented with timeout controls and throttle start/stop functions. To throttle the guest cpu the caller simply has to call the throttle set function and provide a percentage of throttle time. Signed-off-by: NJason J. Herne <jjherne@linux.vnet.ibm.com> Reviewed-by: NMatthew Rosato <mjrosato@linux.vnet.ibm.com> Signed-off-by: NJuan Quintela <quintela@redhat.com> Reviewed-by: NJuan Quintela <quintela@redhat.com>
-
- 09 9月, 2015 6 次提交
-
-
由 KONRAD Frederic 提交于
This hides the tcg_halt_cond and tcg_cpu_thread global variables inside qemu_tcg_init_vcpu. Multi-threaded TCG will need one QemuCond and one QemuThread per virtual cpu, so it's preferrable to use cpu->halt_cond and cpu->thread. Signed-off-by: NKONRAD Frederic <fred.konrad@greensocs.com> Message-Id: <1439220437-23957-9-git-send-email-fred.konrad@greensocs.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
Protect the list of queued work items with something other than the BQL, as a preparation for running the work items outside it. Reviewed-by: NPeter Maydell <peter.maydell@linaro.org> Signed-off-by: NKONRAD Frederic <fred.konrad@greensocs.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
Signals are slow and do not exist on Win32. The previous patches have done most of the legwork to introduce memory barriers (some of them were even there already for the sake of Windows!) and we can now set the flags directly in the iothread. qemu_cpu_kick_thread is not used anymore on TCG, since the TCG thread is never outside usermode while the CPU is running (not halted). Instead run the content of the signal handler (now in qemu_cpu_kick_no_halt) directly. qemu_cpu_kick_no_halt is also used in qemu_mutex_lock_iothread to avoid the overhead of qemu_cond_broadcast. Reviewed-by: NRichard Henderson <rth@twiddle.net> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
Use the same API to trigger interruption of a CPU, no matter if under TCG or KVM. There is no difference: these calls come from the CPU thread, so the qemu_cpu_kick calls will send a signal to the running thread and it will be processed synchronously, just like a call to cpu_exit. The only difference is in the overhead, but neither call to cpu_exit (now qemu_cpu_kick) is in a hot path. Reviewed-by: NRichard Henderson <rth@twiddle.net> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
Synchronize the remaining pair of accesses in cpu_signal. These should be necessary on Windows as well, at least in theory. Probably SuspendProcess and ResumeProcess introduce some implicit memory barrier. Reviewed-by: NRichard Henderson <rth@twiddle.net> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
This is already useful on Windows in order to remove tls.h, because accesses to current_cpu are done from a different thread on that platform. It will be used on POSIX platforms as soon TCG stops using signals to interrupt the execution of translated code. Reviewed-by: NRichard Henderson <rth@twiddle.net> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 08 9月, 2015 1 次提交
-
-
由 Aníbal Limón 提交于
When QEMU starts the RCU thread executes qemu_mutex_lock_thread causing error "qemu:qemu_cpu_kick_thread: No such process" and exits. This isn't occur frequently but in glibc the thread id can exist and this not guarantee that the thread is on active/running state. If is inserted a sleep(1) after newthread assignment [1] the issue appears. So not make assumption that thread exist if first_cpu->thread is set then change the validation of cpu to created that is set into cpu threads (kvm, tcg, dummy). [1] https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_create.c;h=d10f4ea8004e1d8f3a268b95cc0f8d93b8d89867;hb=HEAD#l621 Cc: qemu-stable@nongnu.org Signed-off-by: NAníbal Limón <anibal.limon@linux.intel.com> Message-Id: <1441313313-3040-1-git-send-email-anibal.limon@linux.intel.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 15 8月, 2015 1 次提交
-
-
由 Paolo Bonzini 提交于
After commit 626cf8f4 (icount: set can_do_io outside TB execution, 2014-12-08), can_do_io is set to 1 if not executing code. It is no longer necessary to make this assumption in cpu_can_do_io. It is also possible to remove the use_icount test, simply by never setting cpu->can_do_io to 0 unless use_icount is true. With these changes cpu_can_do_io boils down to a read of cpu->can_do_io. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 24 7月, 2015 1 次提交
-
-
由 Paolo Bonzini 提交于
Otherwise, grace periods are detected too early! Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 09 7月, 2015 2 次提交
-
-
由 Peter Crosthwaite 提交于
Remove un-needed usages of ENV_GET_CPU() by converting the APIs to use CPUState pointers and retrieving the env_ptr as minimally needed. Scripted conversion for target-* change: for I in target-*/cpu.h; do sed -i \ 's/\(^int cpu_[^_]*_exec(\)[^ ][^ ]* \*s);$/\1CPUState *cpu);/' \ $I; done Signed-off-by: NPeter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: NAndreas Färber <afaerber@suse.de>
-
由 Peter Crosthwaite 提交于
The sole caller of this function navigates the cpu->env_ptr only for this function to take it back the cpu pointer straight away. Pass in cpu pointer instead and grab the env pointer locally in the function. Removes a core code usage of ENV_GET_CPU(). Reviewed-by: NAndreas Färber <afaerber@suse.de> Reviewed-by: NEduardo Habkost <ehabkost@redhat.com> Signed-off-by: NPeter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: NAndreas Färber <afaerber@suse.de>
-
- 01 7月, 2015 2 次提交
-
-
由 Paolo Bonzini 提交于
This function will be used to avoid recursive locking of the iothread lock whenever address_space_rw/ld*/st* are called with the BQL held, which is almost always the case. Tracking whether the iothread is owned is very cheap (just use a TLS variable) but requires some care because now the lock must always be taken with qemu_mutex_lock_iothread(). Previously this wasn't the case. Outside TCG mode this is not a problem. In TCG mode, we need to be careful and avoid the "prod out of compiled code" step if already in a VCPU thread. This is easily done with a check on current_cpu, i.e. qemu_in_vcpu_thread(). Hopefully, multithreaded TCG will get rid of the whole logic to kick VCPUs whenever an I/O event occurs! Cc: Frederic Konrad <fred.konrad@greensocs.com> Message-Id: <1434646046-27150-3-git-send-email-pbonzini@redhat.com> Reviewed-by: NFam Zheng <famz@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
The next patch will require the BQL to be always taken with qemu_mutex_lock_iothread(), while right now this isn't the case. Outside TCG mode this is not a problem. In TCG mode, we need to be careful and avoid the "prod out of compiled code" step if already in a VCPU thread. This is easily done with a check on current_cpu, i.e. qemu_in_vcpu_thread(). Hopefully, multithreaded TCG will get rid of the whole logic to kick VCPUs whenever an I/O event occurs! Cc: Frederic Konrad <fred.konrad@greensocs.com> Message-Id: <1434646046-27150-2-git-send-email-pbonzini@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 23 6月, 2015 2 次提交
-
-
由 Markus Armbruster 提交于
Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Reviewed-by: NLuiz Capitulino <lcapitulino@redhat.com>
-
由 Markus Armbruster 提交于
These macros expand into error class enumeration constant, comma, string. Unclean. Has been that way since commit 13f59ae8. The error class is always ERROR_CLASS_GENERIC_ERROR since the previous commit. Clean up as follows: * Prepend every use of a QERR_ macro by ERROR_CLASS_GENERIC_ERROR, and delete it from the QERR_ macro. No change after preprocessing. * Rewrite error_set(ERROR_CLASS_GENERIC_ERROR, ...) into error_setg(...). Again, no change after preprocessing. Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Reviewed-by: NLuiz Capitulino <lcapitulino@redhat.com>
-
- 12 6月, 2015 1 次提交
-
-
由 Juan Quintela 提交于
We create optional sections with this patch. But we already have optional subsections. Instead of having two mechanism that do the same, we can just generalize it. For subsections we just change: - Add a needed function to VMStateDescription - Remove VMStateSubsection (after removal of the needed function it is just a VMStateDescription) - Adjust the whole tree, moving the needed function to the corresponding VMStateDescription Signed-off-by: NJuan Quintela <quintela@redhat.com>
-
- 05 6月, 2015 3 次提交
-
-
由 Victor CLEMENT 提交于
While qemu is running in sleep=no mode, a warning will be printed when no timer deadline is set. As this mode is intended for getting deterministic virtual time, if no timer is set on the virtual clock this determinism is broken. Signed-off-by: NVictor CLEMENT <victor.clement@openwide.fr> Message-Id: <1432912446-9811-4-git-send-email-victor.clement@openwide.fr> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Victor CLEMENT 提交于
The 'sleep' parameter sets the icount_sleep mode, which is enabled by default. To disable it, add the 'sleep=no' parameter (or 'nosleep') to the qemu -icount option. Signed-off-by: NVictor CLEMENT <victor.clement@openwide.fr> Message-Id: <1432912446-9811-3-git-send-email-victor.clement@openwide.fr> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Victor CLEMENT 提交于
When the icount_sleep mode is disabled, the QEMU_VIRTUAL_CLOCK runs at the maximum possible speed by warping the sleep times of the virtual cpu to the soonest clock deadline. The virtual clock will be updated only according the instruction counter. Signed-off-by: NVictor CLEMENT <victor.clement@openwide.fr> Message-Id: <1432912446-9811-2-git-send-email-victor.clement@openwide.fr> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 14 5月, 2015 1 次提交
-
-
由 Eduardo Habkost 提交于
This will allow clients to query additional information directly using qom-get on the CPU objects. Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au> Reviewed-by: NAndreas Färber <afaerber@suse.de> Signed-off-by: NEduardo Habkost <ehabkost@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
-
- 30 4月, 2015 1 次提交
-
-
由 Emilio G. Cota 提交于
Signed-off-by: NEmilio G. Cota <cota@braap.org> Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
-
- 25 3月, 2015 1 次提交
-
-
由 Peter Crosthwaite 提交于
following a4649824, it's now possible for there to be attempts to take the BQL before CPUs have been realized in cases where a machine model inits peripherals before the first CPU. BQL lock aquisition kicks the first_cpu, leading to a segfault if this happens pre-realize. Guard the CPU kick routine to perform no action for a CPU that doesn't exist or doesn't have a thread yet. There was a fix to this with commit 6b49809c, but the check there misses the case where the CPU has been inited and not realized. Strengthen the check to make sure that the first_cpu has a thread (i.e. it is realized) before allowing the kick. Signed-off-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com> Message-Id: <1427107689-6946-1-git-send-email-peter.crosthwaite@xilinx.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 18 3月, 2015 1 次提交
-
-
由 Alexey Kardashevskiy 提交于
2ed1ebcf "timer: replace time() with QEMU_CLOCK_HOST" broke compile when configured with --enable-profiler. Turned out the profiler has been broken for a while. This does s/qemu_time/tcg_time/ as the profiler only works in a TCG mode. This also fixes the compile error. This changes profile_getclock() to return nanoseconds rather than CPU ticks as the "profile" HMP command prints seconds and there is no platform-independent way to get ticks-per-second rate. Since TCG is quite slow and get_clock() returns nanoseconds (fine enough), this should not affect precision much. This removes unused qemu_time_start and tlb_flush_time. Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru> Message-Id: <1426478258-29961-1-git-send-email-aik@ozlabs.ru> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 10 3月, 2015 1 次提交
-
-
由 Borislav Petkov 提交于
When requesting a size which cannot be read, the error message shows a different address which is misleading to the user and it looks like something's wrong with the address parsing. This is because the input @addr variable is incremented in the memory dumping loop: (qemu) memsave 0xffffffff8418069c 0xb00000 mem Invalid addr 0xffffffff849ffe9c specified Fix that by saving the original address and size and use them in the error message: (qemu) memsave 0xffffffff8418069c 0xb00000 mem Invalid addr 0xffffffff8418069c/size 11534336 specified Signed-off-by: NBorislav Petkov <bp@suse.de> Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
-
- 02 3月, 2015 2 次提交
-
-
由 Paolo Bonzini 提交于
For good measure, ensure that the following sequence: thread 1 calls qemu_mutex_lock_iothread thread 2 calls qemu_mutex_lock_iothread VCPU thread are created VCPU thread enters execution loop results in the VCPU threads letting the other two threads run and obeying iothread_requesting_mutex even if the VCPUs are not halted. To do this, check iothread_requesting_mutex before execution starts. Tested-by: NLeon Alrae <leon.alrae@imgtec.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
When two threads (other than the low-priority TCG VCPU thread) are competing for the iothread lock, a deadlock can happen. This is because iothread_requesting_mutex is set to false by the first thread that gets the mutex, and then the VCPU thread might never yield from the execution loop. If iothread_requesting_mutex is changed from a bool to a counter, the deadlock is fixed. However, there is another bug in qemu_mutex_lock_iothread that can be triggered by the new call_rcu thread. The bug happens if qemu_mutex_lock_iothread is called before the CPUs are created. In that case, first_cpu is NULL and the caller segfaults in qemu_mutex_lock_iothread. To fix this, just do not do the kick if first_cpu is NULL. Reported-by: NLeon Alrae <leon.alrae@imgtec.com> Reported-by: NAndreas Gustafsson <gson@gson.org> Tested-by: NLeon Alrae <leon.alrae@imgtec.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 17 2月, 2015 1 次提交
-
-
由 Paolo Bonzini 提交于
Note that even after this patch, most callers of address_space_* functions must still be under the big QEMU lock, otherwise the memory region returned by address_space_translate can disappear as soon as address_space_translate returns. This will be fixed in the next part of this series. Reviewed-by: NFam Zheng <famz@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 16 2月, 2015 1 次提交
-
-
由 Fam Zheng 提交于
qemu_clock_run_timers() only takes care of main_loop_tlg, we shouldn't forget aio timer list groups. Currently, the qemu_clock_deadline_ns_all (a few lines above) counts all the timergroups of this clock type, including aio tlg, but we don't fire them, so they are never cleared, which makes a dead loop. For example, this function hangs when trying to drive throttled block request queue with qtest clock_step. Signed-off-by: NFam Zheng <famz@redhat.com> Acked-by: NPaolo Bonzini <pbonzini@redhat.com> Message-id: 1421661103-29153-1-git-send-email-famz@redhat.com Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 02 2月, 2015 1 次提交
-
-
由 Paolo Bonzini 提交于
With the introduction of QEMU_CLOCK_VIRTUAL_RT, the computation of sc->diff_clk can be simplified nicely: qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - qemu_clock_get_ns(QEMU_CLOCK_REALTIME) + cpu_get_clock_offset() = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - (qemu_clock_get_ns(QEMU_CLOCK_REALTIME) - cpu_get_clock_offset()) = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - (qemu_clock_get_ns(QEMU_CLOCK_REALTIME) + timers_state.cpu_clock_offset) = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL_RT) Cc: Sebastian Tanase <sebastian.tanase@openwide.fr> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 14 1月, 2015 1 次提交
-
-
由 Pavel Dovgalyuk 提交于
Fix mismatch between timer_new_ms and timer_mod. Signed-off-by: NPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 21 12月, 2014 1 次提交
-
-
由 Paolo Bonzini 提交于
This unbreaks linux-user (broken by e511b4d7, cpu-exec: reset exception_index correctly, 2014-11-26). Reported-by: NEduardo Habkost <ehabkost@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Tested-by: NLaurent Desnogues <laurent.desnogues@gmail.com> Tested-by: NEduardo Habkost <ehabkost@redhat.com> Message-id: 1418989994-17244-2-git-send-email-pbonzini@redhat.com Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
-
- 15 12月, 2014 4 次提交
-
-
由 Pavel Dovgalyuk 提交于
This patch makes icount warp use the new QEMU_CLOCK_VIRTUAL_RT clock. This way, icount's QEMU_CLOCK_VIRTUAL will never count time during which the virtual machine is stopped. Signed-off-by: NPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Pavel Dovgalyuk 提交于
Separate accessing the instruction counter from the compensation for speed and halting that are introduced by qemu_icount_bias. This introduces new infrastructure used by the record/replay patches. Signed-off-by: NPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Pavel Dovgalyuk 提交于
This patch sets can_do_io function to allow reading icount within cpu-exec, but outside TB execution. Signed-off-by: NPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Pavel Dovgalyuk 提交于
Exception index is reset at every entry at every entry into cpu_exec() function. This may cause missing the exceptions while replaying them. This patch moves exception_index reset to the locations where they are processed. Signed-off-by: NPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 16 9月, 2014 1 次提交
-
-
由 Marcelo Tosatti 提交于
Introduce cpu_clean_all_dirty, to force subsequent cpu_synchronize_all_states to read in-kernel register state. Cc: qemu-stable@nongnu.org Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 11 9月, 2014 1 次提交
-
-
由 Pavel Dovgalyuk 提交于
Ticks and clock offset used by CPU timers have to be saved in vmstate. But vmstate for these fields registered only in icount mode. Missing registration leads to breaking the continuity when vmstate is loaded. This patch introduces new initialization function which fixes this. Signed-off-by: NPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-