qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 0/1] Add missing function names to symbol list


From: Lukas Jünger
Subject: Re: [PATCH 0/1] Add missing function names to symbol list
Date: Mon, 18 Oct 2021 12:55:39 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0

On 9/7/21 13:43, Alex Bennée wrote:
Lukas Jünger <lukas.junger@greensocs.com> writes:

Hi all,

I have been trying to use the hwprofile and cache plugin on
qemu-system-riscv64. They failed to load with an undefined
symbol error. It looks like some of the plugin API functions
are missing from the symbol list, so I added them.
Heh I had a similar patch in plugins/next but yours includes more
symbols so queued to plugins/next, thanks. Not sure how I missed it
before - I think we might not have been honouring the symbol list
before.

Afterwards
the plugins worked (eventhough the cache plugin is segfaulting
on shutdown, but that is a separate, unrelated issue).
Has this been tracked down yet? There is a fix f7e68c9c99 (tcg/plugins:
implement a qemu_plugin_user_exit helper) which was for user mode. At
the time I didn't think system mode would be affected due to the atexit
callback only being called once vCPUs had shutdown.

It seems like there is a race condition with the tcg threads.
The plugin exit handler is run with atexit(). While the exit callback
is freeing memory, tcg is still running and memory callbacks write
to the already freed data structures in the plugin causing the segfault.
I tested this with the current master branch and this cmdline:

bin/qemu-system-riscv64 -machine virt -nographic -bios fw_jump.elf
    -kernel Image -plugin path/to/libcache.so -d plugin -D log.txt

I wonder if we could somehow wait for the tcg to exit before executing
plugin exit cb. Do you have an idea?


Hope that's okay.

BR,
Lukas

Lukas Jünger (1):
   plugins/: Add missing functions to symbol list

  plugins/qemu-plugins.symbols | 3 +++
  1 file changed, 3 insertions(+)




reply via email to

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