From nobody Sat Apr 11 23:07:18 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1772743989; cv=none; d=zohomail.com; s=zohoarc; b=dDB8SJg9MZaCFP86FmZ5TibpWjuUv/L2twBMThYUwBBrmbnLhpqT0CRqEtBj9B6TT5vkaPQOoz6BFHcKGYhUgCeUz8ElO4F3EsO1SS38MxtWca1S6s3Jw7T1nVGssSyOUWWLmFOz2udDRS8o3eZL/8TXX37jnnkbUgz6pkiHe4o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772743989; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rd8M5nodG2RHn+UrDTOzLTrwNAgiU0HwN3M6Mlv5xCQ=; b=KaLDSJS28k4kcQoIPOtumWl9UJad5+jIN24f3R12s1PDbpFb3cjKUkskcncwWPKjkUK3cyk9JwIUH8RiCejfB0zS2lkKTVTw8Ihmv9msQK0D7Zcn39c9APvOlevdnYQYxpHiGuaNTasy+72g8DMNBOdCkhs/qlQMNmh/LlU6h0U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1772743989167535.4151888518259; Thu, 5 Mar 2026 12:53:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vyFg9-0006as-3d; Thu, 05 Mar 2026 15:52:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vyFg6-0006ZL-06 for qemu-devel@nongnu.org; Thu, 05 Mar 2026 15:52:14 -0500 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vyFg1-00066W-RQ for qemu-devel@nongnu.org; Thu, 05 Mar 2026 15:52:13 -0500 Received: by mail-qt1-x830.google.com with SMTP id d75a77b69052e-5069b3e0c66so127206691cf.1 for ; Thu, 05 Mar 2026 12:52:09 -0800 (PST) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-89a0e31b035sm65559396d6.17.2026.03.05.12.52.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2026 12:52:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1772743929; x=1773348729; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rd8M5nodG2RHn+UrDTOzLTrwNAgiU0HwN3M6Mlv5xCQ=; b=YyFW2chC5DnLJXtpsbFNPj3LBAh8F+ofeHtPAZi7guIiS4zBu0pySEvpdn5bISf6j6 FYzJpxZSViPCvTFmw1r6pCKCRmMbX23Y/reeyvUKlb2YwjyrET1iCMqjTAZ20fBLUXrZ bAmk8z4L9M6f73h/2UNDPaWa82fA2WRXqcKmiZwW9BA12T1ZI83SVuNtW7inJhtgOUKm a03opoEMnAeO3bowLiagmU+2naIsCAS07JBop2CKrROubEz1v7jpFxd/3ephkKErUmYn o6TOhz2kK7OVD6MPOcubxsZdEFaKlnXsUkR9O2VZeCu6GAhgmBhHGMDO5nyuKboESr+n 6+gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772743929; x=1773348729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=rd8M5nodG2RHn+UrDTOzLTrwNAgiU0HwN3M6Mlv5xCQ=; b=B+FpMWg2lwesVWTgJ2SoOpfGE07FOkgTIEMjNP9pe7tqwEoggydNaMaQpI1V7bH593 NYle2CFXfAbWNK4GTme06Mqz2aT3yT1rG//UjlcJTJD5d4W5QUn4UPAfewOZEyPzBO1a HPMloO4v1kNg5YwaMXfsgvSpVlRXOmADVxZalJEckywXYRLyLrwzp5YhQ9lvQZuiqD6s o1y6PVrVFu9kdFHPeFSTJBLSIJjTptxS5ogNqY+mAxdqvfAUjLXiTV9dmzDye7zG23zj oQVGQL5c0d5MILo0pZoNAkEmKawH1VpTnpALc2WKwDCjxVXLvhyzOUyGRzD+dTLeHect +0FA== X-Gm-Message-State: AOJu0YyeKvb45hWpjBClrju/appiuaPB0wD5PPDMq00/dWDE4sp4tQqJ gFrLyGHF3BE5Yj+1/TPOH2moqc1eNR92uCJ9hKHP/yzQnYsfeuVQXGEr9f7aXrrLI013rjxkNbH WT1SI X-Gm-Gg: ATEYQzwmwPTEL71D/TpleZd9ON7rvxunj5lq8+wOAlzKyDPUVAvPBqFXyaHNVFzHlS8 +TfkOcSa5LaMdAVgmjluMfMj+n5QZl2Vw2MPBUVeRwdI/6AUgkiYgQN7kfmxT0NOF7acS1FTxZ8 roq8jA5pHkl8H4Fei4nr8hvmRXgt/S6/vm/IpWkr1yUsVSiiVedmX80rSK8BmTPbnUzzpxfzdAD ZCKo3mCy0i4Pndu/MOeGQAkonWQUxBJGtFt6ZbKyN5tVAMmQk9QH+GXDPoXJXm1fCQU9bLDt0Sv DD/sQik2fjmzColpQX15HjOj5UpgIahLSOJDlj0a/rzl4gbqqsNq9Kh3rMhaEqaK3OQOW5FSIXr uuu8uHxCuYBp+/nTqsDY+DBQIKEXUak5/9yklGHkVZmQ40v2cpgtnGXr6IQFGe0nNAnAfDeBT5f +hb1o+JVnSsPwHXRHTs72nNfyJvCfklEZV0hOilbP4zkFSA6VQkClMIVlfOXRfYrxcFxYEtHTAs Kcw X-Received: by 2002:a05:622a:292:b0:505:e529:11e9 with SMTP id d75a77b69052e-508e69b9239mr49038901cf.36.1772743928511; Thu, 05 Mar 2026 12:52:08 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org, peter.maydell@linaro.org, richard.henderson@linaro.org, pbonzini@redhat.com, stefanha@redhat.com Cc: pierrick.bouvier@linaro.org Subject: [PULL 05/12] tests/tcg: add tests for qemu_plugin_set_pc API Date: Thu, 5 Mar 2026 12:51:45 -0800 Message-ID: <20260305205152.2121854-6-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260305205152.2121854-1-pierrick.bouvier@linaro.org> References: <20260305205152.2121854-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::830; envelope-from=pierrick.bouvier@linaro.org; helo=mail-qt1-x830.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1772743991419158500 Content-Type: text/plain; charset="utf-8" From: Florian Hofhammer The test plugin intercepts execution in different contexts. Without the plugin, any of the implemented test functions would trigger an assert and fail. With the plugin, control flow is redirected to skip the assert and return cleanly via the qemu_plugin_set_pc() API. Signed-off-by: Florian Hofhammer Reviewed-by: Pierrick Bouvier Link: https://lore.kernel.org/qemu-devel/20260305-setpc-v5-v7-5-4c3adba5240= 3@epfl.ch Signed-off-by: Pierrick Bouvier --- MAINTAINERS | 1 + .../{ =3D> plugin}/test-plugin-mem-access.c | 0 .../tcg/multiarch/plugin/test-plugin-set-pc.c | 134 ++++++++++++++++++ tests/tcg/plugins/setpc.c | 105 ++++++++++++++ tests/tcg/arm/Makefile.target | 6 + tests/tcg/hexagon/Makefile.target | 8 ++ tests/tcg/multiarch/Makefile.target | 17 ++- .../{ =3D> plugin}/check-plugin-output.sh | 0 tests/tcg/plugins/meson.build | 1 + 9 files changed, 269 insertions(+), 3 deletions(-) rename tests/tcg/multiarch/{ =3D> plugin}/test-plugin-mem-access.c (100%) create mode 100644 tests/tcg/multiarch/plugin/test-plugin-set-pc.c create mode 100644 tests/tcg/plugins/setpc.c rename tests/tcg/multiarch/{ =3D> plugin}/check-plugin-output.sh (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 6698e5ff69c..63c0af4d86d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4104,6 +4104,7 @@ S: Maintained F: docs/devel/tcg-plugins.rst F: plugins/ F: tests/tcg/plugins/ +F: tests/tcg/multiarch/plugin/ F: tests/functional/aarch64/test_tcg_plugins.py F: contrib/plugins/ F: scripts/qemu-plugin-symbols.py diff --git a/tests/tcg/multiarch/test-plugin-mem-access.c b/tests/tcg/multi= arch/plugin/test-plugin-mem-access.c similarity index 100% rename from tests/tcg/multiarch/test-plugin-mem-access.c rename to tests/tcg/multiarch/plugin/test-plugin-mem-access.c diff --git a/tests/tcg/multiarch/plugin/test-plugin-set-pc.c b/tests/tcg/mu= ltiarch/plugin/test-plugin-set-pc.c new file mode 100644 index 00000000000..f8343dfba84 --- /dev/null +++ b/tests/tcg/multiarch/plugin/test-plugin-set-pc.c @@ -0,0 +1,134 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + * + * Copyright (C) 2026, Florian Hofhammer + * + * This test set exercises the qemu_plugin_set_pc() function in four diffe= rent + * contexts: + * 1. in an instruction callback during normal execution, + * 2. in an instruction callback during signal handling, + * 3. in a memory access callback. + * 4. in a syscall callback, + */ +#include +#include +#include +#include +#include +#include + +/* If we issue this magic syscall, ... */ +#define MAGIC_SYSCALL 4096 +/* ... the plugin either jumps directly to the target address ... */ +#define SETPC 0 +/* ... or just updates the target address for future use in callbacks. */ +#define SETTARGET 1 + +static int signal_handled; + +void panic(const char *msg) +{ + fprintf(stderr, "Panic: %s\n", msg); + abort(); +} + +/* + * This test executes a magic syscall which communicates two addresses to = the + * plugin via the syscall arguments. Whenever we reach the "bad" instructi= on + * during normal execution, the plugin should redirect control flow to the + * "good" instruction instead. + */ +void test_insn(void) +{ + long ret =3D syscall(MAGIC_SYSCALL, SETTARGET, &&bad_insn, &&good_insn, + NULL); + assert(ret =3D=3D 0 && "Syscall filter did not return expected value"); +bad_insn: + panic("PC redirection in instruction callback failed"); +good_insn: + puts("PC redirection in instruction callback succeeded"); +} + +/* + * This signal handler communicates a "bad" and a "good" address to the pl= ugin + * similar to the previous test, and skips to the "good" address when the = "bad" + * one is reached. This serves to test whether PC redirection via + * qemu_plugin_set_pc() also works properly in a signal handler context. + */ +void usr1_handler(int signum) +{ + long ret =3D syscall(MAGIC_SYSCALL, SETTARGET, &&bad_signal, &&good_si= gnal, + NULL); + assert(ret =3D=3D 0 && "Syscall filter did not return expected value"); +bad_signal: + panic("PC redirection in instruction callback failed"); +good_signal: + signal_handled =3D 1; + puts("PC redirection in instruction callback succeeded"); +} + +/* + * This test sends a signal to the process, which should trigger the above + * signal handler. The signal handler should then exercise the PC redirect= ion + * functionality in the context of a signal handler, which behaves a bit + * differently from normal execution. + */ +void test_sighandler(void) +{ + struct sigaction sa =3D {0}; + sa.sa_handler =3D usr1_handler; + sigaction(SIGUSR1, &sa, NULL); + pid_t pid =3D getpid(); + kill(pid, SIGUSR1); + assert(signal_handled =3D=3D 1 && "Signal handler was not executed pro= perly"); +} + +/* + * This test communicates a "good" address and the address of a local vari= able + * to the plugin. Upon accessing the local variable, the plugin should then + * redirect control flow to the "good" address via qemu_plugin_set_pc(). + */ +void test_mem(void) +{ + static uint32_t test =3D 1; + long ret =3D syscall(MAGIC_SYSCALL, SETTARGET, NULL, &&good_mem, &test= ); + assert(ret =3D=3D 0 && "Syscall filter did not return expected value"); + /* Ensure read access to the variable to trigger the plugin callback */ + assert(test =3D=3D 1); + panic("PC redirection in memory access callback failed"); +good_mem: + puts("PC redirection in memory access callback succeeded"); +} + +/* + * This test executes a magic syscall which is intercepted and its actual + * execution skipped via the qemu_plugin_set_pc() API. In a proper plugin, + * syscall skipping would rather be implemented via the syscall filtering + * callback, but we want to make sure qemu_plugin_set_pc() works in differ= ent + * contexts. + */ +__attribute__((noreturn)) +void test_syscall(void) +{ + syscall(MAGIC_SYSCALL, SETPC, &&good_syscall); + panic("PC redirection in syscall callback failed"); +good_syscall: + /* + * Note: we execute this test last and exit straight from here because= when + * the plugin redirects control flow upon syscall, the stack frame for= the + * syscall function (and potential other functions in the call chain in + * libc) is still live and the stack is not unwound properly. Thus, + * returning from here is risky and breaks on some architectures, so we + * just exit directly from this test. + */ + _exit(EXIT_SUCCESS); +} + + +int main(int argc, char *argv[]) +{ + test_insn(); + test_sighandler(); + test_mem(); + test_syscall(); +} diff --git a/tests/tcg/plugins/setpc.c b/tests/tcg/plugins/setpc.c new file mode 100644 index 00000000000..8f2d025e245 --- /dev/null +++ b/tests/tcg/plugins/setpc.c @@ -0,0 +1,105 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + * + * Copyright (C) 2026, Florian Hofhammer + */ +#include +#include +#include +#include + +#include + +/* If we detect this magic syscall, ... */ +#define MAGIC_SYSCALL 4096 +/* ... the plugin either jumps directly to the target address ... */ +#define SETPC 0 +/* ... or just updates the target address for future use in callbacks. */ +#define SETTARGET 1 + +QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGIN_VERSION; + +static uint64_t source_pc; +static uint64_t target_pc; +static uint64_t target_vaddr; + +static bool vcpu_syscall_filter(qemu_plugin_id_t id, unsigned int vcpu_ind= ex, + int64_t num, uint64_t a1, uint64_t a2, + uint64_t a3, uint64_t a4, uint64_t a5, + uint64_t a6, uint64_t a7, uint64_t a8, + uint64_t *sysret) +{ + if (num =3D=3D MAGIC_SYSCALL) { + if (a1 =3D=3D SETPC) { + qemu_plugin_outs("Magic syscall detected, jump to clean exit\n= "); + qemu_plugin_set_pc(a2); + } else if (a1 =3D=3D SETTARGET) { + qemu_plugin_outs("Magic syscall detected, set target_pc / " + "target_vaddr\n"); + source_pc =3D a2; + target_pc =3D a3; + target_vaddr =3D a4; + *sysret =3D 0; + return true; + } else { + qemu_plugin_outs("Unknown magic syscall argument, ignoring\n"); + } + } + return false; +} + +static void vcpu_insn_exec(unsigned int vcpu_index, void *userdata) +{ + uint64_t vaddr =3D (uint64_t)userdata; + if (vaddr =3D=3D source_pc) { + g_assert(target_pc !=3D 0); + g_assert(target_vaddr =3D=3D 0); + + qemu_plugin_outs("Marker insn detected, jump to clean return\n"); + qemu_plugin_set_pc(target_pc); + } +} + +static void vcpu_mem_access(unsigned int vcpu_index, + qemu_plugin_meminfo_t info, + uint64_t vaddr, void *userdata) +{ + if (vaddr !=3D 0 && vaddr =3D=3D target_vaddr) { + g_assert(source_pc =3D=3D 0); + g_assert(target_pc !=3D 0); + + qemu_plugin_outs("Marker mem access detected, jump to clean return= \n"); + qemu_plugin_set_pc(target_pc); + } +} + +static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +{ + size_t insns =3D qemu_plugin_tb_n_insns(tb); + for (size_t i =3D 0; i < insns; i++) { + struct qemu_plugin_insn *insn =3D qemu_plugin_tb_get_insn(tb, i); + uint64_t insn_vaddr =3D qemu_plugin_insn_vaddr(insn); + /* + * Note: we cannot only register the callbacks if the instruction = is + * in one of the functions of interest, because symbol lookup for + * filtering does not work for all architectures (e.g., ppc64). + */ + qemu_plugin_register_vcpu_insn_exec_cb(insn, vcpu_insn_exec, + QEMU_PLUGIN_CB_RW_REGS_PC, + (void *)insn_vaddr); + qemu_plugin_register_vcpu_mem_cb(insn, vcpu_mem_access, + QEMU_PLUGIN_CB_RW_REGS_PC, + QEMU_PLUGIN_MEM_R, NULL); + } +} + + +QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, + const qemu_info_t *info, + int argc, char **argv) +{ + + qemu_plugin_register_vcpu_syscall_filter_cb(id, vcpu_syscall_filter); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + return 0; +} diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target index 6189d7a0e24..613bbf0939a 100644 --- a/tests/tcg/arm/Makefile.target +++ b/tests/tcg/arm/Makefile.target @@ -78,4 +78,10 @@ sha512-vector: sha512.c =20 ARM_TESTS +=3D sha512-vector =20 +ifeq ($(CONFIG_PLUGIN),y) +# Require emitting arm32 instructions, otherwise the vCPU might accidental= ly +# try to execute Thumb instructions in arm32 mode after qemu_plugin_set_pc= () +test-plugin-set-pc: CFLAGS+=3D-marm +endif + TESTS +=3D $(ARM_TESTS) diff --git a/tests/tcg/hexagon/Makefile.target b/tests/tcg/hexagon/Makefile= .target index f86f02bb31c..a70ef2f6607 100644 --- a/tests/tcg/hexagon/Makefile.target +++ b/tests/tcg/hexagon/Makefile.target @@ -126,3 +126,11 @@ v73_scalar: CFLAGS +=3D -Wno-unused-function =20 hvx_histogram: hvx_histogram.c hvx_histogram_row.S $(CC) $(CFLAGS) $(CROSS_CC_GUEST_CFLAGS) $^ -o $@ $(LDFLAGS) + +ifeq ($(CONFIG_PLUGIN),y) +# LLVM is way too aggressive with inlining and dead code elimination even = at +# -O0, which interferes with the test. What looks like dead code in this t= est +# to the compiler isn't actually dead code, so we need to disable all pote= ntial +# LLVM optimization passes. +test-plugin-set-pc: CFLAGS +=3D -Xclang -disable-llvm-passes +endif diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Make= file.target index 07d0b27bdd3..a347efbadf0 100644 --- a/tests/tcg/multiarch/Makefile.target +++ b/tests/tcg/multiarch/Makefile.target @@ -14,6 +14,10 @@ ifeq ($(filter %-linux-user, $(TARGET)),$(TARGET)) VPATH +=3D $(MULTIARCH_SRC)/linux MULTIARCH_SRCS +=3D $(notdir $(wildcard $(MULTIARCH_SRC)/linux/*.c)) endif +ifeq ($(CONFIG_PLUGIN),y) +VPATH +=3D $(MULTIARCH_SRC)/plugin +MULTIARCH_SRCS +=3D $(notdir $(wildcard $(MULTIARCH_SRC)/plugin/*.c)) +endif MULTIARCH_TESTS =3D $(MULTIARCH_SRCS:.c=3D) =20 # @@ -200,13 +204,20 @@ run-plugin-test-plugin-mem-access-with-libmem.so: \ PLUGIN_ARGS=3D$(COMMA)print-accesses=3Dtrue run-plugin-test-plugin-mem-access-with-libmem.so: \ CHECK_PLUGIN_OUTPUT_COMMAND=3D \ - $(SRC_PATH)/tests/tcg/multiarch/check-plugin-output.sh \ + $(SRC_PATH)/tests/tcg/multiarch/plugin/check-plugin-output.sh \ $(QEMU) $< run-plugin-test-plugin-syscall-filter-with-libsyscall.so: +run-plugin-test-plugin-set-pc-with-libsetpc.so: =20 EXTRA_RUNS_WITH_PLUGIN +=3D run-plugin-test-plugin-mem-access-with-libmem.= so \ - run-plugin-test-plugin-syscall-filter-with-libsyscall.so -else + run-plugin-test-plugin-syscall-filter-with-libsyscall.so \ + run-plugin-test-plugin-set-pc-with-libsetpc.so + +else # CONFIG_PLUGIN=3Dn +# Do not build the syscall skipping test if it's not tested with the setpc +# plugin because it will simply fail the test. +MULTIARCH_TESTS :=3D $(filter-out test-plugin-set-pc, $(MULTIARCH_TESTS)) + # test-plugin-syscall-filter needs syscall plugin to succeed test-plugin-syscall-filter: CFLAGS+=3D-DSKIP endif diff --git a/tests/tcg/multiarch/check-plugin-output.sh b/tests/tcg/multiar= ch/plugin/check-plugin-output.sh similarity index 100% rename from tests/tcg/multiarch/check-plugin-output.sh rename to tests/tcg/multiarch/plugin/check-plugin-output.sh diff --git a/tests/tcg/plugins/meson.build b/tests/tcg/plugins/meson.build index c5e49753fd9..b3e3a9a6d02 100644 --- a/tests/tcg/plugins/meson.build +++ b/tests/tcg/plugins/meson.build @@ -7,6 +7,7 @@ test_plugins =3D [ 'mem.c', 'patch.c', 'reset.c', +'setpc.c', 'syscall.c', ] =20 --=20 2.47.3