From patchwork Thu Feb 18 09:47:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 384371 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3534474jao; Thu, 18 Feb 2021 01:57:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJybLB/Yse8W+vjzAzoAPz5uFv0Jn+IPDRhHPt6MKHMY7QaHR7gD9qFiijkM3Y0cmE+0rpDc X-Received: by 2002:a25:4fc3:: with SMTP id d186mr4869439ybb.343.1613642251501; Thu, 18 Feb 2021 01:57:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613642251; cv=none; d=google.com; s=arc-20160816; b=Esm70UN/kD+xYvHkzKJfESda9g0zY/YWSCaKaPobX1PamDFQzTy0kLVAWUaNE+Wjir r2Ux7PVHvdagzlpRds9Mlo/GaRpulk2wADaOikAdlH6oEvDgvh2Zndy2jFRYbwsF9gJb kJC5YQjRbCcrVgXxC7kwn7zd6YBX1Uo720TWytieZyZxY7tAPP69o+zmQ2i52dd6kYlw a+FtNWwCqE3EM5s9AN5D3toAuj2Q6hGARrJanWoukj3wsiRhxYocVA24kFrSyGNtLizh 38v8R/nmuMX4TN6mKQyPpnOzMaDi6lD7/IOIMGEOKA4RyG+KDPMrNrMxy6czx04vWxTu XBng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=5rHH5POPbuYAq0YUi5h3icjOV2z6ayt8RsNYkhPgywI=; b=UTnMFxhw1hfp8UxmLoNSWBW+nmNCckiWFniA+5T3xbyuNN49H0mG9CpGnKNP1dgDAb 4+6/BP9nUTSkYwmOtAR3xf4/16ixndWX5CbmfLTPUozV3CDcqUYj+f/Kd2V+z5Ou72BY 2JnivnK0wUikamBD/+op1uvDiibFHhk19kVX3BbJsHtJX9PvAiZnivWQSvVpgJZWFc6G Y5RGehI2e3IolTOKs3JRDX/yJjxTG1la99MSlOuDPAH0IbA1ETOSs23/ju4l8cpRZFuJ btD5GaRiVHNXN5Zc93qTOTzBzKvzepoc18gKXaB+LHsymySqZZgUgSkYJkCAxp2wYUbu F1PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JRIu0Q8b; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w32si5346586ybi.16.2021.02.18.01.57.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Feb 2021 01:57:31 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JRIu0Q8b; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:55492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCg3u-0000cl-Vn for patch@linaro.org; Thu, 18 Feb 2021 04:57:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCfuL-00078Z-UM for qemu-devel@nongnu.org; Thu, 18 Feb 2021 04:47:37 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:40049) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lCfuE-0007IH-T4 for qemu-devel@nongnu.org; Thu, 18 Feb 2021 04:47:37 -0500 Received: by mail-wr1-x42d.google.com with SMTP id v14so2183321wro.7 for ; Thu, 18 Feb 2021 01:47:30 -0800 (PST) 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=5rHH5POPbuYAq0YUi5h3icjOV2z6ayt8RsNYkhPgywI=; b=JRIu0Q8b0SW4GfxGiaw6/sHNFqj/lFNVIV+YXe+wewONsWwevOm64mU2pRyeDuul+6 B5DAuphar1fzmIjAvpR3Ks87oS+4YS7PYk5h3lyIiE1nVh9dJTkrFzhl/lLSBEzMZW9E vg5sHvniW2pcTt72wXftNpIzPSg/ASEkaANFdLcZkdBE+8k5RPfhog36EhFdfvZi+r3w UUo13d2OszGto+k4rjE0T6KcjyBpG/Cy4kcjlB8SN7VWbC9hBhyc2qmDxqv14fiq5MQi 7TyEr2HZVZnK1EwfYYCs5mP7Im9sDqUcQ7olyiddzHj2+oLxG4oCc2c8v5mcsDacQUKn pSYQ== 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=5rHH5POPbuYAq0YUi5h3icjOV2z6ayt8RsNYkhPgywI=; b=afWF82FJSfiojwJgqklkm9lGESNQ/t7f6S9U8jcEJjz9FIIfADD227AybzJtS9RMKb NA+O3m97VZc51mo3FAIEevgKZibOv5z2YtPSMIrqxOH15SoSSKRCFHwWHDI0d7PHl8zh O4qZpDEfKGilD/XGAPk9Ty1O8TSZnuEITiIZqbJb0fbLRmfWxasf3BWfhlmBtVSeoKVZ LQvQl94TvfPdcideBjmo4tM3oD81OpmcDelYG+M5m9XOOa530HRIt4lja9ItboG6fnFD SdZikDyVLUfZFsupgcPDPr6wcZfEXj88vfDr8beTcVXP7eXRq3StGbG3CBPnpi/EHZE7 87vw== X-Gm-Message-State: AOAM531azktT/auUDnKqfDQ+bxFuQWwsFO+f8zbbqPzjNRwRa2xQa1x5 3PT8rxt45kuCodnSwFT6SqmPuA== X-Received: by 2002:adf:e5d1:: with SMTP id a17mr3583259wrn.260.1613641649512; Thu, 18 Feb 2021 01:47:29 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id l7sm8319898wrn.11.2021.02.18.01.47.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Feb 2021 01:47:23 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 031BD1FFAB; Thu, 18 Feb 2021 09:47:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 21/23] tests/acceptance: add a new tests to detect counting errors Date: Thu, 18 Feb 2021 09:47:04 +0000 Message-Id: <20210218094706.23038-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210218094706.23038-1-alex.bennee@linaro.org> References: <20210218094706.23038-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Cleber Rosa , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The insn plugin has a simple heuristic to detect if an instruction is detected running twice in a row. Check the plugin log after the run and pass accordingly. Signed-off-by: Alex Bennée Tested-by: Wainer dos Santos Moschetta Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210213130325.14781-22-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/acceptance/tcg_plugins.py b/tests/acceptance/tcg_plugins.py index adec40d3a5..b1ba10498f 100644 --- a/tests/acceptance/tcg_plugins.py +++ b/tests/acceptance/tcg_plugins.py @@ -89,3 +89,29 @@ def test_aarch64_virt_insn(self): m = re.search(br"insns: (?P\d+)", s) if "count" not in m.groupdict(): self.fail("Failed to find instruction count") + + def test_aarch64_virt_insn_icount(self): + """ + :avocado: tags=accel:tcg + :avocado: tags=arch:aarch64 + :avocado: tags=machine:virt + :avocado: tags=cpu:cortex-a57 + """ + kernel_path = self._grab_aarch64_kernel() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + 'console=ttyAMA0') + console_pattern = 'Kernel panic - not syncing: VFS:' + + plugin_log = tempfile.NamedTemporaryFile(mode="r+t", prefix="plugin", + suffix=".log") + + self.run_vm(kernel_path, kernel_command_line, + "tests/plugin/libinsn.so", plugin_log.name, + console_pattern, + args=('-cpu', 'cortex-a53', '-icount', 'shift=1')) + + with plugin_log as lf, \ + mmap.mmap(lf.fileno(), 0, access=mmap.ACCESS_READ) as s: + m = re.search(br"detected repeat execution @ (?P0x[0-9A-Fa-f]+)", s) + if m is not None and "addr" in m.groupdict(): + self.fail("detected repeated instructions")