[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v4 05/71] cpu: move run_on_cpu to cpus-common
From: |
Emilio G. Cota |
Subject: |
Re: [Qemu-devel] [RFC v4 05/71] cpu: move run_on_cpu to cpus-common |
Date: |
Mon, 29 Oct 2018 17:39:27 -0400 |
User-agent: |
Mutt/1.9.4 (2018-02-28) |
On Mon, Oct 29, 2018 at 16:34:49 +0000, Alex Bennée wrote:
>
> Emilio G. Cota <address@hidden> writes:
>
> > We don't pass a pointer to qemu_global_mutex anymore.
> >
> > Reviewed-by: Richard Henderson <address@hidden>
> > Signed-off-by: Emilio G. Cota <address@hidden>
>
> As discussed on IRC I don't fundamentally object to this being in
> cpus-common given we have the other work queue stuff there. However
> given it now lives there we should assert we are in system emulation
> mode so if a user-mode instruction attempts to use one of the
> _run_on_cpu() functions we break.
Thanks for looking into this. I fixed up the commit to add stubs for
cpu_lock/unlock, since the former cpu->work_mutex has to keep working.
I'm not convinced about adding an "assert(!user-mode)" to run_on_cpu.
Given that now it does not depend on the BQL, it could actually
work in user-mode if called. If we really wanted to make sure
that no user-mode would call it, then a compile-time check
would be better than an assert. But again, I fail to see what
we'd gain from that.
For context, do_run_on_cpu et al. were moved to cpus-common.c by
d148d90ee8 ("cpus-common: move CPU work item management to
common code", 2016-09-27). The point was to consolidate the
run-on-cpu code in a common (softmmu & user-mode) file, since
user-mode needed async_run_on_cpu for exclusive work.
Now we can finally make run_on_cpu generic as well.
Thanks,
Emilio
- [Qemu-devel] [RFC v4 09/71] cris: convert to helper_cpu_halted_set, (continued)
- [Qemu-devel] [RFC v4 09/71] cris: convert to helper_cpu_halted_set, Emilio G. Cota, 2018/10/25
- [Qemu-devel] [RFC v4 13/71] microblaze: convert to helper_cpu_halted_set, Emilio G. Cota, 2018/10/25
- [Qemu-devel] [RFC v4 08/71] ppc: convert to helper_cpu_halted_set, Emilio G. Cota, 2018/10/25
- [Qemu-devel] [RFC v4 07/71] tcg-runtime: define helper_cpu_halted_set, Emilio G. Cota, 2018/10/25
- [Qemu-devel] [RFC v4 05/71] cpu: move run_on_cpu to cpus-common, Emilio G. Cota, 2018/10/25
[Qemu-devel] [RFC v4 02/71] cpu: rename cpu->work_mutex to cpu->lock, Emilio G. Cota, 2018/10/25
[Qemu-devel] [RFC v4 39/71] i386/hax-all: convert to cpu_interrupt_request, Emilio G. Cota, 2018/10/25
[Qemu-devel] [RFC v4 06/71] cpu: introduce process_queued_cpu_work_locked, Emilio G. Cota, 2018/10/25
[Qemu-devel] [RFC v4 03/71] cpu: introduce cpu_mutex_lock/unlock, Emilio G. Cota, 2018/10/25