Skip to content

Commit bfd9a76

Browse files
committed
Merge remote-tracking branch 'remotes/stsquad/tags/pull-for-6.2-121021-2' into staging
Some testing and plugin updates: - don't override the test compiler when specified - split some multiarch tests by guest OS - add riscv64 docker image and cross-compile tests - drop release tarball test from Travis - skip check-patch on master repo - fix passing of TEST_TARGETS to cirrus - fix missing symbols in plugins - ensure s390x insn start ops precede plugin instrumentation - refactor plugin instruction boundary detection - update github repo lockdown - add a debian-native test image for multi-arch builds # gpg: Signature made Tue 12 Oct 2021 02:35:00 AM PDT # gpg: using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44 # gpg: Good signature from "Alex Bennée (Master Work Key) <[email protected]>" [full] * remotes/stsquad/tags/pull-for-6.2-121021-2: tests/docker: add a debian-native image and make available .github: move repo lockdown to the v2 configuration accel/tcg: re-factor plugin_inject_cb so we can assert insn_idx is valid target/s390x: move tcg_gen_insn_start to s390x_tr_insn_start plugins/: Add missing functions to symbol list gitlab: fix passing of TEST_TARGETS env to cirrus gitlab: skip the check-patch job on the upstream repo travis.yml: Remove the "Release tarball" job gitlab: Add cross-riscv64-system, cross-riscv64-user tests/docker: promote debian-riscv64-cross to a full image tests/tcg: move some multiarch files and make conditional tests/tcg/sha1: remove endian include configure: don't override the selected host test compiler if defined Signed-off-by: Richard Henderson <[email protected]>
2 parents 81d8537 + 1788874 commit bfd9a76

File tree

22 files changed

+271
-158
lines changed

22 files changed

+271
-158
lines changed

.github/lockdown.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/lockdown.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Configuration for Repo Lockdown - https://github.com/dessant/repo-lockdown
2+
3+
name: 'Repo Lockdown'
4+
5+
on:
6+
pull_request_target:
7+
types: opened
8+
9+
permissions:
10+
pull-requests: write
11+
12+
jobs:
13+
action:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: dessant/repo-lockdown@v2
17+
with:
18+
pull-comment: |
19+
Thank you for your interest in the QEMU project.
20+
21+
This repository is a read-only mirror of the project's repostories hosted
22+
on https://gitlab.com/qemu-project/qemu.git.
23+
The project does not process merge requests filed on GitHub.
24+
25+
QEMU welcomes contributions of code (either fixing bugs or adding new
26+
functionality). However, we get a lot of patches, and so we have some
27+
guidelines about contributing on the project website:
28+
https://www.qemu.org/contribute/
29+
lock-pull: true
30+
close-pull: true

.gitlab-ci.d/cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
-e "s|[@]PIP3@|$PIP3|g"
3636
-e "s|[@]PYPI_PKGS@|$PYPI_PKGS|g"
3737
-e "s|[@]CONFIGURE_ARGS@|$CONFIGURE_ARGS|g"
38-
-e "s|[@]TEST_TARGETSS@|$TEST_TARGETSS|g"
38+
-e "s|[@]TEST_TARGETS@|$TEST_TARGETS|g"
3939
<.gitlab-ci.d/cirrus/build.yml >.gitlab-ci.d/cirrus/$NAME.yml
4040
- cat .gitlab-ci.d/cirrus/$NAME.yml
4141
- cirrus-run -v --show-build-log always .gitlab-ci.d/cirrus/$NAME.yml

.gitlab-ci.d/cirrus/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ env:
1313
PYTHON: "@PYTHON@"
1414
MAKE: "@MAKE@"
1515
CONFIGURE_ARGS: "@CONFIGURE_ARGS@"
16+
TEST_TARGETS: "@TEST_TARGETS@"
1617

1718
build_task:
1819
install_script:

.gitlab-ci.d/container-cross.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ ppc64el-debian-cross-container:
134134
riscv64-debian-cross-container:
135135
extends: .container_job_template
136136
stage: containers-layer2
137-
needs: ['amd64-debian10-container']
137+
# as we are currently based on 'sid/unstable' we may break so...
138+
allow_failure: true
138139
variables:
139140
NAME: debian-riscv64-cross
140141

.gitlab-ci.d/crossbuilds.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,25 @@ cross-ppc64el-user:
124124
variables:
125125
IMAGE: debian-ppc64el-cross
126126

127+
# The riscv64 cross-builds currently use a 'sid' container to get
128+
# compilers and libraries. Until something more stable is found we
129+
# allow_failure so as not to block CI.
130+
cross-riscv64-system:
131+
extends: .cross_system_build_job
132+
allow_failure: true
133+
needs:
134+
job: riscv64-debian-cross-container
135+
variables:
136+
IMAGE: debian-riscv64-cross
137+
138+
cross-riscv64-user:
139+
extends: .cross_user_build_job
140+
allow_failure: true
141+
needs:
142+
job: riscv64-debian-cross-container
143+
variables:
144+
IMAGE: debian-riscv64-cross
145+
127146
cross-s390x-system:
128147
extends: .cross_system_build_job
129148
needs:

.gitlab-ci.d/static_checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ check-patch:
88
variables:
99
GIT_DEPTH: 1000
1010
rules:
11-
- if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
11+
- if: '$CI_PROJECT_NAMESPACE == "qemu-project"'
1212
when: never
1313
- when: on_success
1414
allow_failure: true

.travis.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -305,26 +305,3 @@ jobs:
305305
- CONFIG="--disable-containers --disable-tcg --enable-kvm
306306
--disable-tools --host-cc=clang --cxx=clang++"
307307
- UNRELIABLE=true
308-
309-
# Release builds
310-
# The make-release script expect a QEMU version, so our tag must start with a 'v'.
311-
# This is the case when release candidate tags are created.
312-
- name: "Release tarball"
313-
if: tag IS present AND tag =~ /^v\d+\.\d+(\.\d+)?(-\S*)?$/
314-
env:
315-
# We want to build from the release tarball
316-
- BUILD_DIR="release/build/dir" SRC_DIR="../../.."
317-
- BASE_CONFIG="--prefix=$PWD/dist"
318-
- CONFIG="--target-list=x86_64-softmmu,aarch64-softmmu,armeb-linux-user,ppc-linux-user"
319-
- TEST_CMD="make install -j${JOBS}"
320-
- QEMU_VERSION="${TRAVIS_TAG:1}"
321-
- CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
322-
script:
323-
- make -C ${SRC_DIR} qemu-${QEMU_VERSION}.tar.bz2
324-
- ls -l ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2
325-
- tar -xf ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2 && cd qemu-${QEMU_VERSION}
326-
- mkdir -p release-build && cd release-build
327-
- ../configure ${BASE_CONFIG} ${CONFIG} || { cat config.log meson-logs/meson-log.txt && exit 1; }
328-
- make install
329-
allow_failures:
330-
- env: UNRELIABLE=true

accel/tcg/plugin-gen.c

Lines changed: 85 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,7 @@ static void gen_empty_mem_helper(void)
162162
static void gen_plugin_cb_start(enum plugin_gen_from from,
163163
enum plugin_gen_cb type, unsigned wr)
164164
{
165-
TCGOp *op;
166-
167165
tcg_gen_plugin_cb_start(from, type, wr);
168-
op = tcg_last_op();
169-
QSIMPLEQ_INSERT_TAIL(&tcg_ctx->plugin_ops, op, plugin_link);
170166
}
171167

172168
static void gen_wrapped(enum plugin_gen_from from,
@@ -706,62 +702,6 @@ static void plugin_gen_disable_mem_helper(const struct qemu_plugin_tb *ptb,
706702
inject_mem_disable_helper(insn, begin_op);
707703
}
708704

709-
static void plugin_inject_cb(const struct qemu_plugin_tb *ptb, TCGOp *begin_op,
710-
int insn_idx)
711-
{
712-
enum plugin_gen_from from = begin_op->args[0];
713-
enum plugin_gen_cb type = begin_op->args[1];
714-
715-
switch (from) {
716-
case PLUGIN_GEN_FROM_TB:
717-
switch (type) {
718-
case PLUGIN_GEN_CB_UDATA:
719-
plugin_gen_tb_udata(ptb, begin_op);
720-
return;
721-
case PLUGIN_GEN_CB_INLINE:
722-
plugin_gen_tb_inline(ptb, begin_op);
723-
return;
724-
default:
725-
g_assert_not_reached();
726-
}
727-
case PLUGIN_GEN_FROM_INSN:
728-
switch (type) {
729-
case PLUGIN_GEN_CB_UDATA:
730-
plugin_gen_insn_udata(ptb, begin_op, insn_idx);
731-
return;
732-
case PLUGIN_GEN_CB_INLINE:
733-
plugin_gen_insn_inline(ptb, begin_op, insn_idx);
734-
return;
735-
case PLUGIN_GEN_ENABLE_MEM_HELPER:
736-
plugin_gen_enable_mem_helper(ptb, begin_op, insn_idx);
737-
return;
738-
default:
739-
g_assert_not_reached();
740-
}
741-
case PLUGIN_GEN_FROM_MEM:
742-
switch (type) {
743-
case PLUGIN_GEN_CB_MEM:
744-
plugin_gen_mem_regular(ptb, begin_op, insn_idx);
745-
return;
746-
case PLUGIN_GEN_CB_INLINE:
747-
plugin_gen_mem_inline(ptb, begin_op, insn_idx);
748-
return;
749-
default:
750-
g_assert_not_reached();
751-
}
752-
case PLUGIN_GEN_AFTER_INSN:
753-
switch (type) {
754-
case PLUGIN_GEN_DISABLE_MEM_HELPER:
755-
plugin_gen_disable_mem_helper(ptb, begin_op, insn_idx);
756-
return;
757-
default:
758-
g_assert_not_reached();
759-
}
760-
default:
761-
g_assert_not_reached();
762-
}
763-
}
764-
765705
/* #define DEBUG_PLUGIN_GEN_OPS */
766706
static void pr_ops(void)
767707
{
@@ -819,21 +759,95 @@ static void pr_ops(void)
819759
static void plugin_gen_inject(const struct qemu_plugin_tb *plugin_tb)
820760
{
821761
TCGOp *op;
822-
int insn_idx;
762+
int insn_idx = -1;
823763

824764
pr_ops();
825-
insn_idx = -1;
826-
QSIMPLEQ_FOREACH(op, &tcg_ctx->plugin_ops, plugin_link) {
827-
enum plugin_gen_from from = op->args[0];
828-
enum plugin_gen_cb type = op->args[1];
829-
830-
tcg_debug_assert(op->opc == INDEX_op_plugin_cb_start);
831-
/* ENABLE_MEM_HELPER is the first callback of an instruction */
832-
if (from == PLUGIN_GEN_FROM_INSN &&
833-
type == PLUGIN_GEN_ENABLE_MEM_HELPER) {
765+
766+
QTAILQ_FOREACH(op, &tcg_ctx->ops, link) {
767+
switch (op->opc) {
768+
case INDEX_op_insn_start:
834769
insn_idx++;
770+
break;
771+
case INDEX_op_plugin_cb_start:
772+
{
773+
enum plugin_gen_from from = op->args[0];
774+
enum plugin_gen_cb type = op->args[1];
775+
776+
switch (from) {
777+
case PLUGIN_GEN_FROM_TB:
778+
{
779+
g_assert(insn_idx == -1);
780+
781+
switch (type) {
782+
case PLUGIN_GEN_CB_UDATA:
783+
plugin_gen_tb_udata(plugin_tb, op);
784+
break;
785+
case PLUGIN_GEN_CB_INLINE:
786+
plugin_gen_tb_inline(plugin_tb, op);
787+
break;
788+
default:
789+
g_assert_not_reached();
790+
}
791+
break;
792+
}
793+
case PLUGIN_GEN_FROM_INSN:
794+
{
795+
g_assert(insn_idx >= 0);
796+
797+
switch (type) {
798+
case PLUGIN_GEN_CB_UDATA:
799+
plugin_gen_insn_udata(plugin_tb, op, insn_idx);
800+
break;
801+
case PLUGIN_GEN_CB_INLINE:
802+
plugin_gen_insn_inline(plugin_tb, op, insn_idx);
803+
break;
804+
case PLUGIN_GEN_ENABLE_MEM_HELPER:
805+
plugin_gen_enable_mem_helper(plugin_tb, op, insn_idx);
806+
break;
807+
default:
808+
g_assert_not_reached();
809+
}
810+
break;
811+
}
812+
case PLUGIN_GEN_FROM_MEM:
813+
{
814+
g_assert(insn_idx >= 0);
815+
816+
switch (type) {
817+
case PLUGIN_GEN_CB_MEM:
818+
plugin_gen_mem_regular(plugin_tb, op, insn_idx);
819+
break;
820+
case PLUGIN_GEN_CB_INLINE:
821+
plugin_gen_mem_inline(plugin_tb, op, insn_idx);
822+
break;
823+
default:
824+
g_assert_not_reached();
825+
}
826+
827+
break;
828+
}
829+
case PLUGIN_GEN_AFTER_INSN:
830+
{
831+
g_assert(insn_idx >= 0);
832+
833+
switch (type) {
834+
case PLUGIN_GEN_DISABLE_MEM_HELPER:
835+
plugin_gen_disable_mem_helper(plugin_tb, op, insn_idx);
836+
break;
837+
default:
838+
g_assert_not_reached();
839+
}
840+
break;
841+
}
842+
default:
843+
g_assert_not_reached();
844+
}
845+
break;
846+
}
847+
default:
848+
/* plugins don't care about any other ops */
849+
break;
835850
}
836-
plugin_inject_cb(plugin_tb, op, insn_idx);
837851
}
838852
pr_ops();
839853
}
@@ -846,7 +860,6 @@ bool plugin_gen_tb_start(CPUState *cpu, const TranslationBlock *tb, bool mem_onl
846860
if (test_bit(QEMU_PLUGIN_EV_VCPU_TB_TRANS, cpu->plugin_mask)) {
847861
ret = true;
848862

849-
QSIMPLEQ_INIT(&tcg_ctx->plugin_ops);
850863
ptb->vaddr = tb->pc;
851864
ptb->vaddr2 = -1;
852865
get_page_addr_code_hostp(cpu->env_ptr, tb->pc, &ptb->haddr1);

configure

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,8 +1686,10 @@ case "$cpu" in
16861686
# No special flags required for other host CPUs
16871687
esac
16881688

1689-
eval "cross_cc_${cpu}=\$cc"
1690-
cross_cc_vars="$cross_cc_vars cross_cc_${cpu}"
1689+
if eval test -z "\${cross_cc_$cpu}"; then
1690+
eval "cross_cc_${cpu}=\$cc"
1691+
cross_cc_vars="$cross_cc_vars cross_cc_${cpu}"
1692+
fi
16911693

16921694
# For user-mode emulation the host arch has to be one we explicitly
16931695
# support, even if we're using TCI.

0 commit comments

Comments
 (0)