From nobody Tue Feb 10 06:58:00 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=1571989880; cv=none; d=zoho.com; s=zohoarc; b=HpNkzHeu/B8OleIq1xl+53SMSMjl39K9IUEOLf4SosgauLx1+TZs88bXc9tUisgQ8f+nfQI7KsYcYJMHX5m9ruCFsktk3GIBltk1mHcIXF043FNr5I6kNTZY25oF+wp/2QbvBQEyojXIcbe1GjPnyftdXX0OLWNESoiLSHCw5o8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571989880; 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=kHDw5giSQUpa5TavdPwJmtfXF3VzRIg0gye452+mQFA=; b=d2znibFNfq7dK9gZopwueN7X8/oBYphevLp//Em9HjJS+exTxRzuZ24F3Ei8M/kf5oRgr+3sW4NJWq/wwlPIPlYJvuXeCB2tbsLXSz68/QGaRHGzIDot58FVj5lKMu30BC2CwJ5A9E0CFK7x09hN6k7p/kMUmbHlNwgjSdCEinY= 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 1571989880984657.9477665692359; Fri, 25 Oct 2019 00:51:20 -0700 (PDT) Received: from localhost ([::1]:57154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuNS-0001R7-PJ for importer@patchew.org; Fri, 25 Oct 2019 03:51:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40336) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtpt-0004Vh-OX for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtps-00078I-9J for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:37 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:36150) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtps-00077q-2d for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:36 -0400 Received: by mail-wm1-x330.google.com with SMTP id c22so865963wmd.1 for ; Fri, 25 Oct 2019 00:16:35 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a2sm1430092wrv.39.2019.10.25.00.16.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:32 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C10081FFD5; Fri, 25 Oct 2019 07:37:19 +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=kHDw5giSQUpa5TavdPwJmtfXF3VzRIg0gye452+mQFA=; b=n3qhAO3kwLwn+fuVou4I4zvxlFjgYpq5U8GrQ8VznxWHN7kbhSrbm8I/IGcj0qxUH2 9cMkCa3SzI12UABnNvb1eigaJ/T48+MwxeHZ4TygRbdst3HXmWJ2LQg3XslHdEKvQBzR 03DlGt+E6rpIWwL6q2BYhTqZq/lBUGn46FTW8ia7y+oJ2YZQWjRqthOsgMc5uoGjQJKa J1vT2kj39PSLZIflWi/eGTKLzgOcri53dgugNBoEVRHbdR0pdUYsbYe4oxaRESHojxpD rm850s9fmoqylPL/dzJ14gGEpdPAc8C5tubvaJsLtBCmrmmw22bY9xdojiGZilYMLXAU Fk0w== 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=kHDw5giSQUpa5TavdPwJmtfXF3VzRIg0gye452+mQFA=; b=f5UodWGWyXEuJQqh84NwFhRPa4cOSXUnGEUBClidPdtK09kDkn5i2fa9PjfVNOluy+ JqKzH1ExSStaSlxZgsK/FT/qylTUO0YlXhmO8rLHnGQPpp37VNOFxpPhYFKQ3IHknG0n u8s3yN+LGmTHAXtLfRYKCX49CQzKyWfg2TA19fYXcMNx8IlFgC7hnMtFsT6Jw/pN7jvy UvS69fW+ycuQt6VZ3kR/P72ga8KkPS8psQGGYjZWiFaj2HM1TS1nTjKzytarBPr2KFD8 1frrbAAn2bLvT93+LMD7l9VJMstS4nc0tWap7FzPEwsTIPZej9CtVBR7fAN5hVhhmxw/ cJNA== X-Gm-Message-State: APjAAAXlCgO5NZ9i1msEuKMjWdY0zeX9pG85RvfSzfPs9RQ1cpE+tLhs FLwTSost3E24NqOaORrHnHB1UQ== X-Google-Smtp-Source: APXvYqxOOfyKHYtZWpkh7qPbfj5PIOpB/3ZikbAGxWt+Z2FAHAiW0ZyCHFBGouvo41jM47ogm0pHAw== X-Received: by 2002:a1c:2c88:: with SMTP id s130mr2133109wms.66.1571987794791; Fri, 25 Oct 2019 00:16:34 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 64/73] tests/tcg: enable plugin testing Date: Fri, 25 Oct 2019 07:37:04 +0100 Message-Id: <20191025063713.23374-65-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-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::330 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: Richard Henderson , "open list:ARM TCG CPUs" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?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 diff --git a/tests/Makefile.include b/tests/Makefile.include index 09e5b410dca..a2c4c56dbe4 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -1060,6 +1060,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)) @@ -1070,7 +1079,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 96646130020..3c7421a356e 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -123,11 +123,39 @@ 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,$@) \ + -d plugin -D $*.pout \ + $(call strip-plugin,$<), \ + "$* on $(TARGET_NAME)") else run-%: % $(call run-test, $<, \ @@ -135,6 +163,15 @@ 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,$@) \ + -d plugin -D $*.pout \ + $(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 509f1afa93d..96d2321045a 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 231e9a57b48..3fe237ba391 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 3ddff852404..0765f37ff04 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