From nobody Mon Feb 9 18:46:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1571053782; cv=none; d=zoho.com; s=zohoarc; b=LKQS7cEp7AyVVEPlqbLxufVktzOyOmDuH6mCggWsffHJirwrA7FZFlG4NFISiuqhwbeBjzKx/bqkrbanrB0TjC3pYiI09n/ZtoPMyTSNljSV2OLH1FLxz+s0n5h9OWhG0lYxGZ+nbNhvqsxgW7PTE56XdtD0Wh0DLaoTPhVhBwE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571053782; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KpM3SyJDkKhcUHIVLFnItn5R6+AXIYS7UFfmeyEbac8=; b=Fv79J5GPdGjHj/7nFvrR9+6k4kPO+P+hMSx5hQ1AVWd6oud4Arig2sYBVinSRaT2/WTWdiXCfPTtG1xGjtUv9ZZayPHU2emdHsoVCa4b0tj1q5/3S4wci2CWRRTvw/SkD3PYGvAPgLaL3my5Rj0+YbKF7clrbMAGVIQMBtwjqq4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157105378244284.24438696051129; Mon, 14 Oct 2019 04:49:42 -0700 (PDT) Received: from localhost ([::1]:48152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJyr6-0005bl-LB for importer@patchew.org; Mon, 14 Oct 2019 07:49:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46935) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJyCH-0008FD-CZ for qemu-devel@nongnu.org; Mon, 14 Oct 2019 07:07:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJyCF-0007od-QZ for qemu-devel@nongnu.org; Mon, 14 Oct 2019 07:07:29 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:36614) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iJyCF-0007ne-JY for qemu-devel@nongnu.org; Mon, 14 Oct 2019 07:07:27 -0400 Received: by mail-wr1-x433.google.com with SMTP id y19so19225909wrd.3 for ; Mon, 14 Oct 2019 04:07:27 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id r27sm52393613wrc.55.2019.10.14.04.06.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 04:07:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C50081FFCF; Mon, 14 Oct 2019 11:49:58 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KpM3SyJDkKhcUHIVLFnItn5R6+AXIYS7UFfmeyEbac8=; b=FwSIXiWvVyQXV3tamVT+RpTc7tE0bBsHri7uBVqqmLoCewIeqP+Ou7C4gwYIjnTS8M liPqcIHDajnEfNa+9vQ0PsyFM/OyckztfqB4DfbxEXMurPy8TIfwNUimu35RzYWGlPtJ BkdSGx3Z3beXamcCCYwWiKbCwc0fVxKBCtBMdWNT90mNbsPGRpieuxh/tmym24ttcqBk osJnT/HHFA1azlp0kzmDRL7hRciGvHokgUADRExU1aRrbneFUF+Bm0VrhnNPxEm6TsBY Rl/S3G9Fg3iZ8tqPnur29k74iG0l60N2OODczgMP30szumALwbjO6zlcS0PUCuwTolJH /I0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KpM3SyJDkKhcUHIVLFnItn5R6+AXIYS7UFfmeyEbac8=; b=fyhIuM42O8cT6+Z9nUsE2b1G4nTh6P9Ej+mOUw2X+S/PAGQyjp11SGTuRL472kTYdM +hBtATzek+rEmmWRXbj2l4B3/8EvwrvlHozDdDOoFaTHRfBrGq1W21skaFT0aTofzQUk 5iqss3rFvjt9MDtnF6uvZzCsDnzBDwkhECVA7OFiKhfboQ3OOZpQ7ljXv/0LOAYSuDng agdxgZ59+dEKGPDPtWBx+nHb2MaXpevDL0N6eNQBo5J7fJezOdUfdmIPVy2/H+X7Mt5s 5wor2/zVKnW1tlXH6HEeADK3B2Lgb858g753r8j8NbSuSb7LGBpEYGkZRV7OUXomKO6T 68yw== X-Gm-Message-State: APjAAAUE6MSa3zCg20bgOThZ8sjsdzzcYvTXMCVhZ8GpI0Wq9cMqthYO 9Lv0bbfY26czRhs222aYQSIIgQ== X-Google-Smtp-Source: APXvYqyvHUc/aKs1fh2rDWLa727EcxfsK7kAYDwv+W1o1azDnrnZ0b0pyoY6t8V6nFoxuyDOEf/JEw== X-Received: by 2002:adf:ee4f:: with SMTP id w15mr6582038wro.378.1571051246196; Mon, 14 Oct 2019 04:07:26 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v5 44/55] tests/tcg: enable plugin testing Date: Mon, 14 Oct 2019 11:49:37 +0100 Message-Id: <20191014104948.4291-45-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191014104948.4291-1-alex.bennee@linaro.org> References: <20191014104948.4291-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::433 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , robert.foley@futurewei.com, peter.puhov@futurewei.com, aaron@os.amperecomputing.com, cota@braap.org, "open list:ARM TCG CPUs" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) If CONFIG_PLUGINS is enabled then lets enable testing for all our TCG targets. This is a simple smoke test that ensure we don't crash or otherwise barf out by running each plugin against each test. There is a minor knock on effect for additional runners which need specialised QEMU_OPTS which will also need to declare a plugin version of the runner. If this gets onerous we might need to add another helper. Checking the results of the plugins is left for a later exercise. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- v5 - fix for the latest changes to check-tcg - extend timeout for plugin tests - add special runner for semihosting with plugin - fix naming of test in call output - add special plugin aware runners for semihosting --- tests/Makefile.include | 11 ++++++++- tests/tcg/Makefile.target | 35 +++++++++++++++++++++++++++ tests/tcg/aarch64/Makefile.target | 6 +++++ tests/tcg/arm/Makefile.softmmu-target | 1 + tests/tcg/arm/Makefile.target | 6 +++++ 5 files changed, 58 insertions(+), 1 deletion(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 3543451ed3..646a704e65 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -1052,6 +1052,15 @@ check-softfloat: "SKIPPED for non-TCG builds") endif =20 +# Plugins +ifeq ($(CONFIG_PLUGIN),y) +.PHONY: plugins +plugins: + $(call quiet-command,\ + $(MAKE) $(SUBDIR_MAKEFLAGS) -C tests/plugin V=3D"$(V)", \ + "BUILD", "plugins") +endif + # Per guest TCG tests =20 BUILD_TCG_TARGET_RULES=3D$(patsubst %,build-tcg-tests-%, $(TARGET_DIRS)) @@ -1062,7 +1071,7 @@ RUN_TCG_TARGET_RULES=3D$(patsubst %,run-tcg-tests-%, = $(TARGET_DIRS)) $(foreach PROBE_TARGET,$(TARGET_DIRS), \ $(eval -include $(SRC_PATH)/tests/tcg/Makefile.prereqs)) =20 -build-tcg-tests-%: +build-tcg-tests-%: $(if $(CONFIG_PLUGIN),plugins) $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \ -f $(SRC_PATH)/tests/tcg/Makefile.qemu \ SRC_PATH=3D$(SRC_PATH) \ diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index 9664613002..d25fc64300 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -123,11 +123,38 @@ all: $(TESTS) $(EXTRA_TESTS) # =20 RUN_TESTS=3D$(patsubst %,run-%, $(TESTS)) + +# If plugins exist also include those in the tests +ifeq ($(CONFIG_PLUGIN),y) +PLUGIN_DIR=3D../../plugin +VPATH+=3D$(PLUGIN_DIR) +PLUGINS=3D$(notdir $(wildcard $(PLUGIN_DIR)/*.so)) + +# We need to ensure expand the run-plugin-TEST-with-PLUGIN +# pre-requistes manually here as we can't use stems to handle it. We +# also add some special helpers the run-plugin- rules can use bellow. + +$(foreach p,$(PLUGINS), \ + $(foreach t,$(TESTS),\ + $(eval run-plugin-$(t)-with-$(p): $t $p) \ + $(eval run-plugin-$(t)-with-$(p): TIMEOUT=3D30) \ + $(eval RUN_TESTS+=3Drun-plugin-$(t)-with-$(p)))) +endif + +strip-plugin =3D $(wordlist 1, 1, $(subst -with-, ,$1)) +extract-plugin =3D $(wordlist 2, 2, $(subst -with-, ,$1)) + RUN_TESTS+=3D$(EXTRA_RUNS) =20 ifdef CONFIG_USER_ONLY run-%: % $(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<, "$< on $(TARGET_NAME)") + +run-plugin-%: + $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ + -plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ + $(call strip-plugin,$<), \ + "$* on $(TARGET_NAME)") else run-%: % $(call run-test, $<, \ @@ -135,6 +162,14 @@ run-%: % -chardev file$(COMMA)path=3D$<.out$(COMMA)id=3Doutput \ $(QEMU_OPTS) $<, \ "$< on $(TARGET_NAME)") + +run-plugin-%: + $(call run-test, $@, \ + $(QEMU) -monitor none -display none \ + -chardev file$(COMMA)path=3D$@.out$(COMMA)id=3Doutput \ + -plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ + $(QEMU_OPTS) $(call strip-plugin,$<), \ + "$* on $(TARGET_NAME)") endif =20 gdb-%: % diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile= .target index 509f1afa93..96d2321045 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -26,4 +26,10 @@ AARCH64_TESTS +=3D semihosting run-semihosting: semihosting $(call run-test,$<,$(QEMU) $< 2> $<.err, "$< on $(TARGET_NAME)") =20 +run-plugin-semihosting-with-%: + $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ + -plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ + $(call strip-plugin,$<) 2> $<.err, \ + "$< on $(TARGET_NAME) with $*") + TESTS +=3D $(AARCH64_TESTS) diff --git a/tests/tcg/arm/Makefile.softmmu-target b/tests/tcg/arm/Makefile= .softmmu-target index 231e9a57b4..3fe237ba39 100644 --- a/tests/tcg/arm/Makefile.softmmu-target +++ b/tests/tcg/arm/Makefile.softmmu-target @@ -23,3 +23,4 @@ LDFLAGS+=3D-nostdlib -N -static test-armv6m-undef: EXTRA_CFLAGS+=3D-mcpu=3Dcortex-m0 =20 run-test-armv6m-undef: QEMU_OPTS+=3D-semihosting -M microbit -kernel +run-plugin-test-armv6m-undef-%: QEMU_OPTS+=3D-semihosting -M microbit -ker= nel diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target index 3ddff85240..0765f37ff0 100644 --- a/tests/tcg/arm/Makefile.target +++ b/tests/tcg/arm/Makefile.target @@ -34,6 +34,12 @@ ARM_TESTS +=3D semihosting run-semihosting: semihosting $(call run-test,$<,$(QEMU) $< 2> $<.err, "$< on $(TARGET_NAME)") =20 +run-plugin-semihosting-with-%: + $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ + -plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ + $(call strip-plugin,$<) 2> $<.err, \ + "$< on $(TARGET_NAME) with $*") + TESTS +=3D $(ARM_TESTS) =20 # On ARM Linux only supports 4k pages --=20 2.20.1