On 08/11/2016 08:24 AM, Alex Bennée wrote:
> + * Since QEMU doesn't currently implement a global/not-global flag
> + * for tlb entries, at the moment tlb_flush() will also flush all
> + * tlb entries in the flush_global == false case. This is OK because
> + * CPU architectures generally permit an implementation to drop
> + * entries from the TLB at any time, so flushing more entries than
> + * required is only an efficiency issue, not a correctness issue.
> + */
> +void tlb_flush(CPUState *cpu, int flush_global)
> +{
> + if (cpu->created && !qemu_cpu_is_self(cpu)) {
> + if (atomic_bool_cmpxchg(&cpu->pending_tlb_flush, false, true)) {
> + async_run_on_cpu(cpu, tlb_flush_global_async_work,
> + GINT_TO_POINTER(flush_global));
Given that we don't actually do anything with flush_global, let's not work so
hard to pass it down. Especially with something as ugly as GINT_TO_POINTER.
Or indeed, as a cleanup, remove that argument from all callers. If we want to
retain the documentation for the targets, we could do
#define tlb_flush_local tlb_flush
#define tlb_flush_global tlb_flush
r~