On Thu, 5 Sept 2024 at 12:13, Alex Bennée <alex.bennee@xxxxxxxxxx> wrote: > > The existing plugins already liberally use host pointer stuffing for > passing user data which will fail when doing 64 bit guests on 32 bit > hosts. We should discourage this by officially deprecating support and > adding another nail to the 32 bit host coffin. > > Signed-off-by: Alex Bennée <alex.bennee@xxxxxxxxxx> > --- > docs/about/deprecated.rst | 11 +++++++++++ > configure | 11 ++++++++++- > 2 files changed, 21 insertions(+), 1 deletion(-) > > diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst > index 88f0f03786..8a4e249717 100644 > --- a/docs/about/deprecated.rst > +++ b/docs/about/deprecated.rst > @@ -184,6 +184,17 @@ be an effective use of its limited resources, and thus intends to discontinue > it. Since all recent x86 hardware from the past >10 years is capable of the > 64-bit x86 extensions, a corresponding 64-bit OS should be used instead. > > +TCG Plugin support not enabled by default on 32-bit hosts (since 9.2) > +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' > + > +While it is still possible to enable TCG plugin support for 32-bit > +hosts there are a number of potential pitfalls when instrumenting > +64-bit guests. The plugin APIs typically pass most addresses as > +uint64_t but practices like encoding that address in a host pointer > +for passing as user-data will loose data. As most software analysis "lose" > +benefits from having plenty of host memory it seems reasonable to > +encourage users to use 64 bit builds of QEMU for analysis work > +whatever targets they are instrumenting. > diff --git a/configure b/configure > index d08b71f14b..8acb311527 100755 > --- a/configure > +++ b/configure > @@ -424,6 +424,7 @@ fi > # Note that this case should only have supported host CPUs, not guests. > # Please keep it sorted and synchronized with meson.build's host_arch. > host_arch= > +host_bits=64 > linux_arch= > case "$cpu" in > aarch64) > @@ -434,12 +435,14 @@ case "$cpu" in > armv*b|armv*l|arm) > cpu=arm > host_arch=arm > + host_bits=32 > linux_arch=arm > ;; > > i386|i486|i586|i686) > cpu="i386" > host_arch=i386 > + host_bits=32 > linux_arch=x86 > CPU_CFLAGS="-m32" > ;; This is pretty awkward. We should only put stuff into this "switch per CPU architecture" where we absolutely cannot automatically determine it. Host bitness can be automatically determined (see what the compiler has set __SIZEOF_POINTER__ to), so we should do that. thanks -- PMM