From patchwork Thu Feb 18 09:47:06 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: 384378 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3541095jao; Thu, 18 Feb 2021 02:05:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJy96+fJVEF+4THfLgiFPafz1umRI2yZLq5wC2me9Uq1WViBn4PcOsRzpsDGlz9YSL5Kmm8A X-Received: by 2002:a25:c506:: with SMTP id v6mr5517524ybe.266.1613642736233; Thu, 18 Feb 2021 02:05:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613642736; cv=none; d=google.com; s=arc-20160816; b=E/EPMdPTOL9FFIMcxfuDajq7a4KYol7euihe8FpoWvUOK3IUGp/3832/tj6txuYEP+ Ye6+DrqqQNc8TB19Gk6drzuRAk+wAbrbiL6CyIWzQGHRchESaXwDg0+3oPq/y2cEbrmU DD9p1nqyBnES/ePOWKUMyhPgblDqpoO2j4oLUtrIjuEIuazfw5tJaUXJynJOVa+sGz5e /M4/x8RugDJ7GqUCft9Uh6mmm9K6/vuMbCcs4j8p7WPU3JvLyn/BjTXOnt0XKLYAPMNL SEJN/xfOAt/AdA9hTtNdP3q1gzLeLzCUtMVS5R9PTlqIGpC9DINx5qRmbpgm/4GxNkqq BYKQ== 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=3UFgwBYMWW+cA/Y1jKLdTryuQ+jpOBq3LyRLsc4984U=; b=wm5ogGIURONahq8QHwPfEWqAXZ6CFFyuG0o2LSjKaeAtKTCsbunecfnGh1f1A39kvg Tvu+MFsocWZtMHvurUYseKK1ldpEDz4yh7vztQXVag0c5BmDTZU3Tz566KZjV1OHcbyD ILvOcxTh0+Oj6Ti9hqBhLMyWWDp/nVudS1/9iV7vYEFZRehl8ALy0Wh1AgzNEq0uvIP1 PGtn/S4toLxlIwv6JCG8gTK/ZcP1umP4NCM6WZFb98BsnDoiFIgIDAbNxnE8dYybaaOw 5tXs1C1gklDiHlDANU2u7xvr75Gou5oQm/l7pJvZeOUYULaSgmxFNa7XnW2ja4Q+Oa3z //lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kBv5Z5er; 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 x6si5368604ybq.233.2021.02.18.02.05.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Feb 2021 02:05:36 -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=kBv5Z5er; 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]:52208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCgBj-00030X-Lt for patch@linaro.org; Thu, 18 Feb 2021 05:05:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCfzX-0004Yz-Vz for qemu-devel@nongnu.org; Thu, 18 Feb 2021 04:53:00 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:45138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lCfzW-00012K-6n for qemu-devel@nongnu.org; Thu, 18 Feb 2021 04:52:59 -0500 Received: by mail-wr1-x42e.google.com with SMTP id f7so1051259wrt.12 for ; Thu, 18 Feb 2021 01:52:55 -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=3UFgwBYMWW+cA/Y1jKLdTryuQ+jpOBq3LyRLsc4984U=; b=kBv5Z5erlb5fnJAVUkisVYukR44IXiXmtMmw4AcoPbVgQ16u6e0W+m//x/+d7ckobe BvJ3YpUsGpGd/J+vekJ0jC8R6yMgSC5LYKU2y0YgPOuq9lzZKQUP4LA6NtYYRGZ1o9Ri mGPx5jTYZaZyHPtkheLJTltRqAaJcuqjEwICaOT0uA5nQVbWWLazDo/plk5m431Mxay5 76RHpXlmgRKZeBZdcQFfbDIKrQ8NQC95XdMv9RGc9l01xhEDmyjZH4YGC9ah7xzyLtIT yPtaiYxY3K7x5Oxz9z0usApkEmUJWdqJXEe0KAHebt4UY+scia5UTWjaCHz2b8WDWnt1 oaAA== 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=3UFgwBYMWW+cA/Y1jKLdTryuQ+jpOBq3LyRLsc4984U=; b=UkUjpeMe581q93iew9qby6lBvJGjORQtqyxtKnXapx8HDaZSL2tY4q70iWMc4iVNqk BETb9p1ZurqD/DpOjitu+8HpMrJPynaHvaia16uxMBXu/UQ0rJGIiPjo3pkdHqPug3Bv 5auato4JAHrtfRlUN3vcp5b/jsx3tqQRcflMX1x17V0648Sonr/V7ESvmqp8E/aaYZ1u 3rydwVQMR5l+erLrlIETRdqzvba92UT4qaypfSMXj7mm3PdDuLATvQNCkuc3ucnimRaL b9lLqhMJXeZri15U19vV7+dREoMp5oEZK647oRdadywCL1Hlrs+ZhobpAPcRE5QFcB+b JUfg== X-Gm-Message-State: AOAM532xwHEdVsIOtBqrQwmJpToeSlgqjkNjeoueydBSvwcWwYlCtpdH f09+n2DkGw8zOfcXMfpM0zLRHQ== X-Received: by 2002:a5d:6d06:: with SMTP id e6mr3517185wrq.425.1613641974578; Thu, 18 Feb 2021 01:52:54 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v15sm8140158wra.61.2021.02.18.01.52.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Feb 2021 01:52:52 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2D0F41FFAE; Thu, 18 Feb 2021 09:47:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 23/23] tests/acceptance: add a memory callback check Date: Thu, 18 Feb 2021 09:47:06 +0000 Message-Id: <20210218094706.23038-24-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::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.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" This test makes sure that the inline and callback based memory checks count the same number of accesses. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210213130325.14781-24-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/acceptance/tcg_plugins.py b/tests/acceptance/tcg_plugins.py index b1ba10498f..c21bf9e52a 100644 --- a/tests/acceptance/tcg_plugins.py +++ b/tests/acceptance/tcg_plugins.py @@ -115,3 +115,34 @@ def test_aarch64_virt_insn_icount(self): 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") + + def test_aarch64_virt_mem_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/libmem.so,arg=both", 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.findall(br"mem accesses: (?P\d+)", s) + if m is None or len(m) != 2: + self.fail("no memory access counts found") + else: + inline = int(m[0]) + callback = int(m[1]) + if inline != callback: + self.fail("mismatched access counts")