Skip to content

Commit 21d5bb8

Browse files
bonziniPatchew Applier
authored andcommitted
tcg/user: do not set exit_request gratuitously
Whenever user-mode emulation needs to go all the way out of the cpu exec loop, it uses cpu_exit(), which already sets cpu->exit_request. Therefore, there is no need for tcg_kick_vcpu_thread() to set cpu->exit_request again outside system emulation. Reviewed-by: Igor Mammedov <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]> Message-Id: <[email protected]>
1 parent 02596bb commit 21d5bb8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

accel/tcg/cpu-exec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,13 +751,15 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret)
751751

752752
void tcg_kick_vcpu_thread(CPUState *cpu)
753753
{
754+
#ifndef CONFIG_USER_ONLY
754755
/*
755756
* Ensure cpu_exec will see the reason why the exit request was set.
756757
* FIXME: this is not always needed. Other accelerators instead
757758
* read interrupt_request and set exit_request on demand from the
758759
* CPU thread; see kvm_arch_pre_run() for example.
759760
*/
760761
qatomic_store_release(&cpu->exit_request, true);
762+
#endif
761763

762764
/* Ensure cpu_exec will see the exit request after TCG has exited. */
763765
qatomic_store_release(&cpu->neg.icount_decr.u16.high, -1);

0 commit comments

Comments
 (0)