From nobody Wed Feb 11 01:00:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1613222606; cv=none; d=zohomail.com; s=zohoarc; b=T/Hqm5sOplb4I8vTEAEAvlix5szOatP8xdcu1Ko4iVCb8WE9KXS/mcQGGsO31xr/0GVWsm35My4tvo5zPuQSXjNx1MhZGKcmiu5hoCqZuYJpic75X8acDbDrsTNMxetZ1XWq771oQgV1aGQeJfcrnewephIfqfM4r/DJG/u+Dv0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613222606; 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=O1aw1h3jqxc44ee8O7RKBgZtgO/tTqSNqOcENiGbAYw=; b=OARJWCpOxqxtLl3ERnXMcTL9Lk2kb5eVXzbfkwD8nNT8s4Q8AGCulNrqaLQ3zmK+FQFwZFewITyI8TduedLmVFCXPdPHx/3Oxvvv90Sc8d/gCOognjOL3c8nX9g/IC5vmgRoQTWB7e+AuQmEBtFTIs/IElzJaw20aSkkgjkd/6o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=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 1613222606418958.783628435766; Sat, 13 Feb 2021 05:23:26 -0800 (PST) Received: from localhost ([::1]:54814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lAutR-0007Zv-A6 for importer@patchew.org; Sat, 13 Feb 2021 08:23:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAuaa-0002At-ON for qemu-devel@nongnu.org; Sat, 13 Feb 2021 08:03:56 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:38391) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lAuaW-0006A3-19 for qemu-devel@nongnu.org; Sat, 13 Feb 2021 08:03:56 -0500 Received: by mail-wr1-x429.google.com with SMTP id b3so2917927wrj.5 for ; Sat, 13 Feb 2021 05:03:51 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id u14sm15773579wro.10.2021.02.13.05.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Feb 2021 05:03:41 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B50AC1FFAE; Sat, 13 Feb 2021 13:03:27 +0000 (GMT) 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=O1aw1h3jqxc44ee8O7RKBgZtgO/tTqSNqOcENiGbAYw=; b=s+1dlk89Hznn+UVnG+y+uYiS5xaiFbExzPo5L/KN4P5+wzHQDJCfbpMBG+Wm+GHmms y5KIPvpNBd5UbKtbl3bobvC2JptgkKrGQxv2xDYIkS5JYgb5y7StZns58brxsHC1osXm vuOGVH2HfRtaC16PtA7U/SehZALVdx+CLfQ7nihxWZDUb+M1k8escEo/E9snaQYJfU9U bT4a0YvTX+CnJGmZpKm7mDJKpjzBcrWF6OJhVrcDMco47gvSqvJ+QxwrCZJ89HEUKewT efEmAMXQplZ+xv9jOelFyaISoRRQj/tar/CIMOmjrdnyIVforTasgSCa8q2UiTWBKOFh sZhg== 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=O1aw1h3jqxc44ee8O7RKBgZtgO/tTqSNqOcENiGbAYw=; b=IRGbQvoUvvHMyBSfloQzf0EVHm1IDhG6t1Zkcz5YZdpFIuIxLvaDcYBUY4s/i8r3CC MeS08NXmBP+7uersUIQMu+WoAlEbI8RoyG82o7o1GRCFaOLLEg+ShDLe3iG4/u6h7SXZ 75pIP7I20v84aUXgx4dbORVngghDymPk5kfSJxhqqS8ZfTcQY/Xkz30vvgTPKovyvD9V noOXaX7tprL3QIfWUSI2KeC+ycjUlL61b3wjTnq5Cr1xL5Rssmrcvf4VUc+trsQGO5rN kLuHbbK9wk3krBr3PRZwTS9yhvaQuC9cuLTGnpr16Ud1n/mqg+A64J6ZfmZs2UCgolNo IrEA== X-Gm-Message-State: AOAM5336A4qVV0xUQRwzEeyXGCR2eP+28GQChGu+9SIIliFcMZQe4GSd +9ihF9XAA0u6TKIQTdNBfo+vQA== X-Google-Smtp-Source: ABdhPJwKiED3TKL4itE9DaNPDbVNVOZZBdZ8lqyuLt0pypxelVGTcsx807U77EHu7tvQHx9HL0pkaw== X-Received: by 2002:a05:6000:242:: with SMTP id m2mr8654268wrz.422.1613221430813; Sat, 13 Feb 2021 05:03:50 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 23/23] tests/acceptance: add a memory callback check Date: Sat, 13 Feb 2021 13:03:25 +0000 Message-Id: <20210213130325.14781-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210213130325.14781-1-alex.bennee@linaro.org> References: <20210213130325.14781-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.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?Philippe=20Mathieu-Daud=C3=A9?= , robhenry@microsoft.com, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, Wainer dos Santos Moschetta , Cleber Rosa , kuhn.chenqun@huawei.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This test makes sure that the inline and callback based memory checks count the same number of accesses. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/acceptance/tcg_plugins.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) 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 @@ class PluginKernelNormal(PluginKernelBase): m =3D re.search(br"detected repeat execution @ (?P0x[0-9= A-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=3Daccel:tcg + :avocado: tags=3Darch:aarch64 + :avocado: tags=3Dmachine:virt + :avocado: tags=3Dcpu:cortex-a57 + """ + kernel_path =3D self._grab_aarch64_kernel() + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'console=3DttyAMA0') + console_pattern =3D 'Kernel panic - not syncing: VFS:' + + plugin_log =3D tempfile.NamedTemporaryFile(mode=3D"r+t", prefix=3D= "plugin", + suffix=3D".log") + + self.run_vm(kernel_path, kernel_command_line, + "tests/plugin/libmem.so,arg=3Dboth", plugin_log.name, + console_pattern, + args=3D('-cpu', 'cortex-a53', '-icount', 'shift=3D1')) + + with plugin_log as lf, \ + mmap.mmap(lf.fileno(), 0, access=3Dmmap.ACCESS_READ) as s: + m =3D re.findall(br"mem accesses: (?P\d+)", s) + if m is None or len(m) !=3D 2: + self.fail("no memory access counts found") + else: + inline =3D int(m[0]) + callback =3D int(m[1]) + if inline !=3D callback: + self.fail("mismatched access counts") --=20 2.20.1