Browse Source

treewide: rename qemu_wait_io_event/qemu_wait_io_event_common

Do so before extending it to the user-mode emulators, where there is no
such thing as an "I/O thread".

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
pull/305/head
Paolo Bonzini 7 months ago
parent
commit
871de7078f
  1. 2
      accel/dummy-cpus.c
  2. 2
      accel/hvf/hvf-accel-ops.c
  3. 2
      accel/kvm/kvm-accel-ops.c
  4. 2
      accel/tcg/tcg-accel-ops-mttcg.c
  5. 4
      accel/tcg/tcg-accel-ops-rr.c
  6. 2
      cpu-common.c
  7. 2
      include/hw/core/cpu.h
  8. 4
      include/system/cpus.h
  9. 6
      system/cpus.c
  10. 2
      target/i386/nvmm/nvmm-accel-ops.c
  11. 2
      target/i386/whpx/whpx-accel-ops.c

2
accel/dummy-cpus.c

@ -57,7 +57,7 @@ static void *dummy_cpu_thread_fn(void *arg)
qemu_sem_wait(&cpu->sem);
#endif
bql_lock();
qemu_wait_io_event(cpu);
qemu_process_cpu_events(cpu);
} while (!cpu->unplug);
bql_unlock();

2
accel/hvf/hvf-accel-ops.c

@ -198,7 +198,7 @@ static void *hvf_cpu_thread_fn(void *arg)
cpu_handle_guest_debug(cpu);
}
}
qemu_wait_io_event(cpu);
qemu_process_cpu_events(cpu);
} while (!cpu->unplug || cpu_can_run(cpu));
hvf_vcpu_destroy(cpu);

2
accel/kvm/kvm-accel-ops.c

@ -53,7 +53,7 @@ static void *kvm_vcpu_thread_fn(void *arg)
cpu_handle_guest_debug(cpu);
}
}
qemu_wait_io_event(cpu);
qemu_process_cpu_events(cpu);
} while (!cpu->unplug || cpu_can_run(cpu));
kvm_destroy_vcpu(cpu);

2
accel/tcg/tcg-accel-ops-mttcg.c

@ -113,7 +113,7 @@ static void *mttcg_cpu_thread_fn(void *arg)
}
}
qemu_wait_io_event(cpu);
qemu_process_cpu_events(cpu);
} while (!cpu->unplug || cpu_can_run(cpu));
tcg_cpu_destroy(cpu);

4
accel/tcg/tcg-accel-ops-rr.c

@ -117,7 +117,7 @@ static void rr_wait_io_event(void)
rr_start_kick_timer();
CPU_FOREACH(cpu) {
qemu_wait_io_event_common(cpu);
qemu_process_cpu_events_common(cpu);
}
}
@ -203,7 +203,7 @@ static void *rr_cpu_thread_fn(void *arg)
/* process any pending work */
CPU_FOREACH(cpu) {
current_cpu = cpu;
qemu_wait_io_event_common(cpu);
qemu_process_cpu_events_common(cpu);
}
}

2
cpu-common.c

@ -137,7 +137,7 @@ static void queue_work_on_cpu(CPUState *cpu, struct qemu_work_item *wi)
wi->done = false;
qemu_mutex_unlock(&cpu->work_mutex);
/* exit the inner loop and reach qemu_wait_io_event_common(). */
/* exit the inner loop and reach qemu_process_cpu_events_common(). */
cpu_exit(cpu);
}

2
include/hw/core/cpu.h

@ -422,7 +422,7 @@ struct qemu_work_item;
* valid under cpu_list_lock.
* @created: Indicates whether the CPU thread has been successfully created.
* @halt_cond: condition variable sleeping threads can wait on.
* @exit_request: Another thread requests the CPU to call qemu_wait_io_event().
* @exit_request: Another thread requests the CPU to call qemu_process_cpu_events().
* Should be read only by CPU thread with load-acquire, to synchronize with
* other threads' store-release operation.
*

4
include/system/cpus.h

@ -17,8 +17,8 @@ bool cpu_work_list_empty(CPUState *cpu);
bool cpu_thread_is_idle(CPUState *cpu);
bool all_cpu_threads_idle(void);
bool cpu_can_run(CPUState *cpu);
void qemu_wait_io_event_common(CPUState *cpu);
void qemu_wait_io_event(CPUState *cpu);
void qemu_process_cpu_events_common(CPUState *cpu);
void qemu_process_cpu_events(CPUState *cpu);
void cpu_thread_signal_created(CPUState *cpu);
void cpu_thread_signal_destroyed(CPUState *cpu);
void cpu_handle_guest_debug(CPUState *cpu);

6
system/cpus.c

@ -450,7 +450,7 @@ static void qemu_cpu_stop(CPUState *cpu, bool exit)
qemu_cond_broadcast(&qemu_pause_cond);
}
void qemu_wait_io_event_common(CPUState *cpu)
void qemu_process_cpu_events_common(CPUState *cpu)
{
qatomic_set_mb(&cpu->thread_kicked, false);
if (cpu->stop) {
@ -459,7 +459,7 @@ void qemu_wait_io_event_common(CPUState *cpu)
process_queued_cpu_work(cpu);
}
void qemu_wait_io_event(CPUState *cpu)
void qemu_process_cpu_events(CPUState *cpu)
{
bool slept = false;
@ -474,7 +474,7 @@ void qemu_wait_io_event(CPUState *cpu)
qemu_plugin_vcpu_resume_cb(cpu);
}
qemu_wait_io_event_common(cpu);
qemu_process_cpu_events_common(cpu);
}
void cpus_kick_thread(CPUState *cpu)

2
target/i386/nvmm/nvmm-accel-ops.c

@ -51,7 +51,7 @@ static void *qemu_nvmm_cpu_thread_fn(void *arg)
while (cpu_thread_is_idle(cpu)) {
qemu_cond_wait_bql(cpu->halt_cond);
}
qemu_wait_io_event_common(cpu);
qemu_process_cpu_events_common(cpu);
} while (!cpu->unplug || cpu_can_run(cpu));
nvmm_destroy_vcpu(cpu);

2
target/i386/whpx/whpx-accel-ops.c

@ -51,7 +51,7 @@ static void *whpx_cpu_thread_fn(void *arg)
while (cpu_thread_is_idle(cpu)) {
qemu_cond_wait_bql(cpu->halt_cond);
}
qemu_wait_io_event_common(cpu);
qemu_process_cpu_events_common(cpu);
} while (!cpu->unplug || cpu_can_run(cpu));
whpx_destroy_vcpu(cpu);

Loading…
Cancel
Save