[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 7/8] cpu-exec-common: Introduce async_safe_run_on_
From: |
Sergey Fedorov |
Subject: |
Re: [Qemu-devel] [RFC 7/8] cpu-exec-common: Introduce async_safe_run_on_cpu() |
Date: |
Wed, 29 Jun 2016 18:03:21 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 |
On 27/06/16 12:36, Alex Bennée wrote:
> Sergey Fedorov <address@hidden> writes:
>
>> From: Sergey Fedorov <address@hidden>
>>
(snip)
>> diff --git a/cpus.c b/cpus.c
>> index 98f60f6f98f5..bb6bd8615cfc 100644
>> --- a/cpus.c
>> +++ b/cpus.c
>> @@ -932,6 +932,18 @@ static void qemu_tcg_destroy_vcpu(CPUState *cpu)
>> {
>> }
>>
>> +static void tcg_cpu_exec_start(CPUState *cpu)
>> +{
>> + tcg_pending_cpus++;
>> +}
>> +
>> +static void tcg_cpu_exec_end(CPUState *cpu)
>> +{
>> + if (--tcg_pending_cpus) {
>> + signal_cpu_work();
>> + }
>> +}
> Don't these need to be atomic?
'tcg_pending_cpus' is protected by BQL.
>
>> +
>> static void qemu_wait_io_event_common(CPUState *cpu)
>> {
>> if (cpu->stop) {
>>
(snip)
Thanks,
Sergey
- [Qemu-devel] [RFC 5/8] linux-user: Add qemu_cpu_is_self() and qemu_cpu_kick(), (continued)
- [Qemu-devel] [RFC 5/8] linux-user: Add qemu_cpu_is_self() and qemu_cpu_kick(), Sergey Fedorov, 2016/06/19
- [Qemu-devel] [RFC 2/8] cpus: Move common code out of {async_, }run_on_cpu(), Sergey Fedorov, 2016/06/19
- [Qemu-devel] [RFC 1/8] cpus: pass CPUState to run_on_cpu helpers, Sergey Fedorov, 2016/06/19
- [Qemu-devel] [RFC 3/8] cpus: Add 'qemu_work_cond' usage wrappers, Sergey Fedorov, 2016/06/19
- [Qemu-devel] [RFC 7/8] cpu-exec-common: Introduce async_safe_run_on_cpu(), Sergey Fedorov, 2016/06/19
- [Qemu-devel] [RFC 8/8] tcg: Make tb_flush() thread safe, Sergey Fedorov, 2016/06/19
- [Qemu-devel] [RFC 6/8] linux-user: Support CPU work queue, Sergey Fedorov, 2016/06/19