[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 23/50] cpu: hook plugin vcpu events
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH v3 23/50] cpu: hook plugin vcpu events |
Date: |
Mon, 17 Jun 2019 14:00:50 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 6/14/19 10:11 AM, Alex Bennée wrote:
> static void qemu_wait_io_event(CPUState *cpu)
> {
> + bool slept = false;
> +
> while (cpu_thread_is_idle(cpu)) {
> + if (!slept) {
> + slept = true;
> + qemu_plugin_vcpu_idle_cb(cpu);
> + }
> qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex);
> }
> + if (slept) {
> + qemu_plugin_vcpu_resume_cb(cpu);
> + }
Maybe better without the variable.
if (cpu_thread_is_idle(cpu)) {
qemu_plugin_vcpu_idle_cb(cpu);
do {
qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex);
} while (cpu_thread_is_idle(cpu);
qemu_plugin_vcpu_resume_cb(cpu);
}
Otherwise,
Reviewed-by: Richard Henderson <address@hidden>
r~
- [Qemu-devel] [PATCH v3 08/50] plugin: add core code, (continued)
- [Qemu-devel] [PATCH v3 08/50] plugin: add core code, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 49/50] include/exec/cpu-defs.h: fix typo, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 21/50] *-user: notify plugin of exit, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 28/50] target/sh4: fetch code with translator_ld, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 35/50] target/xtensa: fetch code with translator_ld, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 43/50] tests/plugin: add a hotblocks plugin, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 23/50] cpu: hook plugin vcpu events, Alex Bennée, 2019/06/14
- Re: [Qemu-devel] [PATCH v3 23/50] cpu: hook plugin vcpu events,
Richard Henderson <=
- [Qemu-devel] [PATCH v3 11/50] cputlb: document get_page_addr_code, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 44/50] plugin: add qemu_plugin_insn_disas helper, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 18/50] cpu_ldst_useronly_template: remove redundant #ifndef CODE_ACCESS, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 20/50] translate-all: notify plugin code of tb_flush, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 46/50] tests/plugin: add hotpages plugin to breakdown memory access patterns, Alex Bennée, 2019/06/14
- [Qemu-devel] [PATCH v3 33/50] target/riscv: fetch code with translator_ld, Alex Bennée, 2019/06/14