[PATCH 0/6] plugins/cache: multicore cache emulation and minor

Mahmoud Mandour posted 6 patches 2 years, 9 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210714172151.8494-1-ma.mandourr@gmail.com
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, Alexandre Iooss <erdnaxe@crans.org>, Mahmoud Mandour <ma.mandourr@gmail.com>
contrib/plugins/cache.c    | 188 +++++++++++++++++++++++++++++--------
docs/devel/tcg-plugins.rst |  13 ++-
2 files changed, 155 insertions(+), 46 deletions(-)
[PATCH 0/6] plugins/cache: multicore cache emulation and minor
Posted by Mahmoud Mandour 2 years, 9 months ago
Hello,

This series introduce some minor improvements/bug fixes in the cache
plugins and multicore cache modelling.

One prominent bug is the use-after-free bug induced by linux-user
multithreaded programs. Since plugin_exit is not guaranteed to be called
after all callbacks, it may free data that subsequent callbacks may try
to use.

Trying to uninstall the plugin after exiting does not solve the problem
since it will unregister the callbacks but it won't prevent the
already-fired callback instances from continuing.

To mitigate this issue, the data is NULLified on exitting so that
callbacks can check whether plugin_exit has been called already or not.

Also, raising the levels of warnings (by the time this is sent, it's not
yet upstreamed but it's in the process of getting merged) induced some
warnings, this is fixed in its own patch.

Mahmoud Mandour (6):
  plugins/cache: Fixed a bug with destroying FIFO metadata
  plugins/cache: limited the scope of a mutex lock
  plugins/cache: Fixed a use-after-free bug with multithreaded usermode
  plugins/cache: Supported multicore cache modelling
  docs/devel/tcg-plugins: added cores arg to cache plugin
  plugins/cache: Fixed "function decl. is not a prototype" warnings

 contrib/plugins/cache.c    | 188 +++++++++++++++++++++++++++++--------
 docs/devel/tcg-plugins.rst |  13 ++-
 2 files changed, 155 insertions(+), 46 deletions(-)

-- 
2.25.1


Re: [PATCH 0/6] plugins/cache: multicore cache emulation and minor
Posted by Alex Bennée 2 years, 9 months ago
Mahmoud Mandour <ma.mandourr@gmail.com> writes:

> Hello,
>
> This series introduce some minor improvements/bug fixes in the cache
> plugins and multicore cache modelling.

Queued patches 1,2 and 6 for-6.1/fixes-for-rc1 as they are bug fixes, thanks.

-- 
Alex Bennée