qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v7 18/27] cputlb: introduce tlb_flush_*_all_cpus


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v7 18/27] cputlb: introduce tlb_flush_*_all_cpus
Date: Mon, 23 Jan 2017 11:21:11 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0

On 01/19/2017 09:04 AM, Alex Bennée wrote:
> +/* flush_all_helper: run fn across all cpus
> + *
> + * If the wait flag is set then the src cpu's helper will be queued as
> + * "safe" work and the loop exited creating a synchronisation point
> + * where all queued work will be finished before execution starts
> + * again.
> + */
> +static void flush_all_helper(CPUState *src, bool wait,
> +                             run_on_cpu_func fn, run_on_cpu_data d)
> +{
> +    CPUState *cpu;
> +
> +    if (!wait) {
> +        CPU_FOREACH(cpu) {
> +            if (cpu != src) {
> +                async_run_on_cpu(cpu, fn, d);
> +            } else {
> +                g_assert(qemu_cpu_is_self(src));
> +                fn(src, d);
> +            }
> +        }
> +    } else {
> +        CPU_FOREACH(cpu) {
> +            if (cpu != src) {
> +                async_run_on_cpu(cpu, fn, d);
> +            } else {
> +                async_safe_run_on_cpu(cpu, fn, d);
> +            }
> +
> +        }
> +        cpu_loop_exit(src);
> +    }
> +}

What's the rationale for not having the target do the exit itself?  Surely it
can tell, and simple end the TB after the insn.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]