Use of start_exclusive on this exit path leads to deadlock, in particular when called from dump_core_and_abort. There does not appear to be a need for it.
While we're at it, skip the entire function if no plugins. Signed-off-by: Richard Henderson <richard.hender...@linaro.org> --- plugins/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/core.c b/plugins/core.c index ccb770a485..35aca0266d 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -502,7 +502,9 @@ void qemu_plugin_user_exit(void) QEMU_LOCK_GUARD(&plugin.lock); - start_exclusive(); + if (QTAILQ_EMPTY(&plugin.ctxs)) { + return; + } /* un-register all callbacks except the final AT_EXIT one */ for (ev = 0; ev < QEMU_PLUGIN_EV_MAX; ev++) { @@ -520,8 +522,6 @@ void qemu_plugin_user_exit(void) qemu_plugin_disable_mem_helpers(cpu); } - end_exclusive(); - /* now it's safe to handle the exit case */ qemu_plugin_atexit_cb(); } -- 2.34.1