[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 00/13] Fix 32-bit build for plugins
From: |
Pierrick Bouvier |
Subject: |
[PATCH 00/13] Fix 32-bit build for plugins |
Date: |
Mon, 16 Dec 2024 17:06:54 -0800 |
Since 9.2.0 release, we are building contrib plugins using the QEMU build system
(before, it was external makefiles). When building for 32-bit host platform,
some warnings are triggered and build fail.
Thus, at the time, the decision was to not fix those plugins, and
disable by default plugins for 32-bit host platforms (see cf2a78cb).
This series fix plugins to have the same behaviour on 32-bit and 64-bit
platform, and reenable plugins for 32-bit platforms.
There are two portability issues:
- we use hash tables, and use data as key directly. As key has a pointer size,
it limits its size for 32-bit platform.
The fix is to use pointer as a key, and point to allocated 64-bit data. The
change is pretty straightforward for concerned plugins, and does not imply a
memory overhead, as hash table entry is already heap allocated usually.
- we use plugins callback data to pass a pc. This does not work on 32-bit
platform, as we are limited to a pointer size.
To avoid doing memory allocations, we simply we simply use
inline operations and a scoreboard to achieve the same result.
Tested (for every plugin modified) on i686 and x86_64.
The behaviour before and after this series was checked as well, and there is no
difference, apart from bug fixing (some pc were clipped at 32-bit values, even
on the 64-bit platform).
Pierrick Bouvier (13):
plugins: change signature of qemu_plugin_insn_haddr
plugins: bump API version
tests/tcg/plugins/insn: remove unused callback parameter
contrib/plugins/howvec: ensure we don't regress if this plugin is
extended
tests/tcg/plugins/syscall: fix 32-bit build
tests/tcg/plugins/mem: fix 32-bit build
contrib/plugins/stoptrigger: fix 32-bit build
contrib/plugins/cache: fix 32-bit build
contrib/plugins/hotblocks: fix 32-bit build
contrib/plugins/cflow: fix 32-bit build
contrib/plugins/hwprofile: fix 32-bit build
contrib/plugins/hotpages: fix 32-bit build
configure: reenable plugins by default for 32-bit hosts
configure | 21 +--------------
include/qemu/qemu-plugin.h | 8 ++++--
plugins/plugin.h | 2 +-
contrib/plugins/cache.c | 18 +++++--------
contrib/plugins/cflow.c | 17 ++++++++-----
contrib/plugins/hotblocks.c | 8 +++---
contrib/plugins/hotpages.c | 6 ++---
contrib/plugins/howvec.c | 7 ++---
contrib/plugins/hwprofile.c | 27 ++++++++++++--------
contrib/plugins/stoptrigger.c | 48 ++++++++++++++++++++---------------
plugins/api.c | 12 ++++-----
tests/tcg/plugins/insn.c | 4 +--
tests/tcg/plugins/mem.c | 6 ++---
tests/tcg/plugins/syscall.c | 6 ++---
14 files changed, 93 insertions(+), 97 deletions(-)
--
2.39.5
- [PATCH 00/13] Fix 32-bit build for plugins,
Pierrick Bouvier <=
- [PATCH 01/13] plugins: change signature of qemu_plugin_insn_haddr, Pierrick Bouvier, 2024/12/16
- [PATCH 02/13] plugins: bump API version, Pierrick Bouvier, 2024/12/16
- [PATCH 04/13] contrib/plugins/howvec: ensure we don't regress if this plugin is extended, Pierrick Bouvier, 2024/12/16
- [PATCH 03/13] tests/tcg/plugins/insn: remove unused callback parameter, Pierrick Bouvier, 2024/12/16
- [PATCH 05/13] tests/tcg/plugins/syscall: fix 32-bit build, Pierrick Bouvier, 2024/12/16