From patchwork Tue Jun 2 15:46:16 2020 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: 11584027 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 820F21391 for ; Tue, 2 Jun 2020 15:47:50 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4928B20772 for ; Tue, 2 Jun 2020 15:47:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="RljLo1pd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4928B20772 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:60936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jg98n-0005O5-Ck for patchwork-qemu-devel@patchwork.kernel.org; Tue, 02 Jun 2020 11:47:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jg97Z-0003YH-5V for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:33 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:35790) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jg97X-0007cy-HP for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:32 -0400 Received: by mail-wr1-x42f.google.com with SMTP id x14so3922496wrp.2 for ; Tue, 02 Jun 2020 08:46:31 -0700 (PDT) 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=t6TltwBrO/H4+UuBeh2Az6/wBriymiMCvdLIFdXcB4g=; b=RljLo1pdf3OqzU5sQEILvMRC3HtYYRvb6n/s/kKx+yJjFe92RZjHd1wdq+s6+0Tm6S BEITY3AnNJmyB/WGJIgKb1syAVnR40dbQDHF/mQpIa4aVLN7CDq+IGqmgUCgn/wVIMxg CQ2EcxsvrmsxLWAsdNAErqFCcGPfYjFsNFoCKQkxIj5ZRYZ+x0md+/VGFBjwg7gzgdXP Z6nIWIiicQPAaal6T3P5xDkjGdpShYTqIg1NEMo/y2I7GdWVA+k4Bmt9QLbiBgOtAEJE MPC/664jY+XnHjLdN71ngrrsjk/rbQC8DTrMsXwJLgWQOHcgBYWS6u7goEzy5sjQNu2s XqIg== 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=t6TltwBrO/H4+UuBeh2Az6/wBriymiMCvdLIFdXcB4g=; b=O5JAzQK2nVC9ptnWyw8bPVe6YDqmYyb3Zh/xmUgNMnyTKkBpSZk1DOgnG+zpk9Wq8+ 0wFdDsaqdRY2n4GzqJdym3TFq6UU8gL/uMz4V93Fu8zWFlvpYF956umEUEkVaRSR1wjQ fHqfftcOC5BB6whtf4thKPxBW4RljWZ4srcpB9TOdVCWxZIDW/UiPkiICpSgp/33MjzQ ZXdx0dmhIY4wQmsDeoP9MsW/q+a+4CusxFKWKfrqmXOl1BpWH0THyKeZ9NzUdMAwqh2C wI5CgFixEwGWxLrOXnH8y/tshAMx/p+k3zxCS6/dkv9yWB4sfjJKUVfudr2BEfDTBvnb Pmww== X-Gm-Message-State: AOAM532oYa4lmwbLPTj1kartpTjbzMPHkRBS/W5KzFq6QVr34px1Zp7e RhRGEPAOacZqCmu7IGfx5rcuUA== X-Google-Smtp-Source: ABdhPJygOmGT/kZ27UPDtuBAB/ETxnRVlrkfD8pOq8lp1A/q3N9sim91Q9yirt3gmd5e5rFfQr3tgA== X-Received: by 2002:a5d:6586:: with SMTP id q6mr25124055wru.319.1591112790038; Tue, 02 Jun 2020 08:46:30 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id r11sm4520738wre.25.2020.06.02.08.46.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 08:46:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 55E621FF87; Tue, 2 Jun 2020 16:46:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 1/9] plugins: new lockstep plugin for debugging TCG changes Date: Tue, 2 Jun 2020 16:46:16 +0100 Message-Id: <20200602154624.4460-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200602154624.4460-1-alex.bennee@linaro.org> References: <20200602154624.4460-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: robert.foley@linaro.org, Mark Cave-Ayland , Richard Henderson , robhenry@microsoft.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" When we make changes to the TCG we sometimes cause regressions that are deep into the execution cycle of the guest. Debugging this often requires comparing large volumes of trace information to figure out where behaviour has diverged. The lockstep plugin utilises a shared socket so two QEMU's running with the plugin will write their current execution position and wait to receive the position of their partner process. When execution diverges the plugins output where they were and the previous few blocks before unloading themselves and letting execution continue. Originally I planned for this to be most useful with -icount but it turns out you can get divergence pretty quickly due to asynchronous qemu_cpu_kick_rr_cpus() events causing one side to eventually run into a short block a few cycles before the other side. For this reason I've added a bit of tracking and I think the divergence reporting could be finessed to report only if we really start to diverge in execution. An example run would be: qemu-system-sparc -monitor none -parallel none -net none \ -M SS-20 -m 256 -kernel day11/zImage.elf \ -plugin ./tests/plugin/liblockstep.so,arg=lockstep-sparc.sock \ -d plugin,nochain with an identical command in another window in the same working directory. Signed-off-by: Alex Bennée Cc: Richard Henderson Cc: Mark Cave-Ayland Message-Id: <20200429200754.18327-1-alex.bennee@linaro.org> --- v3 - added verbose flag - basic heuristics to detect "real" divergence - checkpatch tweaks --- tests/plugin/lockstep.c | 340 ++++++++++++++++++++++++++++++++++++++ tests/plugin/Makefile | 1 + tests/tcg/Makefile.target | 2 +- 3 files changed, 342 insertions(+), 1 deletion(-) create mode 100644 tests/plugin/lockstep.c diff --git a/tests/plugin/lockstep.c b/tests/plugin/lockstep.c new file mode 100644 index 00000000000..a696673dff3 --- /dev/null +++ b/tests/plugin/lockstep.c @@ -0,0 +1,340 @@ +/* + * Lockstep Execution Plugin + * + * Allows you to execute two QEMU instances in lockstep and report + * when their execution diverges. This is mainly useful for developers + * who want to see where a change to TCG code generation has + * introduced a subtle and hard to find bug. + * + * Caveats: + * - single-threaded linux-user apps only with non-deterministic syscalls + * - no MTTCG enabled system emulation (icount may help) + * + * While icount makes things more deterministic it doesn't mean a + * particular run may execute the exact same sequence of blocks. An + * asynchronous event (for example X11 graphics update) may cause a + * block to end early and a new partial block to start. This means + * serial only test cases are a better bet. -d nochain may also help. + * + * This code is not thread safe! + * + * Copyright (c) 2020 Linaro Ltd + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; + +/* saved so we can uninstall later */ +static qemu_plugin_id_t our_id; + +static unsigned long bb_count; +static unsigned long insn_count; + +/* Information about a translated block */ +typedef struct { + uint64_t pc; + uint64_t insns; +} BlockInfo; + +/* Information about an execution state in the log */ +typedef struct { + BlockInfo *block; + unsigned long insn_count; + unsigned long block_count; +} ExecInfo; + +/* The execution state we compare */ +typedef struct { + uint64_t pc; + unsigned long insn_count; +} ExecState; + +typedef struct { + GSList *log_pos; + int distance; +} DivergeState; + +/* list of translated block info */ +static GSList *blocks; + +/* execution log and points of divergence */ +static GSList *log, *divergence_log; + +static int socket_fd; +static char *path_to_unlink; + +static bool verbose; + +static void plugin_cleanup(qemu_plugin_id_t id) +{ + /* Free our block data */ + g_slist_free_full(blocks, &g_free); + g_slist_free_full(log, &g_free); + g_slist_free(divergence_log); + + close(socket_fd); + if (path_to_unlink) { + unlink(path_to_unlink); + } +} + +static void plugin_exit(qemu_plugin_id_t id, void *p) +{ + g_autoptr(GString) out = g_string_new("No divergence :-)\n"); + g_string_append_printf(out, "Executed %ld/%d blocks\n", + bb_count, g_slist_length(log)); + g_string_append_printf(out, "Executed ~%ld instructions\n", insn_count); + qemu_plugin_outs(out->str); + + plugin_cleanup(id); +} + +static void report_divergance(ExecState *us, ExecState *them) +{ + DivergeState divrec = { log, 0 }; + g_autoptr(GString) out = g_string_new(""); + bool diverged = false; + + /* + * If we have diverged before did we get back on track or are we + * totally loosing it? + */ + if (divergence_log) { + DivergeState *last = (DivergeState *) divergence_log->data; + GSList *entry; + + for (entry = log; g_slist_next(entry); entry = g_slist_next(entry)) { + if (entry == last->log_pos) { + break; + } + divrec.distance++; + } + + /* + * If the last two records are so close it is likely we will + * not recover synchronisation with the other end. + */ + if (divrec.distance == 1 && last->distance == 1) { + diverged = true; + } + } + divergence_log = g_slist_prepend(divergence_log, + g_memdup(&divrec, sizeof(divrec))); + + /* Output short log entry of going out of sync... */ + if (verbose || divrec.distance == 1 || diverged) { + g_string_printf(out, "@ %#016lx vs %#016lx (%d/%d since last)\n", + us->pc, them->pc, g_slist_length(divergence_log), + divrec.distance); + qemu_plugin_outs(out->str); + } + + if (diverged) { + int i; + GSList *entry; + + g_string_printf(out, "Δ insn_count @ %#016lx (%ld) vs %#016lx (%ld)\n", + us->pc, us->insn_count, them->pc, them->insn_count); + + for (entry = log, i = 0; + g_slist_next(entry) && i < 5; + entry = g_slist_next(entry), i++) { + ExecInfo *prev = (ExecInfo *) entry->data; + g_string_append_printf(out, + " previously @ %#016lx/%ld (%ld insns)\n", + prev->block->pc, prev->block->insns, + prev->insn_count); + } + qemu_plugin_outs(out->str); + qemu_plugin_outs("too much divergence... giving up."); + qemu_plugin_uninstall(our_id, plugin_cleanup); + } +} + +static void vcpu_tb_exec(unsigned int cpu_index, void *udata) +{ + BlockInfo *bi = (BlockInfo *) udata; + ExecState us, them; + ssize_t bytes; + ExecInfo *exec; + + us.pc = bi->pc; + us.insn_count = insn_count; + + /* + * Write our current position to the other end. If we fail the + * other end has probably died and we should shut down gracefully. + */ + bytes = write(socket_fd, &us, sizeof(ExecState)); + if (bytes < sizeof(ExecState)) { + qemu_plugin_outs(bytes < 0 ? + "problem writing to socket" : + "wrote less than expected to socket"); + qemu_plugin_uninstall(our_id, plugin_cleanup); + return; + } + + /* + * Now read where our peer has reached. Again a failure probably + * indicates the other end died and we should close down cleanly. + */ + bytes = read(socket_fd, &them, sizeof(ExecState)); + if (bytes < sizeof(ExecState)) { + qemu_plugin_outs(bytes < 0 ? + "problem reading from socket" : + "read less than expected"); + qemu_plugin_uninstall(our_id, plugin_cleanup); + return; + } + + /* + * Compare and report if we have diverged. + */ + if (us.pc != them.pc) { + report_divergance(&us, &them); + } + + /* + * Assume this block will execute fully and record it + * in the execution log. + */ + insn_count += bi->insns; + bb_count++; + exec = g_new0(ExecInfo, 1); + exec->block = bi; + exec->insn_count = insn_count; + exec->block_count = bb_count; + log = g_slist_prepend(log, exec); +} + +static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +{ + BlockInfo *bi = g_new0(BlockInfo, 1); + bi->pc = qemu_plugin_tb_vaddr(tb); + bi->insns = qemu_plugin_tb_n_insns(tb); + + /* save a reference so we can free later */ + blocks = g_slist_prepend(blocks, bi); + qemu_plugin_register_vcpu_tb_exec_cb(tb, vcpu_tb_exec, + QEMU_PLUGIN_CB_NO_REGS, (void *)bi); +} + + +/* + * Instead of encoding master/slave status into what is essentially + * two peers we shall just take the simple approach of checking for + * the existence of the pipe and assuming if it's not there we are the + * first process. + */ +static bool setup_socket(const char *path) +{ + struct sockaddr_un sockaddr; + int fd; + + fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (fd < 0) { + perror("create socket"); + return false; + } + + sockaddr.sun_family = AF_UNIX; + g_strlcpy(sockaddr.sun_path, path, sizeof(sockaddr.sun_path) - 1); + if (bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) { + perror("bind socket"); + close(fd); + return false; + } + + /* remember to clean-up */ + path_to_unlink = g_strdup(path); + + if (listen(fd, 1) < 0) { + perror("listen socket"); + close(fd); + return false; + } + + socket_fd = accept(fd, NULL, NULL); + if (socket_fd < 0 && errno != EINTR) { + perror("accept socket"); + return false; + } + + qemu_plugin_outs("setup_socket::ready\n"); + + return true; +} + +static bool connect_socket(const char *path) +{ + int fd; + struct sockaddr_un sockaddr; + + fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (fd < 0) { + perror("create socket"); + return false; + } + + sockaddr.sun_family = AF_UNIX; + g_strlcpy(sockaddr.sun_path, path, sizeof(sockaddr.sun_path) - 1); + + if (connect(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) { + perror("failed to connect"); + return false; + } + + qemu_plugin_outs("connect_socket::ready\n"); + + socket_fd = fd; + return true; +} + +static bool setup_unix_socket(const char *path) +{ + if (g_file_test(path, G_FILE_TEST_EXISTS)) { + return connect_socket(path); + } else { + return setup_socket(path); + } +} + + +QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, + const qemu_info_t *info, + int argc, char **argv) +{ + int i; + + if (!argc || !argv[0]) { + qemu_plugin_outs("Need a socket path to talk to other instance."); + return -1; + } + + for (i = 0; i < argc; i++) { + char *p = argv[i]; + if (strcmp(p, "verbose") == 0) { + verbose = true; + } else if (!setup_unix_socket(argv[0])) { + qemu_plugin_outs("Failed to setup socket for communications."); + return -1; + } + } + + our_id = id; + + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); + return 0; +} diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile index 75467b6db85..b3250e2504c 100644 --- a/tests/plugin/Makefile +++ b/tests/plugin/Makefile @@ -13,6 +13,7 @@ NAMES += mem NAMES += hotblocks NAMES += howvec NAMES += hotpages +NAMES += lockstep SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES))) diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index b3cff3cad1a..075daf3d22d 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -128,7 +128,7 @@ RUN_TESTS=$(patsubst %,run-%, $(TESTS)) ifeq ($(CONFIG_PLUGIN),y) PLUGIN_DIR=../../plugin VPATH+=$(PLUGIN_DIR) -PLUGINS=$(notdir $(wildcard $(PLUGIN_DIR)/*.so)) +PLUGINS=$(filter-out liblockstep.so,$(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 From patchwork Tue Jun 2 15:46:17 2020 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: 11584023 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C9233618 for ; Tue, 2 Jun 2020 15:47:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A008620674 for ; Tue, 2 Jun 2020 15:47:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hbzcYpCU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A008620674 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:60566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jg98Z-0005Ce-TE for patchwork-qemu-devel@patchwork.kernel.org; Tue, 02 Jun 2020 11:47:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jg97W-0003VY-62 for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:30 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:46555) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jg97V-0007cR-AF for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:29 -0400 Received: by mail-wr1-x42b.google.com with SMTP id x6so3854097wrm.13 for ; Tue, 02 Jun 2020 08:46:28 -0700 (PDT) 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=tRdpUcQhIJndhkGIh7lOShh9mZ16AUqZ+rVZ66b8A6w=; b=hbzcYpCUBmW9hGtiScsLFOc8rCdSX33sD+5yGjR3d/hakP7Dc2CujLcUgKrcLxgKfD LISb7wlPAWtpBCVtu+Q4nBIKCN0pk6nt6vWl1sbPw+/QfGy4NDAX/sy7mGskFkW/g7ka q4Q6WlNI7DuVcVDdG6pUv/+t3fXg2A6osRSMTmhCR7LkeXjC3uTCms2rrO3dsEfDFUop 2ZyfKmWCb1PU13u2XKMMT8fdElrdwlWKySdBZWqltjYIAU8DPt+zW9No3U5Gb01azrX6 xBdrHVxDpsyv+AytJZwbbAKEqsFyGQ6H0Be9JuDwtblqgEU4ZejEj0EVIdZLm+TvuMEk Tv0Q== 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=tRdpUcQhIJndhkGIh7lOShh9mZ16AUqZ+rVZ66b8A6w=; b=FrUFaQTlx9FSRXF1TcukSW3WiA+hIm18zOD9N9SFrXzlR8rWAmwom5yu46Ih9ppzkk CEnYymfnW5CsndUotL9Ba+Tt+YL/+2Ea6qCjrYRfn9a1EuLR6yDZbuyFi9MqBiJ1icwN YWmOgcGHHbdCWZMyHI9vRp072lSgqvN7FKp+KHq5oSKvpn4Rge6uSDWUY3CCL+qjl3zs FSjDI5cRbR02hpwIwCnKhe+WDqWkIe2i1u++DUy0QcnEuAflyvijuAJHfOQwhz4jYflP vuXiQYbTPuyd+/hq4frqkeYNWuGNE1Mdn1duif+OhGR21Ft1VXyip/xMOU3fXqkmluET j0YQ== X-Gm-Message-State: AOAM532ufYQlFlHvRiYrP6PJc57C5nkSHOchPZm1n2PlFYRudGDWQieH IHH6PSoYX9tBkxtJDmGlM5EmGA== X-Google-Smtp-Source: ABdhPJyDJQUcrFzr8SRiQOXcycxkWmsCGfRviuRi4k6fuxh5F+lC7mMtLdYajd29rtj+UkOzk8LUFw== X-Received: by 2002:adf:e749:: with SMTP id c9mr29200751wrn.25.1591112787738; Tue, 02 Jun 2020 08:46:27 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s5sm120100wme.37.2020.06.02.08.46.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 08:46:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6AF731FF8C; Tue, 2 Jun 2020 16:46:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 2/9] qemu-plugin.h: add missing include to define size_t Date: Tue, 2 Jun 2020 16:46:17 +0100 Message-Id: <20200602154624.4460-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200602154624.4460-1-alex.bennee@linaro.org> References: <20200602154624.4460-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: robert.foley@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , robhenry@microsoft.com, aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20200524202427.951784-1-cota@braap.org> --- include/qemu/qemu-plugin.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 89ed579f559..bab8b0d4b3a 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -12,6 +12,7 @@ #include #include +#include /* * For best performance, build the plugin with -fvisibility=hidden so that From patchwork Tue Jun 2 15:46:18 2020 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: 11584033 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7BEFE1391 for ; Tue, 2 Jun 2020 15:49:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5242E207D8 for ; Tue, 2 Jun 2020 15:49:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="CPl2hDcB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5242E207D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jg9Ak-0000S5-IQ for patchwork-qemu-devel@patchwork.kernel.org; Tue, 02 Jun 2020 11:49:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jg97X-0003W1-80 for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:31 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:32797) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jg97W-0007cm-C8 for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:30 -0400 Received: by mail-wr1-x441.google.com with SMTP id l11so3930874wru.0 for ; Tue, 02 Jun 2020 08:46:29 -0700 (PDT) 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=QSCo20FpmcSa9pqRC9AwXDY8+utkLNtj0/ksS5sWNSA=; b=CPl2hDcBqDkH8YckenHJHDWIKS2aLw0vI3NKfQGRwbEkNP1HZQG78k8XORGUwMWHgi fG9OEsGzpY2BWMW/2Z+boNgBwi5De/OAlQxlHH7alUoZXu6w6JJesZh+1I0yZtAq/P34 hhkHl3PsPxgj2+OIwwJl7zu4xprDwaLGn7Q0ymUYdgJTiX4LvczRb33ydePABlkcGC0d wGx67xXUXGZVss4x+btdUUGq7iQhB2O4BfCaUJ6Eoz8JIgm4+qoSqZVFU8eqj3DRlC7O s0lhH1hDMK1n6d4IVeCu54rq2jV0zUM+CUr97OeNIbwPvLOz9Zsugm9CDffg3LX09m5f Ht8A== 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=QSCo20FpmcSa9pqRC9AwXDY8+utkLNtj0/ksS5sWNSA=; b=UoQXqp8yMw5P/jLK9mt9oz4j+65v+n/AL0ViGjHkVLJG03vB8L/TDnsGY19ryEQzER F/qA/lgGXdO7ZCFvNSJSmhYzG9gju4dm+KjbQMIHqdm80I/22KJ+O6oeJ6kQbr9Or5LD awEwT7IrwWMstNF9QHWzASgdzUBkFhQDtZ+rEwwRHewk0wcx3mDLM+Ns0WMm0cLZdRpb WwhhDg+BVdz1kovOVzO0Rn2r4GZlML9GZGz6swZbVkpeFYRmpUnybPO1hYVQ+kGiqCSp KctNs1J59syHQ2/q2Zvi3fmV/y678TFkdRc1TFAJDXL4HiSNOGtUEuEh9y/69n65MLsL Nsxg== X-Gm-Message-State: AOAM533Np0DNECI9bajZEh859UoTekiqFqp1WMzEWEwPBm0L6lYDtqKD x+dRYd7yPns1dB4StlbsmUXnmw== X-Google-Smtp-Source: ABdhPJySCeji1fTkNCIPcDpNZxe8XdwV6Ty9YuadGok7QwzK3DnDooR53ACTbfDVIIgA5AdY0hyKMA== X-Received: by 2002:a5d:4008:: with SMTP id n8mr26269887wrp.82.1591112788931; Tue, 02 Jun 2020 08:46:28 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id d17sm5003905wrg.75.2020.06.02.08.46.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 08:46:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 82B1A1FF8F; Tue, 2 Jun 2020 16:46:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 3/9] scripts/clean-includes: Mark 'qemu/qemu-plugin.h' as special header Date: Tue, 2 Jun 2020 16:46:18 +0100 Message-Id: <20200602154624.4460-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200602154624.4460-1-alex.bennee@linaro.org> References: <20200602154624.4460-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: robert.foley@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , robhenry@microsoft.com, aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé "qemu/qemu-plugin.h" isn't meant to be include by QEMU codebase, but by 3rd party plugins that QEMU can use. These plugins can be built out of QEMU and don't include "qemu/osdep.h". Mark "qemu/qemu-plugin.h" as a special header that doesn't need to be cleaned for "qemu/osdep.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Emilio G. Cota Signed-off-by: Alex Bennée Message-Id: <20200524215654.13256-1-f4bug@amsat.org> --- scripts/clean-includes | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/clean-includes b/scripts/clean-includes index dd938daa3ec..795b3bea318 100755 --- a/scripts/clean-includes +++ b/scripts/clean-includes @@ -123,6 +123,7 @@ for f in "$@"; do ;; *include/qemu/osdep.h | \ *include/qemu/compiler.h | \ + *include/qemu/qemu-plugin.h | \ *include/glib-compat.h | \ *include/sysemu/os-posix.h | \ *include/sysemu/os-win32.h | \ From patchwork Tue Jun 2 15:46:19 2020 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: 11584025 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 404D4618 for ; Tue, 2 Jun 2020 15:47:50 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 168CF20772 for ; Tue, 2 Jun 2020 15:47:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ziPpwH0s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 168CF20772 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:32806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jg98n-0005Qo-7h for patchwork-qemu-devel@patchwork.kernel.org; Tue, 02 Jun 2020 11:47:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jg97a-0003ZC-0O for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:34 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:51163) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jg97Z-0007dB-4W for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:33 -0400 Received: by mail-wm1-x341.google.com with SMTP id v19so3420726wmj.0 for ; Tue, 02 Jun 2020 08:46:32 -0700 (PDT) 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=j6KWkQ7GMCxDwtP2C3gX6zvZP7J6EFfLnh9MNnF4sLE=; b=ziPpwH0s3ebzUfIhuKb5CsAVmdk8rBX6MMMIjVM6YD8ntQrPgieRjf9l8i+TzP/ule oDdZf3MTjWSd7kIyNVgoJxihPQfvPW3Dz2CfbBpL5Ufgts9aOxDIHoGwEuht4FBaC4l1 8KT22PrqSIl7LHNsogDN/rSceH/8LqvULD7K94WbHLXwNCvPrm939Sfs9PVddjNY2Ufu yfWIwJ/XtWWLG6CqvkUpsq6GXIftWzjCbX48VTSubeAlokL/gXmsN3IRpBMN1ma1fLYb VoRLTh0DEkblEi0/cW+c3j/DuZG1TNpQrFeEx6E3Iq/FEaLoMTImnje0MCSX8wSeQicO ihqQ== 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=j6KWkQ7GMCxDwtP2C3gX6zvZP7J6EFfLnh9MNnF4sLE=; b=TbE4Dz3pAuD1QD/ysK3cmkYptjQxF0oswG/DFEzUuhsO/slHgvORoaelCSBdcF64MB 8D24GKuLRCHdMntnXPH5KlkNunAyRJ9LItcGgrI3Gn4kYcg6uTWA3OHwnbXDkrVSvwnQ b6HNhpC6gyGS7I4jbOSVr8cEy/IETo3jx9DL6fAwWadLhu06OWrK62Lt7yKuKcuKeFGy wZR20/O2nn2ubhK+OoduQt1zZr12VFRgv6+c3x/xmTZSymG1g5Ryc8KyERb1mjTYcWaI qCNIP6Y/mspyNImcEVkbsDg3p+ZP4mJxexEyXWY7Kcua2h/hXuPcos0LYJfTE0FNTurF qAUg== X-Gm-Message-State: AOAM530y6y4UPv6lPovtMe20CAahkMbwMrxNJ4AOVtKt4V94UCsFe0MB GBmD6afP9445MpcsApDMAAS89g== X-Google-Smtp-Source: ABdhPJylbmdkbKVM3xGQUCwu1QmzsiSrXWsPiOIzkAN0vCW43h4rfRcaThGq2yI266Lr71i8mN6vbA== X-Received: by 2002:a7b:c249:: with SMTP id b9mr4331087wmj.143.1591112791778; Tue, 02 Jun 2020 08:46:31 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o15sm148556wmm.31.2020.06.02.08.46.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 08:46:27 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 96EE81FF90; Tue, 2 Jun 2020 16:46:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 4/9] tests/plugin: correctly honour io_count Date: Tue, 2 Jun 2020 16:46:19 +0100 Message-Id: <20200602154624.4460-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200602154624.4460-1-alex.bennee@linaro.org> References: <20200602154624.4460-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: robert.foley@linaro.org, robhenry@microsoft.com, aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- tests/plugin/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/plugin/mem.c b/tests/plugin/mem.c index 878abf09d19..4725bd851d8 100644 --- a/tests/plugin/mem.c +++ b/tests/plugin/mem.c @@ -28,7 +28,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) g_string_printf(out, "mem accesses: %" PRIu64 "\n", mem_count); if (do_haddr) { - g_string_append_printf(out, "io accesses: %" PRIu64 "\n", mem_count); + g_string_append_printf(out, "io accesses: %" PRIu64 "\n", io_count); } qemu_plugin_outs(out->str); } From patchwork Tue Jun 2 15:46:20 2020 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: 11584039 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9F58618 for ; Tue, 2 Jun 2020 15:51:56 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF4482067B for ; Tue, 2 Jun 2020 15:51:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="sZoi3Bja" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF4482067B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:45872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jg9Cm-0003OI-1J for patchwork-qemu-devel@patchwork.kernel.org; Tue, 02 Jun 2020 11:51:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jg97c-0003cY-32 for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:36 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:52446) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jg97b-0007dL-3d for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:35 -0400 Received: by mail-wm1-x343.google.com with SMTP id r9so3410927wmh.2 for ; Tue, 02 Jun 2020 08:46:34 -0700 (PDT) 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=uvMYxLr0Nl/kQDg+PeIHS1bjqHOZjTucP3buAR3WOFI=; b=sZoi3Bja+i3ID+6DKXNmzxL80Rqrw5oDLfooP3kNM+VyxrF/x2LJcoh8tSkOc//IYY B6qIFvkVMEDyF6RwuM4zdwSoZ/9WnddA1cUBpTYm50RzbwWR0wbd3/LwqkDVb12zAWfd 6kl51LgXKwX+0/XpDBuPBO41hzaRKl9nKCv253O6Qbf6yD3KdOJhgo3CbEIVrLGRR7B9 HKFu6S3OFqH6wZ9VXeht6t0+tMFZVIdKgg8121wA412LaScpLdyx2XBBXMYp97S7YrI9 lzD39hlRLLqmNhfnUjCZ1r6IsrIkarJXQLR/3pPWaw7bD7944usolRKgov+0JrxSutKS Tc5A== 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=uvMYxLr0Nl/kQDg+PeIHS1bjqHOZjTucP3buAR3WOFI=; b=mjiC+2k7BRmG0Dycx907VE3jxMi3DUmfro4Hmhw5ntDY9xf9bUMaF74jhbvyS0Y53s cDNjeiYDNm1pwg4vl0DjmG0haX97zU+K+ImhPYBq2BptH61mHKbORxN3EFMLNIi+0oPD ha6M14O/daFKV4nTEOq5Fdera1R7icjy1+Htzz6i/lRHKJklaHZcApckCuoLVKfbYgVe 5miA7RDkBfa4q+NaPKsqRCpCAHmFlD2PGziQCAlm6rpgnE/x2YAFQ8Aa9U+XoOwzC/dN Ta+20XiqsPjTOEWox7UVBEVKWobqh9LDlLmgNcfmMsUYeJXk2JyUvSXrgcSYJPvDN36r 3GTw== X-Gm-Message-State: AOAM533+fVF2YztASOJA3dXCboMvRsJ6aWu8iFvik8p8LFV+1TGr8xn1 QvPkBkARSdob+IDcz8QRzCPmww== X-Google-Smtp-Source: ABdhPJydLknq4NSSvfQ2Qi0ZW04oolrS5QPna+zl7sCqU/LUXRg5R7Bs6lvw/hkhvEjScPoeNOHgvg== X-Received: by 2002:a7b:ce15:: with SMTP id m21mr4705152wmc.117.1591112793713; Tue, 02 Jun 2020 08:46:33 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id i3sm4366144wrm.83.2020.06.02.08.46.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 08:46:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id ABE0B1FF91; Tue, 2 Jun 2020 16:46:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 5/9] cputlb: ensure we re-fill the TLB if it has reset Date: Tue, 2 Jun 2020 16:46:20 +0100 Message-Id: <20200602154624.4460-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200602154624.4460-1-alex.bennee@linaro.org> References: <20200602154624.4460-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: robert.foley@linaro.org, Paolo Bonzini , robhenry@microsoft.com, aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Any write to a device might cause a re-arrangement of memory triggering a TLB flush and potential re-size of the TLB invalidating previous entries. This would cause users of qemu_plugin_get_hwaddr() to see the warning: invalid use of qemu_plugin_get_hwaddr because of the failed tlb_lookup which should always succeed. We catch this case by checking to see if the list of entries has been cleared and if so triggering a re-fill. Signed-off-by: Alex Bennée --- accel/tcg/cputlb.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index eb2cf9de5e6..b7d329f7155 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1091,6 +1091,20 @@ static void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry, MMU_DATA_STORE, mmu_idx, iotlbentry->attrs, r, retaddr); } + + /* + * The memory_region_dispatch may have triggered a flush/resize + * so for plugins we need to ensure we have reset the tlb_entry + * so any later lookup is correct. + */ +#ifdef CONFIG_PLUGIN + if (env_tlb(env)->d[mmu_idx].n_used_entries == 0) { + int size = op & MO_SIZE; + tlb_fill(env_cpu(env), addr, size, MMU_DATA_STORE, + mmu_idx, retaddr); + } +#endif + if (locked) { qemu_mutex_unlock_iothread(); } From patchwork Tue Jun 2 15:46:21 2020 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: 11584031 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF562618 for ; Tue, 2 Jun 2020 15:49:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A536E207D8 for ; Tue, 2 Jun 2020 15:49:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="JR3b8t6F" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A536E207D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jg9Ag-0000LZ-SC for patchwork-qemu-devel@patchwork.kernel.org; Tue, 02 Jun 2020 11:49:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jg97d-0003ey-7B for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:37 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:35380) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jg97c-0007dP-38 for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:36 -0400 Received: by mail-wr1-x444.google.com with SMTP id x14so3922732wrp.2 for ; Tue, 02 Jun 2020 08:46:35 -0700 (PDT) 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=ieiufg3+rZeSqlWjO6C+srZMnCXRrjzqU0qc19RSOzQ=; b=JR3b8t6FMRb/PPNshBv9i/pSevLTzh4toO8FfG9UYFX+85SPBuOe2SoKFsC0UaZ3h2 VssMokhms1MhCLF6Swp20D8M2WrCjg2WOnMQUK70RTqvBKmFGMd+TTX7fkOu3mN5Wfay MS+MdyLS6OWErZZtSBz/M7W7E5qnp9bEHDqxhBHOjb5phOue+gGb6K9Dv62U4YdCWar/ PsbVYsqRniPR5fAx4sXYHE00GuIKDYgSO+Uppsri7sCaiOjo7bXfYjGOWoi6VZbIxoGw Lf6Ep95SEXwiBrTY2XAOqqDCgNf3TbLzSEwesvd4Bg4BkuwVHRJorLu95rmo5z+LJ0LW 6gMg== 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=ieiufg3+rZeSqlWjO6C+srZMnCXRrjzqU0qc19RSOzQ=; b=Zrw2YfwrImY8U1/uV85jtIXKiXSPsbOW2aNBsXFmK0URXj8r6yppeaj3pthD+WY2Dd x6CNv5phq5/YzSIFUvPwxc+RBpf7qpfqsO/tUnhsTV7uL0rAIJQaCSG53ViawTIkO2R0 yKIakQXfMBCtztqlVBv0iaXUZ30HAYvtUj7aacrvcREM6Sk1VVIxoTmjNjiR1wZnDe19 g1FXIVmVlFSYfNfWzpKE3uVQ2zzQIW7jCe7xcYoP4TrO9BjndfDNXpaLTdLoPSNkIW1A aRQRaHbopeyTB8lXasMSJL3ZMD2Dlj4n/HYptHwCYUJJKmyDkbvHVY8m+758hDQDx7Uf WegA== X-Gm-Message-State: AOAM5316MtKO6gLx7qkpJwdGGbLQIOy3rvIQAatbUAdYhXWKi/j9s2cM 4/7foDckslaEbVBybScH8xNd6g== X-Google-Smtp-Source: ABdhPJwNxdFcw8xWzgyALv1S9aKur2516yAV57PV4KK+iJl767vJDmewMdKPeNfgP0DckEf316MAxQ== X-Received: by 2002:adf:f0d2:: with SMTP id x18mr26578126wro.250.1591112794706; Tue, 02 Jun 2020 08:46:34 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id i10sm4421436wrw.51.2020.06.02.08.46.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 08:46:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C157E1FF92; Tue, 2 Jun 2020 16:46:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 6/9] hw/virtio/pci: include vdev name in registered PCI sections Date: Tue, 2 Jun 2020 16:46:21 +0100 Message-Id: <20200602154624.4460-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200602154624.4460-1-alex.bennee@linaro.org> References: <20200602154624.4460-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: robert.foley@linaro.org, "Michael S. Tsirkin" , robhenry@microsoft.com, aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" When viewing/debugging memory regions it is sometimes hard to figure out which PCI device something belongs to. Make the names unique by including the vdev name in the name string. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index d028c17c240..9ee4ab26cfe 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1390,7 +1390,7 @@ static void virtio_pci_device_write(void *opaque, hwaddr addr, } } -static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy) +static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy, const char *vdev_name) { static const MemoryRegionOps common_ops = { .read = virtio_pci_common_read, @@ -1437,36 +1437,41 @@ static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy) }, .endianness = DEVICE_LITTLE_ENDIAN, }; + g_autoptr(GString) name = g_string_new(NULL); - + g_string_printf(name, "virtio-pci-common(%s)", vdev_name); memory_region_init_io(&proxy->common.mr, OBJECT(proxy), &common_ops, proxy, - "virtio-pci-common", + name->str, proxy->common.size); + g_string_printf(name, "virtio-pci-isr(%s)", vdev_name); memory_region_init_io(&proxy->isr.mr, OBJECT(proxy), &isr_ops, proxy, - "virtio-pci-isr", + name->str, proxy->isr.size); + g_string_printf(name, "virtio-pci-device(%s)", vdev_name); memory_region_init_io(&proxy->device.mr, OBJECT(proxy), &device_ops, virtio_bus_get_device(&proxy->bus), - "virtio-pci-device", + name->str, proxy->device.size); + g_string_printf(name, "virtio-pci-notify(%s)", vdev_name); memory_region_init_io(&proxy->notify.mr, OBJECT(proxy), ¬ify_ops, virtio_bus_get_device(&proxy->bus), - "virtio-pci-notify", + name->str, proxy->notify.size); + g_string_printf(name, "virtio-pci-notify-pio(%s)", vdev_name); memory_region_init_io(&proxy->notify_pio.mr, OBJECT(proxy), ¬ify_pio_ops, virtio_bus_get_device(&proxy->bus), - "virtio-pci-notify-pio", + name->str, proxy->notify_pio.size); } @@ -1607,7 +1612,7 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp) struct virtio_pci_cfg_cap *cfg_mask; - virtio_pci_modern_regions_init(proxy); + virtio_pci_modern_regions_init(proxy, vdev->name); virtio_pci_modern_mem_region_map(proxy, &proxy->common, &cap); virtio_pci_modern_mem_region_map(proxy, &proxy->isr, &cap); From patchwork Tue Jun 2 15:46:22 2020 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: 11584035 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67489618 for ; Tue, 2 Jun 2020 15:50:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3C13F20659 for ; Tue, 2 Jun 2020 15:50:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ul2p1678" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C13F20659 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:42914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jg9BX-0001fx-Fp for patchwork-qemu-devel@patchwork.kernel.org; Tue, 02 Jun 2020 11:50:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jg97f-0003jI-4q for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:39 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:37120) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jg97e-0007da-0N for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:38 -0400 Received: by mail-wr1-x441.google.com with SMTP id x13so3922638wrv.4 for ; Tue, 02 Jun 2020 08:46:37 -0700 (PDT) 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=D98gPKyXYpHfK2vdgoTLIOCcijD4DQVmE2DVfMIiR4I=; b=Ul2p16782znMcbsKpUw0Xm/g/AeHDL2ZSBciVmljZk8//OPHCBdPCJk8dnfLFihx06 XODtINTxB+ww5N3Dtuh/8jUv4RxmvrXbstAVsUpELiIGNfjDYIFW9AQSOkteAEw10Y1c dA3YpTnWkBxU99/HzeQlDImeyyGJG8OVaPOR0orp2UqLxt5YuJvBy4kO2VgYUWkyXDTD VC4HANX9Uy5euDTNSBVdaSXJcR/0MZm+AAdNyEPdKDtZO74FG1CUChHAPLq2wI3wuNrc Jq+1IITF1y1vW4m90iDZt4Hp+8lksjqrnrPRstKfug1T+Ozwip98K4crr0vxr+B4mHTS 4eYQ== 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=D98gPKyXYpHfK2vdgoTLIOCcijD4DQVmE2DVfMIiR4I=; b=Hm2D5bMNFVfKI54TmKszaFBe9fr/JKHSC79X11rUzsRJmKTQMlrQ15KFT1imomxn57 2/69NMOoDIpYHsdwy7SVCp34ZSXxP632zpcNNezFF5vSRHlwyQYHMXxWsDO6736Rylj8 vBxTvJl6V5yOAt4w2N3D+7Ij9pKnJDgA/TrB3axmyfn5d7EdRgjZl5w/J+zWPs6UBRqo IJFC1QDLoHrG571ik0Rn1HaDRjrYMfGlj4s7aeEYseeB9lTQRvTev/Su1lCLTfG9SBtE 73vRzdEBAz1wqzgmcH5Ks0fOn9WcrbaDz83NNFK+yQIauv8+wa79wahud9tFYQ2lpOzO DuTQ== X-Gm-Message-State: AOAM530spmD5C4eoWXg8JibMuWZEEW1W4pqEVYP4kZh4+q58LFpp2auK /4PpD6l9OVSK9mg+wjfvYn8J+w== X-Google-Smtp-Source: ABdhPJwdCD/FKV7MGBtwwb4puXuOLX3KQGY5CnARp56Juo109Rc9iXy/Hp5mpC81H6r/K0rNujFcCw== X-Received: by 2002:adf:a50e:: with SMTP id i14mr15141142wrb.21.1591112796558; Tue, 02 Jun 2020 08:46:36 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id l17sm186818wmi.16.2020.06.02.08.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 08:46:32 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D7B241FF93; Tue, 2 Jun 2020 16:46:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 7/9] plugins: add API to return a name for a IO device Date: Tue, 2 Jun 2020 16:46:22 +0100 Message-Id: <20200602154624.4460-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200602154624.4460-1-alex.bennee@linaro.org> References: <20200602154624.4460-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: robert.foley@linaro.org, robhenry@microsoft.com, aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This may well end up being anonymous but it should always be unique. Signed-off-by: Alex Bennée Reviewed-by: Clement Deschamps Reviewed-by: Emilio G. Cota --- include/qemu/qemu-plugin.h | 5 +++++ plugins/api.c | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index bab8b0d4b3a..43c6a9e857f 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -335,6 +335,11 @@ struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr); uint64_t qemu_plugin_hwaddr_device_offset(const struct qemu_plugin_hwaddr *haddr); +/* + * Returns a string representing the device. Plugin must free() it + */ +char * qemu_plugin_hwaddr_device_name(const struct qemu_plugin_hwaddr *haddr); + typedef void (*qemu_plugin_vcpu_mem_cb_t)(unsigned int vcpu_index, qemu_plugin_meminfo_t info, uint64_t vaddr, diff --git a/plugins/api.c b/plugins/api.c index bbdc5a4eb46..3c73de8c1c2 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -303,6 +303,24 @@ uint64_t qemu_plugin_hwaddr_device_offset(const struct qemu_plugin_hwaddr *haddr return 0; } +char * qemu_plugin_hwaddr_device_name(const struct qemu_plugin_hwaddr *haddr) +{ +#ifdef CONFIG_SOFTMMU + if (haddr && haddr->is_io) { + MemoryRegionSection *mrs = haddr->v.io.section; + if (!mrs->mr->name) { + return g_strdup_printf("anon%08lx", 0xffffffff & (uintptr_t) mrs->mr); + } else { + return g_strdup(mrs->mr->name); + } + } else { + return g_strdup("RAM"); + } +#else + return g_strdup("Invalid"); +#endif +} + /* * Queries to the number and potential maximum number of vCPUs there * will be. This helps the plugin dimension per-vcpu arrays. From patchwork Tue Jun 2 15:46:23 2020 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: 11584043 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B201A618 for ; Tue, 2 Jun 2020 15:54:42 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 78B99207ED for ; Tue, 2 Jun 2020 15:54:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="boJLOshU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 78B99207ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jg9FR-0006qD-Q0 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 02 Jun 2020 11:54:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jg97h-0003p9-Qa for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:41 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:54511) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jg97g-0007dx-DQ for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:41 -0400 Received: by mail-wm1-x332.google.com with SMTP id g10so3402146wmh.4 for ; Tue, 02 Jun 2020 08:46:39 -0700 (PDT) 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=TTAp5rDD3D05lpMYKygwT+EZBLy9H09vRzxjadlC3og=; b=boJLOshUdKXGZfw665tFYM4A4pCjHkOuSLRwmpolEJ1R0ind9XcaALkQ4LcriVcjj4 I1Q1cs5XA0/7S+2W9lYhrEQnTXzY6Gs8Dba9RgIkd2OVpvHebJG0pizNUVkf72fXl6bB POYPkewda46q8tBX5ZYhluUdIGsqcJe4TEkDo1fx5lOB3DDUnq+UIbZ/iMHdhlSe2IPt z/W4ZpeAYAE6xd8RwcfSEZAuQUEJZ/ocnY2ZKNqAK0Qde48+9VHckBM46Q0MwDSTC0SV 0ubnhpToIFoI0xshuKpnHJJUpqrlQgJNuc00fQTUzkCLZ9kQCYI5PxZ2Nwg7oDDeyXo4 ke0w== 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=TTAp5rDD3D05lpMYKygwT+EZBLy9H09vRzxjadlC3og=; b=C/5UCFOLEQNt3DRA2l3zHYuvlHRMWNXrbCYkKIDdEQ9+8qpTiKxAQbZwyOA/vdAYfU 3gbTuDjJJ2y7IihQQfwxdTd70RrjX9m4p4k+SrPkST42W5Nwpq+GClDB6vKMz20T2tkk K9vXsc09Uk1CnMjWCYw00tAB9dNTJpok4Xn/lr+GSjB5R0tW/tJgdKsKC5QThQ7mDVF4 uD+FvpwMaCFN2OQeb/4ubYxaX3SeqAjl3GITV6pI31MJ7BnfBXUGnbM8pSuTZNpriLRd nHfOMIij8SKxOZaf8b+ku3og4bvycJ9is3XQTBgQbsg8d6UgKuBRKeglKtSiMe/JIE21 Lrlg== X-Gm-Message-State: AOAM533yCZoXkhKrP2eYe+u8g7/DdH6BjxIw3ydNYX5wxngQZ9HPtHlM rpcwQHDaTpEi8J8QGoxqxX/j4Q== X-Google-Smtp-Source: ABdhPJwdPDGoSWra5z8RM/5Zyyfwctln64NN1VHieXtwCE2X/+RQPsjFlUGgT9kd98a3DlZu/QTHWA== X-Received: by 2002:a1c:bc84:: with SMTP id m126mr5004966wmf.159.1591112798854; Tue, 02 Jun 2020 08:46:38 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b136sm283700wme.1.2020.06.02.08.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 08:46:32 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id F09D61FF96; Tue, 2 Jun 2020 16:46:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 8/9] plugins: new hwprofile plugin Date: Tue, 2 Jun 2020 16:46:23 +0100 Message-Id: <20200602154624.4460-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200602154624.4460-1-alex.bennee@linaro.org> References: <20200602154624.4460-1-alex.bennee@linaro.org> 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-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: robert.foley@linaro.org, robhenry@microsoft.com, aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This is a plugin intended to help with profiling access to various bits of system hardware. It only really makes sense for system emulation. It takes advantage of the recently exposed helper API that allows us to see the device name (memory region name) associated with a device. Signed-off-by: Alex Bennée Reviewed-by: Robert Foley Tested-by: Robert Foley --- tests/plugin/hwprofile.c | 248 +++++++++++++++++++++++++++++++++++++++ tests/plugin/Makefile | 1 + 2 files changed, 249 insertions(+) create mode 100644 tests/plugin/hwprofile.c diff --git a/tests/plugin/hwprofile.c b/tests/plugin/hwprofile.c new file mode 100644 index 00000000000..f5e0639e762 --- /dev/null +++ b/tests/plugin/hwprofile.c @@ -0,0 +1,248 @@ +/* + * Copyright (C) 2020, Alex Bennée + * + * HW Profile - breakdown access patterns for IO to devices + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +typedef struct { + uint64_t offset; + int size; + int cpu_read; + int cpu_write; + uint64_t reads; + uint64_t writes; +} IOLocationCounts; + +typedef struct { + const char *name; + uint64_t base; + int cpu_read; + int cpu_write; + uint64_t total_writes; + uint64_t total_reads; + GHashTable *access_pattern; +} DeviceCounts; + +static GMutex lock; +static GHashTable *devices; +static bool detail; + +static enum qemu_plugin_mem_rw rw = QEMU_PLUGIN_MEM_RW; + +static inline bool track_reads(void) +{ + return rw == QEMU_PLUGIN_MEM_RW || rw == QEMU_PLUGIN_MEM_R; +} + +static inline bool track_writes(void) +{ + return rw == QEMU_PLUGIN_MEM_RW || rw == QEMU_PLUGIN_MEM_W; +} + +static void plugin_init(void) +{ + devices = g_hash_table_new(g_str_hash, g_str_equal); +} + +static gint sort_cmp(gconstpointer a, gconstpointer b) +{ + DeviceCounts *ea = (DeviceCounts *) a; + DeviceCounts *eb = (DeviceCounts *) b; + return ea->total_reads + ea->total_writes > + eb->total_reads + eb->total_writes ? -1 : 1; +} + +static gint sort_off(gconstpointer a, gconstpointer b) +{ + IOLocationCounts *ea = (IOLocationCounts *) a; + IOLocationCounts *eb = (IOLocationCounts *) b; + return ea->offset > eb->offset; +} + +static void plugin_exit(qemu_plugin_id_t id, void *p) +{ + g_autoptr(GString) report = g_string_new(""); + GList *counts; + + if (!detail) { + g_string_printf(report, "Device, Address"); + if (track_reads()) { + g_string_append_printf(report, ", RCPUs, Reads"); + } + if (track_writes()) { + g_string_append_printf(report, ", WCPUs, Writes"); + } + g_string_append_c(report, '\n'); + } + + counts = g_hash_table_get_values(devices); + if (counts && g_list_next(counts)) { + GList *it; + + it = g_list_sort(counts, sort_cmp); + + while (it) { + DeviceCounts *rec = (DeviceCounts *) it->data; + if (detail) { + GList *accesses = g_hash_table_get_values(rec->access_pattern); + GList *io_it = g_list_sort(accesses, sort_off); + g_string_append_printf(report, "%s @ 0x%"PRIx64"\n", rec->name, rec->base); + while (io_it) { + IOLocationCounts *loc = (IOLocationCounts *) io_it->data; + g_string_append_printf(report, " off:%08"PRIx64, loc->offset); + if (track_reads()) { + g_string_append_printf(report, ", 0x%04x, %"PRId64, + loc->cpu_read, loc->reads); + } + if (track_writes()) { + g_string_append_printf(report, ", 0x%04x, %"PRId64, + loc->cpu_write, loc->writes); + } + g_string_append_c(report,'\n'); + io_it = io_it->next; + } + } else { + g_string_append_printf(report, "%s, 0x%"PRIx64, + rec->name, rec->base); + if (track_reads()) { + g_string_append_printf(report, ", 0x%04x, %"PRId64, + rec->cpu_read, rec->total_reads); + } + if (track_writes()) { + g_string_append_printf(report, ", 0x%04x, %"PRId64, + rec->cpu_write, rec->total_writes); + } + g_string_append_c(report, '\n'); + } + it = it->next; + }; + g_list_free(it); + } + + qemu_plugin_outs(report->str); +} + +static DeviceCounts * new_count(char *name, uint64_t base) +{ + DeviceCounts *count = g_new0(DeviceCounts, 1); + count->name = name; + count->base = base; + if (detail) { + count->access_pattern = g_hash_table_new(g_int64_hash, g_int64_equal); + } + g_hash_table_insert(devices, name, count); + return count; +} + +static IOLocationCounts * new_location(uint64_t offset) +{ + IOLocationCounts *loc = g_new0(IOLocationCounts, 1); + loc->offset = offset; + return loc; +} + +static void vcpu_haddr(unsigned int cpu_index, qemu_plugin_meminfo_t meminfo, + uint64_t vaddr, void *udata) +{ + struct qemu_plugin_hwaddr *hwaddr = qemu_plugin_get_hwaddr(meminfo, vaddr); + + if (!hwaddr || !qemu_plugin_hwaddr_is_io(hwaddr)) { + return; + } else { + char *name = qemu_plugin_hwaddr_device_name(hwaddr); + DeviceCounts *counts; + + g_mutex_lock(&lock); + counts = (DeviceCounts *) g_hash_table_lookup(devices, name); + if (!counts) { + uint64_t off = qemu_plugin_hwaddr_device_offset(hwaddr); + uint64_t base = vaddr - off; + counts = new_count(name, base); + } else { + g_free(name); + } + + if (detail) { + uint64_t off = qemu_plugin_hwaddr_device_offset(hwaddr); + IOLocationCounts *io_count = g_hash_table_lookup(counts->access_pattern, &off); + if (!io_count) { + io_count = new_location(off); + g_hash_table_insert(counts->access_pattern, &off, io_count); + } + if (qemu_plugin_mem_is_store(meminfo)) { + io_count->writes++; + io_count->cpu_write |= (1 << cpu_index); + } else { + io_count->reads++; + io_count->cpu_read |= (1 << cpu_index); + } + } else { + if (qemu_plugin_mem_is_store(meminfo)) { + counts->total_writes++; + counts->cpu_write |= (1 << cpu_index); + } else { + counts->total_reads++; + counts->cpu_read |= (1 << cpu_index); + } + } + g_mutex_unlock(&lock); + } +} + +static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +{ + size_t n = qemu_plugin_tb_n_insns(tb); + size_t i; + + for (i = 0; i < n; i++) { + struct qemu_plugin_insn *insn = qemu_plugin_tb_get_insn(tb, i); + qemu_plugin_register_vcpu_mem_cb(insn, vcpu_haddr, + QEMU_PLUGIN_CB_NO_REGS, + rw, NULL); + } +} + +QEMU_PLUGIN_EXPORT +int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, + int argc, char **argv) +{ + int i; + + for (i = 0; i < argc; i++) { + char *opt = argv[i]; + if (g_strcmp0(opt, "read") == 0) { + rw = QEMU_PLUGIN_MEM_R; + } else if (g_strcmp0(opt, "write") == 0) { + rw = QEMU_PLUGIN_MEM_W; + } else if (g_strcmp0(opt, "detail") == 0) { + detail = true; + } else { + fprintf(stderr, "option parsing failed: %s\n", opt); + return -1; + } + } + + plugin_init(); + + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); + return 0; +} diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile index b3250e2504c..d87b8d40699 100644 --- a/tests/plugin/Makefile +++ b/tests/plugin/Makefile @@ -14,6 +14,7 @@ NAMES += hotblocks NAMES += howvec NAMES += hotpages NAMES += lockstep +NAMES += hwprofile SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES))) From patchwork Tue Jun 2 15:46:24 2020 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: 11584041 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A9659159A for ; Tue, 2 Jun 2020 15:52:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7ED3F2067B for ; Tue, 2 Jun 2020 15:52:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="W65GZhjn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7ED3F2067B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:47558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jg9DP-0004FT-R6 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 02 Jun 2020 11:52:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jg97g-0003m9-IY for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:40 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:35381) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jg97e-0007dh-Uc for qemu-devel@nongnu.org; Tue, 02 Jun 2020 11:46:40 -0400 Received: by mail-wr1-x444.google.com with SMTP id x14so3922887wrp.2 for ; Tue, 02 Jun 2020 08:46:38 -0700 (PDT) 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=D7IUd/fMXoOGoaV/5qSVVzKkzaDzbDEGnaTAgX8XWeQ=; b=W65GZhjnZ98xwCzBbH0fHzuuUkAIA01tNSHq/Alu6fN+EyyuvKkcLCdAt+278dEtDe 0+k/ch+rEK6wYrP0EAWYowzRCfgz1/keWSt1+beEc+/SqG4jC4+vqSqH7024pgM6872R z4pXloEmu4sKFxCiNrcugWNfF0At/sO4LANKLsRpvBVNpNHUnqK14pM14eCTRnJ6f8x1 VkVVQKjBnizmQEKccSUJyVw3rtHAQS9IxL22OBiAD52Yr/ZGf0Ho94Cp+Fe28XmZPBIR ayU5x7AJAdoZf/k/UqImCpYsxFkHMXumgpW2807LQ6FM6DzlPI3TF951XFsB6n7enTSZ W0Rg== 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=D7IUd/fMXoOGoaV/5qSVVzKkzaDzbDEGnaTAgX8XWeQ=; b=BDBT/ZiwpUc6f4FevCcD2alw+Xk1XdleceFhbzAQVPnEj+wA04gRpV9JTPF3nNSo6t Vxca52OKQV4xsqo6aeEPyCyV5QgOOhJWfZQ3hCvn2XNxTe7mQRQPlierMiAWYkjgq5tc XBcXhs00fMrUpwLEabg5SD71nbMzw/KPsNCWVKPA5uMf+Jd7J+qy+Wui+nuXaEe5upS9 F5ALB1bCqTUX0NVaJPQhRbgO6Ca3uJRrQ5pME8M2BkNiQwHHzWOaE4IgFFDOf2dcQblk skz5nEwHTAvfj2fGFuqQ8BDSC+kG3Id9w2GwLhJ3IHxyI/nfhKhr/nxkLaLZQ0kyj3WU hZGQ== X-Gm-Message-State: AOAM531Tcr+/UbbjIZSpzcgEBHMywItjcYHrKHt0TGwribt8kgUVXBmi BzGbXbBoIX8JxUwTmjBvy+7EbA== X-Google-Smtp-Source: ABdhPJwXTKriSjywj7DPAmySKxgQ5vcoi4Iv/lES/7bRkQ6tS7IQsvgbHA3J5VqLG1z9zsVZvgioBg== X-Received: by 2002:adf:fdcd:: with SMTP id i13mr25544969wrs.190.1591112797582; Tue, 02 Jun 2020 08:46:37 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 37sm4682599wrk.61.2020.06.02.08.46.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 08:46:32 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 10D451FF98; Tue, 2 Jun 2020 16:46:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 9/9] .travis.yml: allow failure for unreliable hosts Date: Tue, 2 Jun 2020 16:46:24 +0100 Message-Id: <20200602154624.4460-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200602154624.4460-1-alex.bennee@linaro.org> References: <20200602154624.4460-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: Fam Zheng , robert.foley@linaro.org, =?utf-8?q?Philippe_?= =?utf-8?q?Mathieu-Daud=C3=A9?= , robhenry@microsoft.com, aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" They will still run but they won't get in the way of the result. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 564be50a3c1..ec6367af1f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -429,6 +429,7 @@ jobs: env: - TEST_CMD="make check check-tcg V=1" - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS}" + - UNRELIABLE=true - name: "[ppc64] GCC check-tcg" arch: ppc64le @@ -493,6 +494,7 @@ jobs: env: - TEST_CMD="make check check-tcg V=1" - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},s390x-linux-user" + - UNRELIABLE=true script: - ( cd ${SRC_DIR} ; git submodule update --init roms/SLOF ) - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$? @@ -535,6 +537,7 @@ jobs: - TEST_CMD="make check-unit" - CONFIG="--disable-containers --disable-tcg --enable-kvm --disable-tools --host-cc=clang --cxx=clang++" + - UNRELIABLE=true # Release builds # The make-release script expect a QEMU version, so our tag must start with a 'v'. @@ -556,3 +559,5 @@ jobs: - mkdir -p release-build && cd release-build - ../configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; } - make install + allow_failures: + - env: UNRELIABLE=true