[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 09/12] cpus: introduce cpu_update_icount help
From: |
Alex Bennée |
Subject: |
Re: [Qemu-devel] [PATCH v2 09/12] cpus: introduce cpu_update_icount helper |
Date: |
Wed, 05 Apr 2017 15:34:39 +0100 |
User-agent: |
mu4e 0.9.19; emacs 25.2.13 |
Paolo Bonzini <address@hidden> writes:
> On 05/04/2017 15:25, Alex Bennée wrote:
>> +{
>> + int64_t executed = cpu_get_icount_executed(cpu);
>> + cpu->icount_budget -= executed;
>> + atomic_add(&timers_state.qemu_icount, executed);
>> +}
>
> Since there's only one writer, it's also okay to do
>
> atomic_set(&timers_state.qemu_icount,
> atomic_read(&timers_state.qemu_icount) + executed);
>
> (also not just faster, but also simpler to turn into TCG code if we do
> the update in gen_io_start).
OK fair enough. Annoyingly I've just noticed this breaks for 32 bit
hosts because we might not have CONFIG_ATOMIC64. What's the best
approach? #ifdef and handwave?
--
Alex Bennée
- [Qemu-devel] [PATCH v2 02/12] scripts/qemu-gdb/timers.py: new helper to dump timer state, (continued)
- [Qemu-devel] [PATCH v2 02/12] scripts/qemu-gdb/timers.py: new helper to dump timer state, Alex Bennée, 2017/04/05
- [Qemu-devel] [PATCH v2 03/12] scripts/replay-dump.py: replay log dumper, Alex Bennée, 2017/04/05
- [Qemu-devel] [PATCH v2 05/12] cpus: remove icount handling from qemu_tcg_cpu_thread_fn, Alex Bennée, 2017/04/05
- [Qemu-devel] [PATCH v2 04/12] target/i386/misc_helper: wrap BQL around another IRQ generator, Alex Bennée, 2017/04/05
- [Qemu-devel] [PATCH v2 06/12] cpus: check cpu->running in cpu_get_icount_raw(), Alex Bennée, 2017/04/05
- [Qemu-devel] [PATCH v2 01/12] scripts/qemugdb/mtree.py: fix up mtree dump, Alex Bennée, 2017/04/05
- [Qemu-devel] [PATCH v2 08/12] cpus: don't credit executed instructions before they have run, Alex Bennée, 2017/04/05
- [Qemu-devel] [PATCH v2 07/12] cpus: move icount preparation out of tcg_exec_cpu, Alex Bennée, 2017/04/05
- [Qemu-devel] [PATCH v2 09/12] cpus: introduce cpu_update_icount helper, Alex Bennée, 2017/04/05
- [Qemu-devel] [PATCH v2 12/12] replay: assert time only goes forward, Alex Bennée, 2017/04/05
[Qemu-devel] [PATCH v2 11/12] cpus: call cpu_update_icount on read, Alex Bennée, 2017/04/05