diff mbox series

[PULL,32/40] tcg/plugins: enable by default for most TCG builds

Message ID 20210712122653.11354-33-alex.bennee@linaro.org
State Superseded
Headers show
Series testing and plugin updates | expand

Commit Message

Alex Bennée July 12, 2021, 12:26 p.m. UTC
Aside from a minor bloat to file size the ability to have TCG plugins
has no real impact on performance unless a plugin is actively loaded.
Even then the libempty.so plugin shows only a minor degradation in
performance caused by the extra book keeping the TCG has to do to keep
track of instructions. As it's a useful feature lets just enable it by
default and reduce our testing matrix a little.

We need to move our linker testing earlier so we can be sure we can
enable the loader module required. As we have ruled out static &
plugins in an earlier patch we can also reduce the indent a little.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Reviewed-by: Thomas Huth <thuth@redhat.com>

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Cc: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210709143005.1554-33-alex.bennee@linaro.org>

-- 
2.20.1

Comments

Christian Borntraeger July 16, 2021, 6:54 a.m. UTC | #1
On 12.07.21 14:26, Alex Bennée wrote:
> Aside from a minor bloat to file size the ability to have TCG plugins

> has no real impact on performance unless a plugin is actively loaded.

> Even then the libempty.so plugin shows only a minor degradation in

> performance caused by the extra book keeping the TCG has to do to keep

> track of instructions. As it's a useful feature lets just enable it by

> default and reduce our testing matrix a little.

> 

> We need to move our linker testing earlier so we can be sure we can

> enable the loader module required. As we have ruled out static &

> plugins in an earlier patch we can also reduce the indent a little.

> 

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> Reviewed-by: Thomas Huth <thuth@redhat.com>

> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

> Cc: Paolo Bonzini <pbonzini@redhat.com>

> Message-Id: <20210709143005.1554-33-alex.bennee@linaro.org>



I cant reproduce it manually but in our build regression this fails with

     [769/2895] Linking target tests/plugin/libempty.so
     FAILED: tests/plugin/libempty.so
     cc  -o tests/plugin/libempty.so tests/plugin/libempty.so.p/empty.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libempty.so -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -m64 -Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now -O2 -g -fPIE -DPIE -fstack-protector-strong -Wl,--export-dynamic -pthread -lgmodule-2.0 -lglib-2.0 -Wl,--end-group
     /usr/bin/ld: /usr/lib/gcc/s390x-linux-gnu/9/../../../s390x-linux-gnu/Scrt1.o: in function `_start':
     (.text+0x34): undefined reference to `main'
     /usr/bin/ld: tests/plugin/libempty.so.p/empty.c.o: in function `qemu_plugin_install':
     build/../tests/plugin/empty.c:30: undefined reference to `qemu_plugin_register_vcpu_tb_trans_cb'
     collect2: error: ld returned 1 exit status
     [770/2895] Generating edk2-arm-vars.fd with a meson_exe.py custom command
     [771/2895] Generating edk2-aarch64-code.fd with a meson_exe.py custom command
     [772/2895] Generating edk2-arm-code.fd with a meson_exe.py custom command
     [773/2895] Linking static target tests/fp/libsoftfloat.a
     [774/2895] Compiling C object tests/plugin/libinsn.so.p/insn.c.o
     [775/2895] Compiling C object tests/plugin/libsyscall.so.p/syscall.c.o
     [776/2895] Compiling C object tests/plugin/libmem.so.p/mem.c.o
     [777/2895] Compiling C object tests/plugin/libbb.so.p/bb.c.o
     [778/2895] Generating shared QAPI source files with a custom command
     [779/2895] Compiling C object libcapstone.a.p/capstone_arch_X86_X86DisassemblerDecoder.c.o
     [780/2895] Compiling C object libcapstone.a.p/capstone_arch_SystemZ_SystemZDisassembler.c.o
     ninja: build stopped: subcommand failed.
     make: *** [Makefile:154: run-ninja] Error 1


Not sure yet why and why I cant reproduce manually.
Christian Borntraeger July 16, 2021, 11:28 a.m. UTC | #2
On 16.07.21 08:54, Christian Borntraeger wrote:
> 

> On 12.07.21 14:26, Alex Bennée wrote:

>> Aside from a minor bloat to file size the ability to have TCG plugins

>> has no real impact on performance unless a plugin is actively loaded.

>> Even then the libempty.so plugin shows only a minor degradation in

>> performance caused by the extra book keeping the TCG has to do to keep

>> track of instructions. As it's a useful feature lets just enable it by

>> default and reduce our testing matrix a little.

>>

>> We need to move our linker testing earlier so we can be sure we can

>> enable the loader module required. As we have ruled out static &

>> plugins in an earlier patch we can also reduce the indent a little.

>>

>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

>> Reviewed-by: Thomas Huth <thuth@redhat.com>

>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

>> Cc: Paolo Bonzini <pbonzini@redhat.com>

>> Message-Id: <20210709143005.1554-33-alex.bennee@linaro.org>

> 

> 

> I cant reproduce it manually but in our build regression this fails with


I can now reproduce when adding
  --extra-ldflags="-Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now"
to the configure script (on "20.04.2 LTS)


----snip---
   GIT     ui/keycodemapdb meson tests/fp/berkeley-testfloat-3 tests/fp/berkeley-softfloat-3 capstone slirp roms/SLOF
[1/1472] Linking target tests/plugin/libempty.so
FAILED: tests/plugin/libempty.so
cc  -o tests/plugin/libempty.so tests/plugin/libempty.so.p/empty.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libempty.so -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -m64 -Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now -O2 -g -fPIE -DPIE -fstack-protector-strong -Wl,--export-dynamic -pthread -lgmodule-2.0 -lglib-2.0 -Wl,--end-group
/usr/bin/ld: /usr/lib/gcc/s390x-linux-gnu/9/../../../s390x-linux-gnu/Scrt1.o: in function `_start':
(.text+0x34): undefined reference to `main'
/usr/bin/ld: tests/plugin/libempty.so.p/empty.c.o: in function `qemu_plugin_install':
/home/cborntra/REPOS/qemu/build/../tests/plugin/empty.c:30: undefined reference to `qemu_plugin_register_vcpu_tb_trans_cb'
collect2: error: ld returned 1 exit status
[2/1472] Linking target tests/plugin/libsyscall.so
FAILED: tests/plugin/libsyscall.so
cc  -o tests/plugin/libsyscall.so tests/plugin/libsyscall.so.p/syscall.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libsyscall.so -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -m64 -Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now -O2 -g -fPIE -DPIE -fstack-protector-strong -Wl,--export-dynamic -pthread -lgmodule-2.0 -lglib-2.0 -Wl,--end-group
/usr/bin/ld: /usr/lib/gcc/s390x-linux-gnu/9/../../../s390x-linux-gnu/Scrt1.o: in function `_start':
(.text+0x34): undefined reference to `main'
/usr/bin/ld: tests/plugin/libsyscall.so.p/syscall.c.o: in function `print_entry':
/home/cborntra/REPOS/qemu/build/../tests/plugin/syscall.c:88: undefined reference to `qemu_plugin_outs'
/usr/bin/ld: tests/plugin/libsyscall.so.p/syscall.c.o: in function `plugin_exit':
/home/cborntra/REPOS/qemu/build/../tests/plugin/syscall.c:109: undefined reference to `qemu_plugin_outs'
/usr/bin/ld: tests/plugin/libsyscall.so.p/syscall.c.o: in function `vcpu_syscall_ret':
/home/cborntra/REPOS/qemu/build/../tests/plugin/syscall.c:76: undefined reference to `qemu_plugin_outs'
/usr/bin/ld: tests/plugin/libsyscall.so.p/syscall.c.o: in function `vcpu_syscall':
/home/cborntra/REPOS/qemu/build/../tests/plugin/syscall.c:55: undefined reference to `qemu_plugin_outs'
/usr/bin/ld: tests/plugin/libsyscall.so.p/syscall.c.o: in function `qemu_plugin_install':
/home/cborntra/REPOS/qemu/build/../tests/plugin/syscall.c:133: undefined reference to `qemu_plugin_register_vcpu_syscall_cb'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/syscall.c:134: undefined reference to `qemu_plugin_register_vcpu_syscall_ret_cb'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/syscall.c:135: undefined reference to `qemu_plugin_register_atexit_cb'
collect2: error: ld returned 1 exit status
[3/1472] Linking target tests/plugin/libinsn.so
FAILED: tests/plugin/libinsn.so
cc  -o tests/plugin/libinsn.so tests/plugin/libinsn.so.p/insn.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libinsn.so -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -m64 -Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now -O2 -g -fPIE -DPIE -fstack-protector-strong -Wl,--export-dynamic -pthread -lgmodule-2.0 -lglib-2.0 -Wl,--end-group
/usr/bin/ld: /usr/lib/gcc/s390x-linux-gnu/9/../../../s390x-linux-gnu/Scrt1.o: in function `_start':
(.text+0x34): undefined reference to `main'
/usr/bin/ld: tests/plugin/libinsn.so.p/insn.c.o: in function `plugin_exit':
/home/cborntra/REPOS/qemu/build/../tests/plugin/insn.c:58: undefined reference to `qemu_plugin_outs'
/usr/bin/ld: tests/plugin/libinsn.so.p/insn.c.o: in function `vcpu_insn_exec_before':
/home/cborntra/REPOS/qemu/build/../tests/plugin/insn.c:29: undefined reference to `qemu_plugin_outs'
/usr/bin/ld: tests/plugin/libinsn.so.p/insn.c.o: in function `vcpu_tb_trans':
/home/cborntra/REPOS/qemu/build/../tests/plugin/insn.c:37: undefined reference to `qemu_plugin_tb_n_insns'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/insn.c:41: undefined reference to `qemu_plugin_tb_get_insn'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/insn.c:44: undefined reference to `qemu_plugin_register_vcpu_insn_exec_inline'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/insn.c:47: undefined reference to `qemu_plugin_insn_vaddr'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/insn.c:48: undefined reference to `qemu_plugin_register_vcpu_insn_exec_cb'
/usr/bin/ld: tests/plugin/libinsn.so.p/insn.c.o: in function `qemu_plugin_install':
/home/cborntra/REPOS/qemu/build/../tests/plugin/insn.c:69: undefined reference to `qemu_plugin_register_vcpu_tb_trans_cb'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/insn.c:70: undefined reference to `qemu_plugin_register_atexit_cb'
collect2: error: ld returned 1 exit status
[4/1472] Linking target tests/plugin/libmem.so
FAILED: tests/plugin/libmem.so
cc  -o tests/plugin/libmem.so tests/plugin/libmem.so.p/mem.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libmem.so -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -m64 -Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now -O2 -g -fPIE -DPIE -fstack-protector-strong -Wl,--export-dynamic -pthread -lgmodule-2.0 -lglib-2.0 -Wl,--end-group
/usr/bin/ld: /usr/lib/gcc/s390x-linux-gnu/9/../../../s390x-linux-gnu/Scrt1.o: in function `_start':
(.text+0x34): undefined reference to `main'
/usr/bin/ld: tests/plugin/libmem.so.p/mem.c.o: in function `plugin_exit':
/home/cborntra/REPOS/qemu/build/../tests/plugin/mem.c:39: undefined reference to `qemu_plugin_outs'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/mem.c:39: undefined reference to `qemu_plugin_outs'
/usr/bin/ld: tests/plugin/libmem.so.p/mem.c.o: in function `vcpu_tb_trans':
/home/cborntra/REPOS/qemu/build/../tests/plugin/mem.c:60: undefined reference to `qemu_plugin_tb_n_insns'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/mem.c:64: undefined reference to `qemu_plugin_tb_get_insn'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/mem.c:72: undefined reference to `qemu_plugin_register_vcpu_mem_cb'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/mem.c:67: undefined reference to `qemu_plugin_register_vcpu_mem_inline'
/usr/bin/ld: tests/plugin/libmem.so.p/mem.c.o: in function `vcpu_mem':
/home/cborntra/REPOS/qemu/build/../tests/plugin/mem.c:47: undefined reference to `qemu_plugin_get_hwaddr'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/mem.c:48: undefined reference to `qemu_plugin_hwaddr_is_io'
/usr/bin/ld: tests/plugin/libmem.so.p/mem.c.o: in function `qemu_plugin_install':
/home/cborntra/REPOS/qemu/build/../tests/plugin/mem.c:109: undefined reference to `qemu_plugin_register_vcpu_tb_trans_cb'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/mem.c:110: undefined reference to `qemu_plugin_register_atexit_cb'
collect2: error: ld returned 1 exit status
[5/1472] Linking target tests/plugin/libbb.so
FAILED: tests/plugin/libbb.so
cc  -o tests/plugin/libbb.so tests/plugin/libbb.so.p/bb.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libbb.so -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -m64 -Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now -O2 -g -fPIE -DPIE -fstack-protector-strong -Wl,--export-dynamic -pthread -lgmodule-2.0 -lglib-2.0 -Wl,--end-group
/usr/bin/ld: /usr/lib/gcc/s390x-linux-gnu/9/../../../s390x-linux-gnu/Scrt1.o: in function `_start':
(.text+0x34): undefined reference to `main'
/usr/bin/ld: tests/plugin/libbb.so.p/bb.c.o: in function `plugin_exit':
/home/cborntra/REPOS/qemu/build/../tests/plugin/bb.c:55: undefined reference to `qemu_plugin_outs'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/bb.c:55: undefined reference to `qemu_plugin_outs'
/usr/bin/ld: tests/plugin/libbb.so.p/bb.c.o: in function `vcpu_tb_trans':
/home/cborntra/REPOS/qemu/build/../tests/plugin/bb.c:84: undefined reference to `qemu_plugin_tb_n_insns'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/bb.c:87: undefined reference to `qemu_plugin_register_vcpu_tb_exec_inline'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/bb.c:89: undefined reference to `qemu_plugin_register_vcpu_tb_exec_inline'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/bb.c:93: undefined reference to `qemu_plugin_register_vcpu_tb_exec_cb'
/usr/bin/ld: tests/plugin/libbb.so.p/bb.c.o: in function `vcpu_idle':
/home/cborntra/REPOS/qemu/build/../tests/plugin/bb.c:66: undefined reference to `qemu_plugin_outs'
/usr/bin/ld: tests/plugin/libbb.so.p/bb.c.o: in function `qemu_plugin_install':
/home/cborntra/REPOS/qemu/build/../tests/plugin/bb.c:134: undefined reference to `qemu_plugin_register_vcpu_tb_trans_cb'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/bb.c:135: undefined reference to `qemu_plugin_register_atexit_cb'
/usr/bin/ld: /home/cborntra/REPOS/qemu/build/../tests/plugin/bb.c:131: undefined reference to `qemu_plugin_register_vcpu_idle_cb'
collect2: error: ld returned 1 exit status
[6/1472] Generating qemu-version.h with a meson_exe.py custom command
ninja: build stopped: subcommand failed.
Alex Bennée July 16, 2021, 1:16 p.m. UTC | #3
Christian Borntraeger <borntraeger@de.ibm.com> writes:

> On 16.07.21 08:54, Christian Borntraeger wrote:

>> On 12.07.21 14:26, Alex Bennée wrote:

>>> Aside from a minor bloat to file size the ability to have TCG plugins

>>> has no real impact on performance unless a plugin is actively loaded.

>>> Even then the libempty.so plugin shows only a minor degradation in

>>> performance caused by the extra book keeping the TCG has to do to keep

>>> track of instructions. As it's a useful feature lets just enable it by

>>> default and reduce our testing matrix a little.

>>>

>>> We need to move our linker testing earlier so we can be sure we can

>>> enable the loader module required. As we have ruled out static &

>>> plugins in an earlier patch we can also reduce the indent a little.

>>>

>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

>>> Reviewed-by: Thomas Huth <thuth@redhat.com>

>>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

>>> Cc: Paolo Bonzini <pbonzini@redhat.com>

>>> Message-Id: <20210709143005.1554-33-alex.bennee@linaro.org>

>> I cant reproduce it manually but in our build regression this fails

>> with

>

> I can now reproduce when adding

>  --extra-ldflags="-Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now"

> to the configure script (on "20.04.2 LTS)


Whats your full configure line? And this is on the s390x-cloud machine?

-- 
Alex Bennée
Richard Henderson July 16, 2021, 2:51 p.m. UTC | #4
On 7/16/21 4:28 AM, Christian Borntraeger wrote:
>   --extra-ldflags="-Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now"


FWIW, -pie should not be buried in --extra-ldflags, but as --enable-pie on the normal 
configure line.


r~
Christian Borntraeger July 16, 2021, 2:58 p.m. UTC | #5
On 16.07.21 16:51, Richard Henderson wrote:
> On 7/16/21 4:28 AM, Christian Borntraeger wrote:

>>   --extra-ldflags="-Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now"


Full configure line is

../configure     --prefix=/usr     --libdir=/usr/lib64     --sysconfdir=/etc     --interp-prefix=/usr/qemu-%M     --localstatedir=/var     --libexecdir=/usr/libexec     --extra-ldflags="-Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now"     --extra-cflags="-O2 -g -fPIE -DPIE"     --enable-werror     --disable-strip     --disable-rbd     --disable-fdt        --disable-xen     --enable-kvm     --enable-trace-backend=log      --iasl=false     --target-list=s390x-softmmu,i386-softmmu,x86_64-softmmu,s390x-linux-user


> FWIW, -pie should not be buried in --extra-ldflags, but as --enable-pie on the normal configure line.


I picked that from the configure script of an older fedora qemu src rpm some years ago and I use that to do build checks.
Christian Borntraeger July 16, 2021, 3:31 p.m. UTC | #6
On 16.07.21 16:58, Christian Borntraeger wrote:
> 

> 

> On 16.07.21 16:51, Richard Henderson wrote:

>> On 7/16/21 4:28 AM, Christian Borntraeger wrote:

>>>   --extra-ldflags="-Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now"

> 

> Full configure line is

> 

> ../configure     --prefix=/usr     --libdir=/usr/lib64     --sysconfdir=/etc     --interp-prefix=/usr/qemu-%M     --localstatedir=/var     --libexecdir=/usr/libexec     --extra-ldflags="-Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now"     --extra-cflags="-O2 -g -fPIE -DPIE"     --enable-werror     --disable-strip     --disable-rbd     --disable-fdt        --disable-xen     --enable-kvm     --enable-trace-backend=log      --iasl=false     --target-list=s390x-softmmu,i386-softmmu,x86_64-softmmu,s390x-linux-user

> 

> 

>> FWIW, -pie should not be buried in --extra-ldflags, but as --enable-pie on the normal configure line.

> 

> I picked that from the configure script of an older fedora qemu src rpm some years ago and I use that to do build checks.


using enable-pie instead of burying it in the ldflags seems to fix things.
Question is do we still care about this regression?
Richard Henderson July 16, 2021, 4:02 p.m. UTC | #7
On 7/16/21 8:31 AM, Christian Borntraeger wrote:
> 

> 

> On 16.07.21 16:58, Christian Borntraeger wrote:

>>

>>

>> On 16.07.21 16:51, Richard Henderson wrote:

>>> On 7/16/21 4:28 AM, Christian Borntraeger wrote:

>>>>   --extra-ldflags="-Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now"

>>

>> Full configure line is

>>

>> ../configure     --prefix=/usr     --libdir=/usr/lib64     --sysconfdir=/etc     

>> --interp-prefix=/usr/qemu-%M     --localstatedir=/var     --libexecdir=/usr/libexec     

>> --extra-ldflags="-Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now"     --extra-cflags="-O2 -g 

>> -fPIE -DPIE"     --enable-werror     --disable-strip     --disable-rbd     

>> --disable-fdt        --disable-xen     --enable-kvm     --enable-trace-backend=log      

>> --iasl=false     --target-list=s390x-softmmu,i386-softmmu,x86_64-softmmu,s390x-linux-user

>>

>>

>>> FWIW, -pie should not be buried in --extra-ldflags, but as --enable-pie on the normal 

>>> configure line.

>>

>> I picked that from the configure script of an older fedora qemu src rpm some years ago 

>> and I use that to do build checks.

> 

> using enable-pie instead of burying it in the ldflags seems to fix things.

> Question is do we still care about this regression?


I don't think so.  Your incorrect ldflags (appropriate for the main executable, perhaps) 
was leaking into the shared library plugins, where -shared and -pie conflict.


r~
diff mbox series

Patch

diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst
index 18c6581d85..0cd77c77d2 100644
--- a/docs/devel/tcg-plugins.rst
+++ b/docs/devel/tcg-plugins.rst
@@ -71,7 +71,8 @@  API
 Usage
 =====
 
-The QEMU binary needs to be compiled for plugin support::
+Any QEMU binary with TCG support has plugins enabled by default.
+Earlier releases needed to be explicitly enabled with::
 
   configure --enable-plugins
 
diff --git a/configure b/configure
index 97ea6e6629..60358529fd 100755
--- a/configure
+++ b/configure
@@ -429,7 +429,7 @@  libxml2="auto"
 debug_mutex="no"
 libpmem="auto"
 default_devices="true"
-plugins="no"
+plugins="$default_feature"
 fuzzing="no"
 rng_none="no"
 secret_keyring="$default_feature"
@@ -2196,6 +2196,8 @@  if test "$static" = "yes" ; then
   fi
   if test "$plugins" = "yes"; then
     error_exit "static and plugins are mutually incompatible"
+  else
+    plugins="no"
   fi
 fi
 
@@ -3089,6 +3091,69 @@  for drv in $audio_drv_list; do
     esac
 done
 
+##########################################
+# plugin linker support probe
+
+if test "$plugins" != "no"; then
+
+    #########################################
+    # See if --dynamic-list is supported by the linker
+
+    ld_dynamic_list="no"
+    cat > $TMPTXT <<EOF
+{
+  foo;
+};
+EOF
+
+        cat > $TMPC <<EOF
+#include <stdio.h>
+void foo(void);
+
+void foo(void)
+{
+  printf("foo\n");
+}
+
+int main(void)
+{
+  foo();
+  return 0;
+}
+EOF
+
+    if compile_prog "" "-Wl,--dynamic-list=$TMPTXT" ; then
+        ld_dynamic_list="yes"
+    fi
+
+    #########################################
+    # See if -exported_symbols_list is supported by the linker
+
+    ld_exported_symbols_list="no"
+    cat > $TMPTXT <<EOF
+  _foo
+EOF
+
+    if compile_prog "" "-Wl,-exported_symbols_list,$TMPTXT" ; then
+        ld_exported_symbols_list="yes"
+    fi
+
+    if test "$ld_dynamic_list" = "no" &&
+       test "$ld_exported_symbols_list" = "no" ; then
+        if test "$plugins" = "yes"; then
+            error_exit \
+                "Plugin support requires dynamic linking and specifying a set of symbols " \
+                "that are exported to plugins. Unfortunately your linker doesn't " \
+                "support the flag (--dynamic-list or -exported_symbols_list) used " \
+                "for this purpose."
+        else
+            plugins="no"
+        fi
+    else
+        plugins="yes"
+    fi
+fi
+
 ##########################################
 # glib support probe
 
@@ -3097,7 +3162,7 @@  glib_modules=gthread-2.0
 if test "$modules" = yes; then
     glib_modules="$glib_modules gmodule-export-2.0"
 fi
-if test "$plugins" = yes; then
+if test "$plugins" = "yes"; then
     glib_modules="$glib_modules gmodule-2.0"
 fi
 
@@ -3935,61 +4000,6 @@  if compile_prog "" "" ; then
   atomic64=yes
 fi
 
-#########################################
-# See if --dynamic-list is supported by the linker
-ld_dynamic_list="no"
-if test "$static" = "no" ; then
-    cat > $TMPTXT <<EOF
-{
-  foo;
-};
-EOF
-
-    cat > $TMPC <<EOF
-#include <stdio.h>
-void foo(void);
-
-void foo(void)
-{
-  printf("foo\n");
-}
-
-int main(void)
-{
-  foo();
-  return 0;
-}
-EOF
-
-    if compile_prog "" "-Wl,--dynamic-list=$TMPTXT" ; then
-        ld_dynamic_list="yes"
-    fi
-fi
-
-#########################################
-# See if -exported_symbols_list is supported by the linker
-
-ld_exported_symbols_list="no"
-if test "$static" = "no" ; then
-    cat > $TMPTXT <<EOF
-  _foo
-EOF
-
-    if compile_prog "" "-Wl,-exported_symbols_list,$TMPTXT" ; then
-        ld_exported_symbols_list="yes"
-    fi
-fi
-
-if  test "$plugins" = "yes" &&
-    test "$ld_dynamic_list" = "no" &&
-    test "$ld_exported_symbols_list" = "no" ; then
-  error_exit \
-      "Plugin support requires dynamic linking and specifying a set of symbols " \
-      "that are exported to plugins. Unfortunately your linker doesn't " \
-      "support the flag (--dynamic-list or -exported_symbols_list) used " \
-      "for this purpose."
-fi
-
 ########################################
 # check if getauxval is available.
 
diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index d9b834c848..89df51517c 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -354,29 +354,6 @@  build-some-softmmu:
     TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
     MAKE_CHECK_ARGS: check-tcg
 
-# Run check-tcg against linux-user (with plugins)
-# we skip sparc64-linux-user until it has been fixed somewhat
-# we skip cris-linux-user as it doesn't use the common run loop
-build-user-plugins:
-  extends: .native_build_job_template
-  needs:
-    job: amd64-debian-user-cross-container
-  variables:
-    IMAGE: debian-all-test-cross
-    CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
-    MAKE_CHECK_ARGS: check-tcg
-  timeout: 1h 30m
-
-build-some-softmmu-plugins:
-  extends: .native_build_job_template
-  needs:
-    job: amd64-debian-user-cross-container
-  variables:
-    IMAGE: debian-all-test-cross
-    CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
-    TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
-    MAKE_CHECK_ARGS: check-tcg
-
 clang-system:
   extends: .native_build_job_template
   needs: