From: Paolo Bonzini <pbonzini@redhat.com>
To: Emanuele Giuseppe Esposito <eesposit@redhat.com>, qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Yanan Wang" <wangyanan55@huawei.com>,
kvm@vger.kernel.org, "David Hildenbrand" <david@redhat.com>
Subject: Re: [PATCH v2 2/3] KVM: keep track of running ioctls
Date: Fri, 11 Nov 2022 11:49:18 +0100 [thread overview]
Message-ID: <f4db2187-af9e-d417-2639-6641e3c6725a@redhat.com> (raw)
In-Reply-To: <20221110164807.1306076-3-eesposit@redhat.com>
On 11/10/22 17:48, Emanuele Giuseppe Esposito wrote:
> diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c
> index f9fdd46b9d..8d6a4b1b65 100644
> --- a/hw/core/cpu-common.c
> +++ b/hw/core/cpu-common.c
> @@ -237,6 +237,7 @@ static void cpu_common_initfn(Object *obj)
> cpu->nr_threads = 1;
>
> qemu_mutex_init(&cpu->work_mutex);
> + qemu_lockcnt_init(&cpu->in_ioctl_lock);
> QSIMPLEQ_INIT(&cpu->work_list);
> QTAILQ_INIT(&cpu->breakpoints);
> QTAILQ_INIT(&cpu->watchpoints);
> @@ -248,6 +249,7 @@ static void cpu_common_finalize(Object *obj)
> {
> CPUState *cpu = CPU(obj);
>
> + qemu_lockcnt_destroy(&cpu->in_ioctl_lock);
> qemu_mutex_destroy(&cpu->work_mutex);
> }
> diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
> index f9b58773f7..15053663bc 100644
> --- a/include/hw/core/cpu.h
> +++ b/include/hw/core/cpu.h
> @@ -397,6 +397,9 @@ struct CPUState {
> uint32_t kvm_fetch_index;
> uint64_t dirty_pages;
>
> + /* Use by accel-block: CPU is executing an ioctl() */
> + QemuLockCnt in_ioctl_lock;
> +
> /* Used for events with 'vcpu' and *without* the 'disabled' properties */
> DECLARE_BITMAP(trace_dstate_delayed, CPU_TRACE_DSTATE_MAX_EVENTS);
> DECLARE_BITMAP(trace_dstate, CPU_TRACE_DSTATE_MAX_EVENTS);
These go in patch 1.
Paolo
next prev parent reply other threads:[~2022-11-11 10:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-10 16:48 [PATCH v2 0/3] KVM: allow listener to stop all vcpus before Emanuele Giuseppe Esposito
2022-11-10 16:48 ` [PATCH v2 1/3] accel: introduce accelerator blocker API Emanuele Giuseppe Esposito
2022-11-11 10:48 ` Paolo Bonzini
2022-11-11 14:52 ` Emanuele Giuseppe Esposito
2022-11-10 16:48 ` [PATCH v2 2/3] KVM: keep track of running ioctls Emanuele Giuseppe Esposito
2022-11-11 10:49 ` Paolo Bonzini [this message]
2022-11-10 16:48 ` [PATCH v2 3/3] kvm: Atomic memslot updates Emanuele Giuseppe Esposito
2022-11-11 11:01 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f4db2187-af9e-d417-2639-6641e3c6725a@redhat.com \
--to=pbonzini@redhat.com \
--cc=david@redhat.com \
--cc=eduardo@habkost.net \
--cc=eesposit@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=marcel.apfelbaum@gmail.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=wangyanan55@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).