Re: [PATCH 2/3] softmmu: Use async_run_on_cpu in tcg_commit

2023-08-29 Thread Jonathan Cameron via
On Sat, 26 Aug 2023 16:24:14 -0700 Richard Henderson wrote: > After system startup, run the update to memory_dispatch > and the tlb_flush on the cpu. This eliminates a race, > wherein a running cpu sees the memory_dispatch change > but has not yet seen the tlb_flush. > > Since the update now ha

Re: [PATCH 2/3] softmmu: Use async_run_on_cpu in tcg_commit

2023-08-27 Thread Richard Henderson
On 8/27/23 13:17, Alex Bennée wrote: Richard Henderson writes: On 8/26/23 16:24, Richard Henderson wrote: +static void tcg_commit_cpu(CPUState *cpu, run_on_cpu_data data) +{ +CPUAddressSpace *cpuas = data.host_ptr; + +cpuas->memory_dispatch = address_space_to_dispatch(cpuas->as); +

Re: [PATCH 2/3] softmmu: Use async_run_on_cpu in tcg_commit

2023-08-27 Thread Alex Bennée
Richard Henderson writes: > On 8/26/23 16:24, Richard Henderson wrote: >> +static void tcg_commit_cpu(CPUState *cpu, run_on_cpu_data data) >> +{ >> +CPUAddressSpace *cpuas = data.host_ptr; >> + >> +cpuas->memory_dispatch = address_space_to_dispatch(cpuas->as); >> +tlb_flush(cpu); >>

Re: [PATCH 2/3] softmmu: Use async_run_on_cpu in tcg_commit

2023-08-27 Thread Richard Henderson
On 8/26/23 16:24, Richard Henderson wrote: +static void tcg_commit_cpu(CPUState *cpu, run_on_cpu_data data) +{ +CPUAddressSpace *cpuas = data.host_ptr; + +cpuas->memory_dispatch = address_space_to_dispatch(cpuas->as); +tlb_flush(cpu); +} Question: do I need to take the iothread lock

Re: [PATCH 2/3] softmmu: Use async_run_on_cpu in tcg_commit

2023-08-27 Thread Alex Bennée
Richard Henderson writes: > After system startup, run the update to memory_dispatch > and the tlb_flush on the cpu. This eliminates a race, > wherein a running cpu sees the memory_dispatch change > but has not yet seen the tlb_flush. > > Since the update now happens on the cpu, we need not use

[PATCH 2/3] softmmu: Use async_run_on_cpu in tcg_commit

2023-08-26 Thread Richard Henderson
After system startup, run the update to memory_dispatch and the tlb_flush on the cpu. This eliminates a race, wherein a running cpu sees the memory_dispatch change but has not yet seen the tlb_flush. Since the update now happens on the cpu, we need not use qatomic_rcu_read to protect the read of