Skip to content

Commit f991d61

Browse files
committed
Merge tag 'pull-jan-omnibus-020223-1' of https://gitlab.com/stsquad/qemu into staging
Testing, docs, semihosting and plugin updates - update playbooks for custom runners - add section timing support to gitlab - upgrade fedora images to 37 - purge perl from the build system and deps - disable unstable tests in CI - improve intro, emulation and semihosting docs - semihosting bug fix and O_BINARY default - add memory-sve test - fix some races in qht - improve plugin handling of memory helpers - optimise plugin hooks - fix some plugin deadlocks - reduce win64-cross build time by dropping some targets # -----BEGIN PGP SIGNATURE----- # # iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAmPb3fgACgkQ+9DbCVqe # KkQbXAf9Eoc+PdNvafbqzH/blPjvd9ve8pJ+GcPDukNXwxP8OF/jFEJUQ1E7l9O7 # y0qV4akKCdIqVice4R5bK2CAq44Y3aut8SDf56C8E3Riha2zA2RbQWOv/zCvA3OP # LFF+OaXZyg4JTR48HUKzh9ei2bd1+ccBSUe+xlRi59XaV5K8+5bmcZj10QKUR0lD # 0HC5auEWWpayvd5D7Da15C7+oVY3LMCFxSdpHwbuIPPan/TRo5yqMI6ChYDKB8QD # gdwMCL8znj2ADCTBftyBDYDAtjKVyLQidf7KdQHiSF+nmXYopS6SbsPCOMtJqCMH # tXcKAIxs/MEntPrWTKTdtdnzotJVKw== # =AtfN # -----END PGP SIGNATURE----- # gpg: Signature made Thu 02 Feb 2023 15:59:52 GMT # gpg: using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44 # gpg: Good signature from "Alex Bennée (Master Work Key) <[email protected]>" [full] # Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44 * tag 'pull-jan-omnibus-020223-1' of https://gitlab.com/stsquad/qemu: (36 commits) gitlab: cut even more from cross-win64-system build plugins: Iterate on cb_lists in qemu_plugin_user_exit cpu-exec: assert that plugin_mem_cbs is NULL after execution tcg: exclude non-memory effecting helpers from instrumentation translator: always pair plugin_gen_insn_{start, end} calls plugins: fix optimization in plugin_gen_disable_mem_helpers plugins: make qemu_plugin_user_exit's locking order consistent with fork_start's util/qht: use striped locks under TSAN thread: de-const qemu_spin_destroy util/qht: add missing atomic_set(hashes[i]) cpu: free cpu->tb_jmp_cache with RCU tests/tcg: add memory-sve test for aarch64 semihosting: add O_BINARY flag in host_open for NT compatibility semihosting: Write back semihosting data before completion callback docs: add an introduction to the system docs semihosting: add semihosting section to the docs docs: add a new section to outline emulation support docs: add hotlinks to about preface text MAINTAINERS: Fix the entry for tests/tcg/nios2 gitlab: wrap up test results for custom runners ... Signed-off-by: Peter Maydell <[email protected]>
2 parents 387b2b5 + b3ca964 commit f991d61

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+754
-273
lines changed

.gitlab-ci.d/base.yml

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
# most restrictive to least restrictive
77
#
88
.base_job_template:
9+
variables:
10+
# Each script line from will be in a collapsible section in the job output
11+
# and show the duration of each line.
12+
FF_SCRIPT_SECTIONS: 1
13+
914
rules:
1015
#############################################################
1116
# Stage 1: exclude scenarios where we definitely don't

.gitlab-ci.d/buildtest.yml

+1
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ build-oss-fuzz:
510510
IMAGE: fedora
511511
script:
512512
- mkdir build-oss-fuzz
513+
- export LSAN_OPTIONS=suppressions=scripts/oss-fuzz/lsan_suppressions.txt
513514
- CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
514515
./scripts/oss-fuzz/build.sh
515516
- export ASAN_OPTIONS="fast_unwind_on_malloc=0"

.gitlab-ci.d/cirrus/freebsd-12.vars

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
1111
NINJA='/usr/local/bin/ninja'
1212
PACKAGING_COMMAND='pkg'
1313
PIP3='/usr/local/bin/pip-3.8'
14-
PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage cmocka ctags curl cyrus-sasl dbus diffutils dtc flex fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 json-c libepoxy libffi libgcrypt libjpeg-turbo libnfs libslirp libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py39-numpy py39-pillow py39-pip py39-sphinx py39-sphinx_rtd_theme py39-yaml python3 rpm2cpio sdl2 sdl2_image snappy sndio spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd'
14+
PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage cmocka ctags curl cyrus-sasl dbus diffutils dtc flex fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 json-c libepoxy libffi libgcrypt libjpeg-turbo libnfs libslirp libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv pixman pkgconf png py39-numpy py39-pillow py39-pip py39-sphinx py39-sphinx_rtd_theme py39-yaml python3 rpm2cpio sdl2 sdl2_image snappy sndio spice-protocol tesseract usbredir virglrenderer vte3 zstd'
1515
PYPI_PKGS=''
1616
PYTHON='/usr/local/bin/python3'

.gitlab-ci.d/cirrus/freebsd-13.vars

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
1111
NINJA='/usr/local/bin/ninja'
1212
PACKAGING_COMMAND='pkg'
1313
PIP3='/usr/local/bin/pip-3.8'
14-
PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage cmocka ctags curl cyrus-sasl dbus diffutils dtc flex fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 json-c libepoxy libffi libgcrypt libjpeg-turbo libnfs libslirp libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py39-numpy py39-pillow py39-pip py39-sphinx py39-sphinx_rtd_theme py39-yaml python3 rpm2cpio sdl2 sdl2_image snappy sndio spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd'
14+
PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage cmocka ctags curl cyrus-sasl dbus diffutils dtc flex fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 json-c libepoxy libffi libgcrypt libjpeg-turbo libnfs libslirp libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv pixman pkgconf png py39-numpy py39-pillow py39-pip py39-sphinx py39-sphinx_rtd_theme py39-yaml python3 rpm2cpio sdl2 sdl2_image snappy sndio spice-protocol tesseract usbredir virglrenderer vte3 zstd'
1515
PYPI_PKGS=''
1616
PYTHON='/usr/local/bin/python3'

.gitlab-ci.d/cirrus/macos-12.vars

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ MAKE='/opt/homebrew/bin/gmake'
1111
NINJA='/opt/homebrew/bin/ninja'
1212
PACKAGING_COMMAND='brew'
1313
PIP3='/opt/homebrew/bin/pip3'
14-
PKGS='bash bc bison bzip2 capstone ccache cmocka ctags curl dbus diffutils dtc flex gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo json-c libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb llvm lzo make meson ncurses nettle ninja perl pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy sparse spice-protocol tesseract texinfo usbredir vde vte3 zlib zstd'
14+
PKGS='bash bc bison bzip2 capstone ccache cmocka ctags curl dbus diffutils dtc flex gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo json-c libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb llvm lzo make meson ncurses nettle ninja pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy sparse spice-protocol tesseract usbredir vde vte3 zlib zstd'
1515
PYPI_PKGS='PyYAML numpy pillow sphinx sphinx-rtd-theme'
1616
PYTHON='/opt/homebrew/bin/python3'

.gitlab-ci.d/crossbuilds.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ cross-win64-system:
187187
job: win64-fedora-cross-container
188188
variables:
189189
IMAGE: fedora-win64-cross
190-
CROSS_SKIP_TARGETS: or1k-softmmu rx-softmmu sh4eb-softmmu sparc64-softmmu
190+
CROSS_SKIP_TARGETS: alpha-softmmu avr-softmmu hppa-softmmu
191+
m68k-softmmu microblazeel-softmmu nios2-softmmu
192+
or1k-softmmu rx-softmmu sh4eb-softmmu sparc64-softmmu
191193
tricore-softmmu xtensaeb-softmmu
192194
artifacts:
193195
paths:

.gitlab-ci.d/custom-runners.yml

+11
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@
1313
variables:
1414
GIT_STRATEGY: clone
1515

16+
# All custom runners can extend this template to upload the testlog
17+
# data as an artifact and also feed the junit report
18+
.custom_artifacts_template:
19+
artifacts:
20+
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
21+
expire_in: 7 days
22+
paths:
23+
- build/meson-logs/testlog.txt
24+
reports:
25+
junit: build/meson-logs/testlog.junit.xml
26+
1627
include:
1728
- local: '/.gitlab-ci.d/custom-runners/ubuntu-20.04-s390x.yml'
1829
- local: '/.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml'

.gitlab-ci.d/custom-runners/ubuntu-20.04-s390x.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# "Install basic packages to build QEMU on Ubuntu 20.04/20.04"
44

55
ubuntu-20.04-s390x-all-linux-static:
6+
extends: .custom_artifacts_template
67
needs: []
78
stage: build
89
tags:
@@ -19,12 +20,11 @@ ubuntu-20.04-s390x-all-linux-static:
1920
- ../configure --enable-debug --static --disable-system --disable-glusterfs --disable-libssh
2021
|| { cat config.log meson-logs/meson-log.txt; exit 1; }
2122
- make --output-sync -j`nproc`
23+
- make --output-sync check-tcg
2224
- make --output-sync -j`nproc` check
23-
|| { cat meson-logs/testlog.txt; exit 1; } ;
24-
- make --output-sync -j`nproc` check-tcg
25-
|| { cat meson-logs/testlog.txt; exit 1; } ;
2625

2726
ubuntu-20.04-s390x-all:
27+
extends: .custom_artifacts_template
2828
needs: []
2929
stage: build
3030
tags:
@@ -41,9 +41,9 @@ ubuntu-20.04-s390x-all:
4141
|| { cat config.log meson-logs/meson-log.txt; exit 1; }
4242
- make --output-sync -j`nproc`
4343
- make --output-sync -j`nproc` check
44-
|| { cat meson-logs/testlog.txt; exit 1; } ;
4544

4645
ubuntu-20.04-s390x-alldbg:
46+
extends: .custom_artifacts_template
4747
needs: []
4848
stage: build
4949
tags:
@@ -64,9 +64,9 @@ ubuntu-20.04-s390x-alldbg:
6464
- make clean
6565
- make --output-sync -j`nproc`
6666
- make --output-sync -j`nproc` check
67-
|| { cat meson-logs/testlog.txt; exit 1; } ;
6867

6968
ubuntu-20.04-s390x-clang:
69+
extends: .custom_artifacts_template
7070
needs: []
7171
stage: build
7272
tags:
@@ -86,7 +86,6 @@ ubuntu-20.04-s390x-clang:
8686
|| { cat config.log meson-logs/meson-log.txt; exit 1; }
8787
- make --output-sync -j`nproc`
8888
- make --output-sync -j`nproc` check
89-
|| { cat meson-logs/testlog.txt; exit 1; } ;
9089

9190
ubuntu-20.04-s390x-tci:
9291
needs: []
@@ -109,6 +108,7 @@ ubuntu-20.04-s390x-tci:
109108
- make --output-sync -j`nproc`
110109

111110
ubuntu-20.04-s390x-notcg:
111+
extends: .custom_artifacts_template
112112
needs: []
113113
stage: build
114114
tags:
@@ -128,4 +128,3 @@ ubuntu-20.04-s390x-notcg:
128128
|| { cat config.log meson-logs/meson-log.txt; exit 1; }
129129
- make --output-sync -j`nproc`
130130
- make --output-sync -j`nproc` check
131-
|| { cat meson-logs/testlog.txt; exit 1; } ;

.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch32.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# "Install basic packages to build QEMU on Ubuntu 20.04"
44

55
ubuntu-22.04-aarch32-all:
6+
extends: .custom_artifacts_template
67
needs: []
78
stage: build
89
tags:
@@ -22,4 +23,3 @@ ubuntu-22.04-aarch32-all:
2223
|| { cat config.log meson-logs/meson-log.txt; exit 1; }
2324
- make --output-sync -j`nproc --ignore=40`
2425
- make --output-sync -j`nproc --ignore=40` check
25-
|| { cat meson-logs/testlog.txt; exit 1; } ;

.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml

+7-8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# "Install basic packages to build QEMU on Ubuntu 20.04"
44

55
ubuntu-22.04-aarch64-all-linux-static:
6+
extends: .custom_artifacts_template
67
needs: []
78
stage: build
89
tags:
@@ -19,12 +20,11 @@ ubuntu-22.04-aarch64-all-linux-static:
1920
- ../configure --enable-debug --static --disable-system --disable-pie
2021
|| { cat config.log meson-logs/meson-log.txt; exit 1; }
2122
- make --output-sync -j`nproc --ignore=40`
23+
- make check-tcg
2224
- make --output-sync -j`nproc --ignore=40` check
23-
|| { cat meson-logs/testlog.txt; exit 1; } ;
24-
- make --output-sync -j`nproc --ignore=40` check-tcg
25-
|| { cat meson-logs/testlog.txt; exit 1; } ;
2625

2726
ubuntu-22.04-aarch64-all:
27+
extends: .custom_artifacts_template
2828
needs: []
2929
stage: build
3030
tags:
@@ -44,9 +44,9 @@ ubuntu-22.04-aarch64-all:
4444
|| { cat config.log meson-logs/meson-log.txt; exit 1; }
4545
- make --output-sync -j`nproc --ignore=40`
4646
- make --output-sync -j`nproc --ignore=40` check
47-
|| { cat meson-logs/testlog.txt; exit 1; } ;
4847

4948
ubuntu-22.04-aarch64-alldbg:
49+
extends: .custom_artifacts_template
5050
needs: []
5151
stage: build
5252
tags:
@@ -63,9 +63,9 @@ ubuntu-22.04-aarch64-alldbg:
6363
- make clean
6464
- make --output-sync -j`nproc --ignore=40`
6565
- make --output-sync -j`nproc --ignore=40` check
66-
|| { cat meson-logs/testlog.txt; exit 1; } ;
6766

6867
ubuntu-22.04-aarch64-clang:
68+
extends: .custom_artifacts_template
6969
needs: []
7070
stage: build
7171
tags:
@@ -81,11 +81,10 @@ ubuntu-22.04-aarch64-clang:
8181
script:
8282
- mkdir build
8383
- cd build
84-
- ../configure --disable-libssh --cc=clang-10 --cxx=clang++-10 --enable-sanitizers
84+
- ../configure --disable-libssh --cc=clang --cxx=clang++ --enable-sanitizers
8585
|| { cat config.log meson-logs/meson-log.txt; exit 1; }
8686
- make --output-sync -j`nproc --ignore=40`
8787
- make --output-sync -j`nproc --ignore=40` check
88-
|| { cat meson-logs/testlog.txt; exit 1; } ;
8988

9089
ubuntu-22.04-aarch64-tci:
9190
needs: []
@@ -108,6 +107,7 @@ ubuntu-22.04-aarch64-tci:
108107
- make --output-sync -j`nproc --ignore=40`
109108

110109
ubuntu-22.04-aarch64-notcg:
110+
extends: .custom_artifacts_template
111111
needs: []
112112
stage: build
113113
tags:
@@ -127,4 +127,3 @@ ubuntu-22.04-aarch64-notcg:
127127
|| { cat config.log meson-logs/meson-log.txt; exit 1; }
128128
- make --output-sync -j`nproc --ignore=40`
129129
- make --output-sync -j`nproc --ignore=40` check
130-
|| { cat meson-logs/testlog.txt; exit 1; } ;

.gitlab-ci.d/windows.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ msys2-64bit:
7171
# for the msys2 64-bit job, due to the build could not complete within
7272
# the project timeout.
7373
- ..\msys64\usr\bin\bash -lc '../configure --target-list=x86_64-softmmu
74-
--without-default-devices --disable-opengl'
74+
--without-default-devices'
7575
- ..\msys64\usr\bin\bash -lc 'make'
7676
# qTests don't run successfully with "--without-default-devices",
7777
# so let's exclude the qtests from CI for now.
@@ -113,8 +113,7 @@ msys2-32bit:
113113
- $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink
114114
- mkdir output
115115
- cd output
116-
- ..\msys64\usr\bin\bash -lc '../configure --target-list=ppc64-softmmu
117-
--disable-opengl'
116+
- ..\msys64\usr\bin\bash -lc '../configure --target-list=ppc64-softmmu'
118117
- ..\msys64\usr\bin\bash -lc 'make'
119118
- ..\msys64\usr\bin\bash -lc 'make check MTESTARGS=\"--no-suite qtest\" ||
120119
{ cat meson-logs/testlog.txt; exit 1; }'

MAINTAINERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ F: target/microblaze/
240240
F: hw/microblaze/
241241
F: disas/microblaze.c
242242
F: tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh
243-
F: tests/tcg/nios2/Makefile.target
244243

245244
MIPS TCG CPUs
246245
M: Philippe Mathieu-Daudé <[email protected]>
@@ -262,6 +261,7 @@ F: hw/nios2/
262261
F: disas/nios2.c
263262
F: configs/devices/nios2-softmmu/default.mak
264263
F: tests/docker/dockerfiles/debian-nios2-cross.d/build-toolchain.sh
264+
F: tests/tcg/nios2/
265265

266266
OpenRISC TCG CPUs
267267
M: Stafford Horne <[email protected]>

accel/tcg/cpu-exec.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ static void cpu_exec_exit(CPUState *cpu)
504504
if (cc->tcg_ops->cpu_exec_exit) {
505505
cc->tcg_ops->cpu_exec_exit(cpu);
506506
}
507+
QEMU_PLUGIN_ASSERT(cpu->plugin_mem_cbs == NULL);
507508
}
508509

509510
void cpu_exec_step_atomic(CPUState *cpu)
@@ -980,6 +981,7 @@ cpu_exec_loop(CPUState *cpu, SyncClocks *sc)
980981

981982
cpu_loop_exec_tb(cpu, tb, pc, &last_tb, &tb_exit);
982983

984+
QEMU_PLUGIN_ASSERT(cpu->plugin_mem_cbs == NULL);
983985
/* Try to align the host and virtual clocks
984986
if the guest is in advance */
985987
align_clocks(sc, cpu);
@@ -1064,13 +1066,12 @@ void tcg_exec_realizefn(CPUState *cpu, Error **errp)
10641066
/* undo the initializations in reverse order */
10651067
void tcg_exec_unrealizefn(CPUState *cpu)
10661068
{
1067-
qemu_plugin_vcpu_exit_hook(cpu);
10681069
#ifndef CONFIG_USER_ONLY
10691070
tcg_iommu_free_notifier_list(cpu);
10701071
#endif /* !CONFIG_USER_ONLY */
10711072

10721073
tlb_destroy(cpu);
1073-
g_free(cpu->tb_jmp_cache);
1074+
g_free_rcu(cpu->tb_jmp_cache, rcu);
10741075
}
10751076

10761077
#ifndef CONFIG_USER_ONLY

accel/tcg/plugin-gen.c

+18-8
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,8 @@ static void inject_mem_helper(TCGOp *begin_op, GArray *arr)
579579
* is possible that the code we generate after the instruction is
580580
* dead, we also add checks before generating tb_exit etc.
581581
*/
582-
static void inject_mem_enable_helper(struct qemu_plugin_insn *plugin_insn,
582+
static void inject_mem_enable_helper(struct qemu_plugin_tb *ptb,
583+
struct qemu_plugin_insn *plugin_insn,
583584
TCGOp *begin_op)
584585
{
585586
GArray *cbs[2];
@@ -599,6 +600,7 @@ static void inject_mem_enable_helper(struct qemu_plugin_insn *plugin_insn,
599600
rm_ops(begin_op);
600601
return;
601602
}
603+
ptb->mem_helper = true;
602604

603605
arr = g_array_sized_new(false, false,
604606
sizeof(struct qemu_plugin_dyn_cb), n_cbs);
@@ -626,15 +628,22 @@ void plugin_gen_disable_mem_helpers(void)
626628
{
627629
TCGv_ptr ptr;
628630

629-
if (likely(tcg_ctx->plugin_insn == NULL ||
630-
!tcg_ctx->plugin_insn->mem_helper)) {
631+
/*
632+
* We could emit the clearing unconditionally and be done. However, this can
633+
* be wasteful if for instance plugins don't track memory accesses, or if
634+
* most TBs don't use helpers. Instead, emit the clearing iff the TB calls
635+
* helpers that might access guest memory.
636+
*
637+
* Note: we do not reset plugin_tb->mem_helper here; a TB might have several
638+
* exit points, and we want to emit the clearing from all of them.
639+
*/
640+
if (!tcg_ctx->plugin_tb->mem_helper) {
631641
return;
632642
}
633643
ptr = tcg_const_ptr(NULL);
634644
tcg_gen_st_ptr(ptr, cpu_env, offsetof(CPUState, plugin_mem_cbs) -
635645
offsetof(ArchCPU, env));
636646
tcg_temp_free_ptr(ptr);
637-
tcg_ctx->plugin_insn->mem_helper = false;
638647
}
639648

640649
static void plugin_gen_tb_udata(const struct qemu_plugin_tb *ptb,
@@ -682,14 +691,14 @@ static void plugin_gen_mem_inline(const struct qemu_plugin_tb *ptb,
682691
inject_inline_cb(cbs, begin_op, op_rw);
683692
}
684693

685-
static void plugin_gen_enable_mem_helper(const struct qemu_plugin_tb *ptb,
694+
static void plugin_gen_enable_mem_helper(struct qemu_plugin_tb *ptb,
686695
TCGOp *begin_op, int insn_idx)
687696
{
688697
struct qemu_plugin_insn *insn = g_ptr_array_index(ptb->insns, insn_idx);
689-
inject_mem_enable_helper(insn, begin_op);
698+
inject_mem_enable_helper(ptb, insn, begin_op);
690699
}
691700

692-
static void plugin_gen_disable_mem_helper(const struct qemu_plugin_tb *ptb,
701+
static void plugin_gen_disable_mem_helper(struct qemu_plugin_tb *ptb,
693702
TCGOp *begin_op, int insn_idx)
694703
{
695704
struct qemu_plugin_insn *insn = g_ptr_array_index(ptb->insns, insn_idx);
@@ -750,7 +759,7 @@ static void pr_ops(void)
750759
#endif
751760
}
752761

753-
static void plugin_gen_inject(const struct qemu_plugin_tb *plugin_tb)
762+
static void plugin_gen_inject(struct qemu_plugin_tb *plugin_tb)
754763
{
755764
TCGOp *op;
756765
int insn_idx = -1;
@@ -870,6 +879,7 @@ bool plugin_gen_tb_start(CPUState *cpu, const DisasContextBase *db,
870879
ptb->haddr1 = db->host_addr[0];
871880
ptb->haddr2 = NULL;
872881
ptb->mem_only = mem_only;
882+
ptb->mem_helper = false;
873883

874884
plugin_gen_empty_callback(PLUGIN_GEN_FROM_TB);
875885
}

accel/tcg/plugin-helpers.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#ifdef CONFIG_PLUGIN
2-
DEF_HELPER_FLAGS_2(plugin_vcpu_udata_cb, TCG_CALL_NO_RWG, void, i32, ptr)
3-
DEF_HELPER_FLAGS_4(plugin_vcpu_mem_cb, TCG_CALL_NO_RWG, void, i32, i32, i64, ptr)
2+
DEF_HELPER_FLAGS_2(plugin_vcpu_udata_cb, TCG_CALL_NO_RWG | TCG_CALL_PLUGIN, void, i32, ptr)
3+
DEF_HELPER_FLAGS_4(plugin_vcpu_mem_cb, TCG_CALL_NO_RWG | TCG_CALL_PLUGIN, void, i32, i32, i64, ptr)
44
#endif

accel/tcg/tb-jmp-cache.h

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* a load_acquire/store_release to 'tb'.
1919
*/
2020
struct CPUJumpCache {
21+
struct rcu_head rcu;
2122
struct {
2223
TranslationBlock *tb;
2324
#if TARGET_TB_PCREL

0 commit comments

Comments
 (0)