[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 11/34] hyperv: add synic message delivery
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC PATCH 11/34] hyperv: add synic message delivery |
Date: |
Thu, 8 Feb 2018 15:57:09 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 07/02/2018 20:06, Roman Kagan wrote:
>>> + struct hyperv_message *msg;
>>> + /*
>>> + * the state of the message staged in .msg:
>>> + * 0 - the staging area is not in use (after init or message
>>> + * successfully delivered to guest)
>>> + * -EBUSY - the staging area is being used in vcpu thread
>>> + * -EAGAIN - delivery attempt failed due to slot being busy, retry
>>> + * -EXXXX - error
>>> + */
>>> + int msg_status;
>>> +
>> Access to these fields needs to be protected by a mutex (the refcount is
>> okay because it is only released in the bottom half).
> Hmm, I'll double-check, but the original idea was that this stuff is
> only used/ref-d/unref-d in the main thread so no mutex was necessary.
"Passing the buck" from iothread to vCPU and vice versa should work;
async_run_on_cpu and aio_bh_schedule_oneshot introduce the necessary
ordering. However you could still have concurrent access to the state.
The mutex is the safest option, but please document whatever you come up
with.
Thanks,
Paolo
- Re: [Qemu-devel] [RFC PATCH 08/34] hyperv: qom-ify SynIC, (continued)
[Qemu-devel] [RFC PATCH 10/34] hyperv: make overlay pages for SynIC, Roman Kagan, 2018/02/06
[Qemu-devel] [RFC PATCH 09/34] hyperv: block SynIC use in QEMU in incompatible configurations, Roman Kagan, 2018/02/06
[Qemu-devel] [RFC PATCH 11/34] hyperv: add synic message delivery, Roman Kagan, 2018/02/06
[Qemu-devel] [RFC PATCH 12/34] hyperv: add synic event flag signaling, Roman Kagan, 2018/02/06
[Qemu-devel] [RFC PATCH 13/34] hyperv: process SIGNAL_EVENT hypercall, Roman Kagan, 2018/02/06
[Qemu-devel] [RFC PATCH 14/34] hyperv: process POST_MESSAGE hypercall, Roman Kagan, 2018/02/06
[Qemu-devel] [RFC PATCH 16/34] hyperv: update copyright notices, Roman Kagan, 2018/02/06
[Qemu-devel] [RFC PATCH 15/34] hyperv_testdev: add SynIC message and event testmodes, Roman Kagan, 2018/02/06
[Qemu-devel] [RFC PATCH 17/34] [not to commit] import HYPERV_EVENTFD stuff from kernel, Roman Kagan, 2018/02/06
[Qemu-devel] [RFC PATCH 18/34] hyperv: add support for KVM_HYPERV_EVENTFD, Roman Kagan, 2018/02/06