From patchwork Tue Feb 9 18:27:36 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: 379365 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp483043jah; Tue, 9 Feb 2021 10:28:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxjDHOY7GI1VCn2AYvZN+CSBRWG5Y3vp4fMgb5l1gJTrVLx5kpQNNkwZ1SjdSjLLDDRZvl8 X-Received: by 2002:a25:cc8f:: with SMTP id l137mr33422571ybf.144.1612895286790; Tue, 09 Feb 2021 10:28:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612895286; cv=none; d=google.com; s=arc-20160816; b=iEpWU/W790TduEP24D56jg/WbFETSbQAi5vhLJRDqdt3hypz+vIZekZa/K5dwck7nG ok5r91akyaBgCkkHy0XahmdklMCr0ZxZXZwcK0T6CxnIMfcOPnwyAb41xd6BFbyOvnVD YxpozqPOgmBqKPJp0ZZyec2ZMaq1ee50vTb8MpiocNYj7pLlXEQE+DFr9U7GOH9ZJZvs FZ1OZ2RutesMQaW3vgen2bTCsDkMqzS+xuWNzi+wjNZaNk+FGsU+MrguGZPWNQFnvKPB Is120GhKSTK2HYt+Ey0PLHSWMRYasygEfdL/XaNmNdztDCqObOcJ/S5UWjoviCcc0iOE 8acg== 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:message-id:date:subject:to:from:dkim-signature; bh=5R1e9GR/GLdG/klE7zT/bf5QWdvO/X/18117WqldYxM=; b=uiQhEqsJ1lfzDpQSdLvj6LtlKkxs+t8HRsNrHt5hFFD595fFnA8uJxqVschBc+Bthq DsqCHuvJLKd4PIGl3S0qRka/0D7T1DL+HpnZJ81Quvd4poZWA1IFwqmyhNzAUlyWNgS6 PpFiC41cIwyr4RCVr9FHgG+rRk2Al20cjezSYKD3dmjRYxyE5wcw1OK3XmbyIg5C2JLo M79rRZkqhublaYPL4Zuov45tAdN/Gew2PXJ6ndoxIFrEPgkZqXR/+qAanAMDrjG4/+tU CZomIUoZ99IzGg2uxASVOl99oGgpD+1k6lMWk42+DyzMM1PsS7vp5Kk2AcI4SuPleH7u 2HLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="RoJZ/Wvd"; 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 v7si21401961ybk.294.2021.02.09.10.28.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Feb 2021 10:28:06 -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="RoJZ/Wvd"; 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]:57410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9Xk6-0002j7-6o for patch@linaro.org; Tue, 09 Feb 2021 13:28:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Xju-0002g0-7E for qemu-devel@nongnu.org; Tue, 09 Feb 2021 13:27:54 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:37630) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l9Xjs-0007kx-Gh for qemu-devel@nongnu.org; Tue, 09 Feb 2021 13:27:53 -0500 Received: by mail-wm1-x332.google.com with SMTP id m1so4453225wml.2 for ; Tue, 09 Feb 2021 10:27:52 -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:mime-version :content-transfer-encoding; bh=5R1e9GR/GLdG/klE7zT/bf5QWdvO/X/18117WqldYxM=; b=RoJZ/WvdabsZhnP+eFDDeN06q5haBA+jhMcuds1lNfJtSohU23h7LTRERw8rEaobyR abpnJF92kWFpa81KL1zToZDq8zD5gVmm9Ox/SG+keQ5NyVrGBMdW6+0SFROsnkCgrm7r B7358U923TlOsI6esJ+BFGPKwqMtOWMDndNFNBJjVtZUJ+BtSRaCQ0cEiGRWx6OHaHeE h71lGRaiileLRlJuwn53obQbELqWAdUtPEaWKHF30eNyJqwb5J3+bhYA3cmtkjjwYJbd 6V4TNx8lCFvAdpQi1oPVDHswoSZULsjp5jfL6djYLR9ecZsyy8iZoiYibGIah1gLZoBX USfA== 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:mime-version :content-transfer-encoding; bh=5R1e9GR/GLdG/klE7zT/bf5QWdvO/X/18117WqldYxM=; b=OCWLfBh9HaEgyXJWvV1tyEyydcTxx1egPnqAkWhhjEX/Ec5vi6Iue1VhZXpppXK0S5 UWJNvdwcebFsVxPhrJbdbLzxtED9z4gwYTd+UzrmiK0Gb2a3CFXq2/ln9K02iVOu1noQ BS1S/JUlC39VtmHjhWStxUT8Y1t3wvxSbszXITBnR9rBya0JWfApiD9dKED5q9qTFEmx GdKF4B/oiefxXT9fKfsfYopDksyk7zOF6MM8yTmekbmn7ToBItOUaknkWfPyAbf4NDp5 B8FkEsGLvsfe6F1UW2mcph/3em75XLBlWX5EhVft+HhURxoy1NAK95jzjHO8jd4th6zR SPQQ== X-Gm-Message-State: AOAM533+iy0hqBKj9bpf/OcEhq07CSe0ttel2RcCamwyhhUD3DPUWlw6 mM1VCcht1uWV/n3X6Cc4LuISHg== X-Received: by 2002:a05:600c:216:: with SMTP id 22mr4545410wmi.111.1612895270881; Tue, 09 Feb 2021 10:27:50 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id w4sm37707841wrt.69.2021.02.09.10.27.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 10:27:49 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2EB881FF7E; Tue, 9 Feb 2021 18:27:49 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags Date: Tue, 9 Feb 2021 18:27:36 +0000 Message-Id: <20210209182749.31323-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.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: kuhn.chenqun@huawei.com, aaron@os.amperecomputing.com, cota@braap.org, =?utf-8?q?Alex_Benn=C3=A9e?= , robhenry@microsoft.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Hi, Aaron reported an issue with TCG plugins when interacting with the cpu_io_recompile code during icount. The ultimate fix was to avoid instrumenting the re-executed block but along the way we clean-up a bunch of the code by getting rid of CF_NOCACHE. I've also included Richard's recently posted recompile hook cleanups at the start of the series because it makes the improves the diffstat by pushing more arch specific black magic to the targets. In fact without the additional tests this removes more code than it adds ;-) I've added some acceptance tests to detect the failure mode as well as manually testing with a test Peter had lying around that exercises the trixy "executing out of MMIO" code path which I've touched. Please test and review. Alex Bennée (8): tests/plugin: expand insn test to detect duplicate instructions tests/acceptance: add a new set of tests to exercise plugins accel/tcg: actually cache our partial icount TB accel/tcg: cache single instruction TB on pending replay exception accel/tcg: re-factor non-RAM execution code accel/tcg: remove CF_NOCACHE and special cases accel/tcg: allow plugin instrumentation to be disable via cflags tests/acceptance: add a new tests to detect counting errors Richard Henderson (4): exec: Move TranslationBlock typedef to qemu/typedefs.h accel/tcg: Create io_recompile_replay_branch hook target/mips: Create mips_io_recompile_replay_branch target/sh4: Create superh_io_recompile_replay_branch include/exec/exec-all.h | 6 +- include/exec/tb-context.h | 1 - include/hw/core/cpu.h | 4 +- include/hw/core/tcg-cpu-ops.h | 13 +++- include/qemu/typedefs.h | 1 + target/arm/internals.h | 3 +- accel/tcg/cpu-exec.c | 62 ++++----------- accel/tcg/translate-all.c | 128 +++++++++++------------------- accel/tcg/translator.c | 2 +- target/cris/translate.c | 2 +- target/lm32/translate.c | 2 +- target/mips/cpu.c | 18 +++++ target/moxie/translate.c | 2 +- target/sh4/cpu.c | 18 +++++ target/unicore32/translate.c | 2 +- tests/plugin/insn.c | 12 ++- tests/acceptance/tcg_plugins.py | 134 ++++++++++++++++++++++++++++++++ 17 files changed, 263 insertions(+), 147 deletions(-) create mode 100644 tests/acceptance/tcg_plugins.py -- 2.20.1