From patchwork Thu Aug 15 14:48:51 2024 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: 13764851 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BA289C3DA7F for ; Thu, 15 Aug 2024 14:50:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebmx-00036W-SB; Thu, 15 Aug 2024 10:49:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebmv-00034k-Rg for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:17 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebmt-0000Bh-Us for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:17 -0400 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5b9d48d1456so1639897a12.1 for ; Thu, 15 Aug 2024 07:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733354; x=1724338154; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yWTKlDd6LK1VooQusJJbhCpW5WJ0iCeY5ofYJWN9ldI=; b=wwRl0KHBVClQxe4erm2www7r3dC1S034jYSo8lvdK8ti0kUhnPKUUjUkmw0MmHhB91 7Aee7YrX7pMOjyDT1pz+5MHQQ1rmUay0qsuQlnE5TwtfwVzNTt7g36wa7Inc5oM5b7X5 ZfZlvJwgemy2S37zT6bnko/fqJljDgLlj2ZGcp4kWk1PMmUUNz2SoRix8+Fiy7u4o/6b tG6HjGvDrNHOz9+8hSat3IQCNrMYMp+XxgzP8PT8bo0/Nh6MJH8x7o9+x5L2DW8pQXcP jZmj9BEaNkmv0+9SPMw8G5o/h4VvH4aDsR+ayvihN4/qixVapASMcuzL/vFNiHdLmq7x vsWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733354; x=1724338154; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yWTKlDd6LK1VooQusJJbhCpW5WJ0iCeY5ofYJWN9ldI=; b=aqRogeEvPVz5Mf3moR/v+40reFPwsjWq404CPlsSXHBeiMgevq6if5NhNhs7tSxx/F uLbBKSdDmFkD6pKmZaOH2QVasPKZXXPoHcqjsUDvYkAumgba231knvzCa4CSHvuLIr/A MJQye9z0wI/JmdHXCG1XGLT8KcJOdC+PmssqwHo7EdtX+yF34WgCPsRfojBY2CJiBo/e dTQ3xQ8uzGtQvut9xPROgYMAZbXt8sWAPZf+agLXz4gAXs1L38sU3ZK+AigKlcvxAOF6 nw4gmR0xu9FCCcfUSpg1V6znAJ5pOKqqEgtZHOJjUeYUDtGfquJ7vwX8AWKBkDgF0flw mlVA== X-Gm-Message-State: AOJu0YwiHqq8JzLq49PRR9je0jkh85Z4Y4QVgySGz+UeORfhZ3xl3AwL +vwMkRrQ3+XnhZUe1bNiil1Gs9XNk5Su/eP8emPfilwH2OjCMaFhdj0gjLZQ1zI= X-Google-Smtp-Source: AGHT+IENyghTMykpQlzwhyebQBu97V2cNcAdQG8P+4fqGQiMKtZCLui91LF8lWF9Iasbg2HL7FHObg== X-Received: by 2002:a05:6402:280a:b0:5a1:4f76:1a25 with SMTP id 4fb4d7f45d1cf-5beb3c255fcmr2917353a12.17.1723733353544; Thu, 15 Aug 2024 07:49:13 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bebc081a19sm967489a12.86.2024.08.15.07.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:12 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id C85AB5F8ED; Thu, 15 Aug 2024 15:49:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Yoshinori Sato , =?utf-8?q?Alex_Benn=C3=A9e?= , Cleber Rosa , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 01/21] tests/avocado: Re-enable gdbsim-r5f562n8 testing U-Boot Date: Thu, 15 Aug 2024 15:48:51 +0100 Message-Id: <20240815144911.1931487-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x532.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Philippe Mathieu-Daudé We disabled all RX tests on commit 9b45cc9931 ("docs/devel: rationalise unstable gitlab tests under FLAKY_TESTS") for being flaky. However I don't recall the U-Boot test to fail (the problematic line checking the 'version' string is already commented out), and I'm running this test reliably, so re-enable it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato Message-Id: <20240801172332.65701-1-philmd@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-2-alex.bennee@linaro.org> diff --git a/tests/avocado/machine_rx_gdbsim.py b/tests/avocado/machine_rx_gdbsim.py index 412a7a5089..a83873b738 100644 --- a/tests/avocado/machine_rx_gdbsim.py +++ b/tests/avocado/machine_rx_gdbsim.py @@ -22,8 +22,6 @@ class RxGdbSimMachine(QemuSystemTest): timeout = 30 KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' - @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable on GitLab') - def test_uboot(self): """ U-Boot and checks that the console is operational. From patchwork Thu Aug 15 14:48:52 2024 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: 13764863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AC1B5C52D7C for ; Thu, 15 Aug 2024 14:53:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebmy-00038s-K0; Thu, 15 Aug 2024 10:49:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebmx-00035j-5V for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:19 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebmv-0000C5-2x for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:18 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a7a8caef11fso132200066b.0 for ; Thu, 15 Aug 2024 07:49:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733355; x=1724338155; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F7MaSXOA/ZMqYEU3CV7ts37a7U6olYGDg0a62DJzx+I=; b=aaADOblkc4sebtpewmj5xDjfARvgFj9KkBL3JoEqh3dUYpdGr3Hr+R/xCleszv6Jon ZKl48AlozDyz4IUuOYY24amcTgQhEGe7gbmXNt333Kce4f83w1So5/zLytvjR2whXwpi SUaaGkY/BwAl1lxJdD2ajJYRrQnf5VAUsNNcwm7I6AG4E+60g/YBrGG3vRE7DUF3FCyl LbHflch3bA/zIifU9cG9MPV1ZShb8MI1S/Ww1E1yA9dPVQljR5BRmG+qAhGdhUdCVV+1 g6jeb/woiuOVe3G/smig49eNI9JVYF5HvT47/3b2lCTRpTynWiMnTtmwyXBgk/jRer6m JVKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733355; x=1724338155; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F7MaSXOA/ZMqYEU3CV7ts37a7U6olYGDg0a62DJzx+I=; b=N95y8xMB2cHqYveRQS03rQdPj9XeQhpxkKjSCOrAXF0mQBGUbceUNehK1qsgKZdVhR qqpidcFCdtAQ1u/yr4aFJ9cDGrAzA89LXH3fr7FPS62bL0K8acTeZoow0ryamTEOpOXX V00fxNzq3djnU9VYuHmsBE8gUEzblMmzwlXFw5s419VAqAFwmNRoiBTNWsNIsNHtw5rP /Zk5wV/lHDwZPLgTPFwPKpmBx0QGCqw8bp92pBUOxgxfZJFBvbXyPVZir4pKk7iV8ALe BLmfwK0YzWpsV1INXCuo7zFnE8mBKIE0jHRRsxqbPX0LZZsJ5h9fCIMUZ17C52VBLpN6 p2uQ== X-Gm-Message-State: AOJu0YyJG+VosXPWvK6fTQPXJuFaeOsDqDg3fPfUWvJ0mw6UgODOyeqt Mc9CXUYBMvFoY7EExRLDNMagHUB9RH+2c+5XJnkcDE2+rjX23hX4GfnARzn+Plc= X-Google-Smtp-Source: AGHT+IFGiI0wj4jUT5H/YHq84MNolYeeugOqs5LW8Q6o4GefIeSVnW6TIoR73a0GYB/+Xh1oJrGsXA== X-Received: by 2002:a17:907:3daa:b0:a77:de2a:aef7 with SMTP id a640c23a62f3a-a83670063a3mr523966166b.44.1723733354788; Thu, 15 Aug 2024 07:49:14 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a838393564csm112001666b.128.2024.08.15.07.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:13 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id DFA4D5F904; Thu, 15 Aug 2024 15:49:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Richard Henderson , Paolo Bonzini , Thomas Huth Subject: [PULL 02/21] Makefile: trigger re-configure on updated pythondeps Date: Thu, 15 Aug 2024 15:48:52 +0100 Message-Id: <20240815144911.1931487-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x632.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org If we add additional deps for meson we need to ensure we trigger a reconfigure to make sure everything is set up. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-3-alex.bennee@linaro.org> diff --git a/Makefile b/Makefile index 02a257584b..917c9a34d1 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,8 @@ x := $(shell rm -rf meson-private meson-info meson-logs) endif # 1. ensure config-host.mak is up-to-date -config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/scripts/meson-buildoptions.sh $(SRC_PATH)/VERSION +config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/scripts/meson-buildoptions.sh \ + $(SRC_PATH)/pythondeps.toml $(SRC_PATH)/VERSION @echo config-host.mak is out-of-date, running configure @if test -f meson-private/coredata.dat; then \ ./config.status --skip-meson; \ From patchwork Thu Aug 15 14:48:53 2024 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: 13764848 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E1FDBC3DA7F for ; Thu, 15 Aug 2024 14:50:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebnD-0003po-Bv; Thu, 15 Aug 2024 10:49:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebn2-0003Ox-Bb for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:25 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebmt-0000Bj-Vz for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:24 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5b7b6a30454so1374660a12.2 for ; Thu, 15 Aug 2024 07:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733354; x=1724338154; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=j0KEoUGEE33PJpI6PwWgjdeA/8L5WleKbgGt33xqUss=; b=zZzJPTzarqNEwQ1RpQppA5Hxhc04MGgLELH5DmkUOV1xUlruwLJL7T4AwBQEoJrLAA H3pykXNMDzvqoRTqhCVz2LxeMwj+lHHV4zn7YemNI+5tdgPVrkXVRpP3ZLLdmGRw7Of/ BHLXD3nmsyprNjGrlCRjXTJaK0n0A9Efymx5gD9PrHp+6p+wxKdWHslqqSs2GY/njkZg CQYOc+zB+mqIe4V0Ds04NGhksscmvrz/Rnlt4aqSbRbRUM0tmKty188GtR+TSb3zgrR5 0cZLNLh62O3U28Gj5CoBLE5jj4829/Y9Ls4C5CIMQfr2jldkr0o9OY/UXv7kFlhafybT Hy6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733354; x=1724338154; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j0KEoUGEE33PJpI6PwWgjdeA/8L5WleKbgGt33xqUss=; b=iUg+kxc44TXlwLupiPzzq8/B4q85+4qa91WLQdq03szchCKtY06SGmcu1jWe7isxH1 guQh85MCVAf8vDy3qr0KJ2r7yZ9LA/2XMj++gnQJC3WXwThs8X7N/3hoWlCQ77h2+HdA TRBCmrSBW4J+hZalDzza625YhG5N05u/esboJ4RQlveYVYBeQxSonzJ8HWPCV2DJmVCS Y2H40iPBz6h8iU4JjJsXclTujgVnxBnypZ7XbmDMFH/zYmIT85sw/Runs91SIuL5I5rt +yhb9m5dB3RArxQduTMNJX0XHIKxvJIFWf3EF5rNUTXxriNIwhJn6HTok/yIks4US7iA mOaw== X-Gm-Message-State: AOJu0YykscIzrfHBrOKFsdVr/hwIPuhopBicsxwnD+xdQbHrD4RxdSHo S8fmLg+LiWPtqNQ9fo8JpPJrxYyG/8ev1pFxvZzKaavoWsc7yEK6Tkya3nDcsrk= X-Google-Smtp-Source: AGHT+IGKdq69hkmoiG6snSkiCE57U90qx4iYFUKG3dKt5o6BvfrnbhJ08qXws8zZKFb9wit1pxorgA== X-Received: by 2002:a05:6402:550b:b0:58d:81ac:ea90 with SMTP id 4fb4d7f45d1cf-5bea1cbcf1bmr3062504a12.38.1723733353852; Thu, 15 Aug 2024 07:49:13 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bebbde7cd4sm985090a12.39.2024.08.15.07.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:12 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 00CF15F90B; Thu, 15 Aug 2024 15:49:12 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Gustavo Romero , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , Thomas Huth Subject: [PULL 03/21] configure: Fix arch detection for GDB_HAS_MTE Date: Thu, 15 Aug 2024 15:48:53 +0100 Message-Id: <20240815144911.1931487-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x529.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Gustavo Romero GDB_HAS_MTE must only be set if GDB supports the aarch64 arch, so the test if "aarch64" string is present must be against GDB-related '$gdb_arches' variable and not against '$arch' variable. Signed-off-by: Gustavo Romero Message-Id: <20240804161850.2646299-2-gustavo.romero@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-4-alex.bennee@linaro.org> diff --git a/configure b/configure index 019fcbd0ef..a3aa257fd3 100755 --- a/configure +++ b/configure @@ -1673,7 +1673,7 @@ for target in $target_list; do echo "GDB=$gdb_bin" >> $config_target_mak fi - if test "${arch}" = "aarch64" && version_ge ${gdb_version##* } 15.0; then + if test "${gdb_arches#*aarch64}" != "$gdb_arches" && version_ge ${gdb_version##* } 15.0; then echo "GDB_HAS_MTE=y" >> $config_target_mak fi From patchwork Thu Aug 15 14:48:54 2024 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: 13764854 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 69EE1C3DA7F for ; Thu, 15 Aug 2024 14:51:08 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebnE-0003vQ-0w; Thu, 15 Aug 2024 10:49:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebmw-00035D-AZ for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:18 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebmu-0000Bv-Du for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:18 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a7a975fb47eso138617766b.3 for ; Thu, 15 Aug 2024 07:49:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733355; x=1724338155; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=t1sXjiCdRpLULlo+gpPa91iiSnoCu2OdnjrYlFXOa+Q=; b=lOG23gpLo3XMNzOGnFpSxr7y3AtiipuXJA/VCXYAlNy1ognpMMvvowoeWdxLnzh/QU OIDv7rm2RtxNThlRWr/rxriz9I5SUB3T1SzriEVbf3opSiS3yEPHcdTzPQJD1DjkoaRG jH0v8+xeT7S0QoOirR0Jn9SkOffXTn6jOUcOCZ89G81dr912BOSmkYtfraFNGURuFpgF a1Q+lfdAGXEjHrsIueOqtZRt2Va85NnNk9CdD/XmePzZ8sBoEpk2/3EVm92eWFnL+C3s Qg4RnxA5vbZK7G/rMF2waKgD4BKhXpT/PO9YgkLbphqHVX71juvJHd3PKlwpGdFJwGk3 +NQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733355; x=1724338155; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t1sXjiCdRpLULlo+gpPa91iiSnoCu2OdnjrYlFXOa+Q=; b=skOgIYPHOC2B/s9UzrgbfZakg0AuA6JFh2jtXtoX0fUsomxHN8rY2gUFqCaxfa3luE hnxAekESEchj8CdDh2kQW2aeVgWM2mUtPXdfRz1N8906eQ0/3InDxMNUp8r16CtyZMUi +wBYOZ7Ywz6KuG2e666DvG9PS8cQ47vDgjPR3XDmSW1YOA8epkCkdAc3+osWKreFYoZJ y00M/YcYgcwr3JY+ALciZWYr7GHqPhsNeuWnvPG3RGCLTrmFUQe5znmqY0JngV6/UF/+ eLZWPXlG48JWWKY92T1S3/TteZupxO9swIbT3i05rVz60xWwmZP4/M+lTOvYvBTwVkLp 0jYA== X-Gm-Message-State: AOJu0YxRpyzJOazoagy9unlBhO5AfiHHaGuqF3nZPMLs7HQC51v2gTmZ PBGp/uVyzOrArSX9ZgPLrJjwhbXyABO34RKwxFhsd7qCf+hJprG9xR3gGpCJE9/AXWi+YQEt6or d X-Google-Smtp-Source: AGHT+IEsmQLMXx9oeD3lJpdbjKJvrhZBcNa9m49AgbitPTO/k69Jif7UXN+viErMAKelyBUJj0hByQ== X-Received: by 2002:a17:907:9448:b0:a80:f893:51bb with SMTP id a640c23a62f3a-a83670bf179mr374746266b.68.1723733354494; Thu, 15 Aug 2024 07:49:14 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a838394723asm114024166b.171.2024.08.15.07.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:12 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 16B0A5F920; Thu, 15 Aug 2024 15:49:12 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Gustavo Romero , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , Thomas Huth Subject: [PULL 04/21] configure: Avoid use of param. expansion when using gdb_version Date: Thu, 15 Aug 2024 15:48:54 +0100 Message-Id: <20240815144911.1931487-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x634.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Gustavo Romero $gdb_version is now used in more than one conditional case and its usage in such cases may increase in the future. Therefore, avoid using shell parameter expansion when using it by setting gdb_version to its final form. Signed-off-by: Gustavo Romero Message-Id: <20240804161850.2646299-3-gustavo.romero@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-5-alex.bennee@linaro.org> diff --git a/configure b/configure index a3aa257fd3..97de85d710 100755 --- a/configure +++ b/configure @@ -1103,8 +1103,10 @@ fi # gdb test if test -n "$gdb_bin"; then - gdb_version=$($gdb_bin --version | head -n 1) - if version_ge ${gdb_version##* } 9.1; then + gdb_version_string=$($gdb_bin --version | head -n 1) + # Extract last field in the version string + gdb_version=${gdb_version_string##* } + if version_ge $gdb_version 9.1; then gdb_arches=$($python "$source_path/scripts/probe-gdb-support.py" $gdb_bin) else gdb_bin="" @@ -1673,7 +1675,7 @@ for target in $target_list; do echo "GDB=$gdb_bin" >> $config_target_mak fi - if test "${gdb_arches#*aarch64}" != "$gdb_arches" && version_ge ${gdb_version##* } 15.0; then + if test "${gdb_arches#*aarch64}" != "$gdb_arches" && version_ge $gdb_version 15.0; then echo "GDB_HAS_MTE=y" >> $config_target_mak fi From patchwork Thu Aug 15 14:48:55 2024 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: 13764855 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 67790C52D7C for ; Thu, 15 Aug 2024 14:51:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebnE-0003va-1i; Thu, 15 Aug 2024 10:49:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebn0-0003GB-4Q for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:23 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebmx-0000Cf-5Y for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:20 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5a10835487fso1540953a12.1 for ; Thu, 15 Aug 2024 07:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733358; x=1724338158; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6qa09G1wxoease4Cu4sCuCaUUU6r75hWrRIJjosTbxU=; b=WCe8LRdCXDfVlYm4pqnRhDHxWH5YHRnnPM8NQeb7Za2boxVapsHn++imRHT0LTcW5u grzR15lQKqXnQXxfvJhLCEXSOEzmlbHfUub0CUcUwtdvks3NuKypsrPGGxBfZasD2E7K eJzQRRqcb7jnbsF2628Wg4cpNVfLG+To40Twg3HdVyBk8YO74y6cI3bhBnWNagYHPWne q4hHKb0Pw5caK9qy/Ut9DiT6FQY/DJl3rdG9DgYkTT+GHLpUwDOOv0Qq3h8smv4eamB4 aU1slm4gXvcmxqpB5qq2BWutS94zd2zwZ55EnrXINA8lCIh8S+B2y0pbX/+Wyg7u/7C+ zx4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733358; x=1724338158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6qa09G1wxoease4Cu4sCuCaUUU6r75hWrRIJjosTbxU=; b=Jkh45CX9eg79spHiDoNMSUpV2scD1TZJ+pOke4BFGYe4r9YX/FZ2KoYBx8gXker6Z1 cs3+qfZDAOs7Q+E33TBgZyGFaayo51KemHTEE2Ia2tWFtQIGyXWg7eTYTwkEKXGzZCbx DmmnLJ7vYq+WMHlxSTcIA0h8sLB3h5heVaVsDTpvjdDqOnthMZPsaCIygVcZsO+J1D82 OuDWlhqYPZRmkhyH/QrUWeCHED+ahcHPEPT2VpPr/Iey0w7e3uwqzJ/4INJ/NyeX6I7d V8DQFqGnj78e2teOebMvc1ts2hmMQCh05lf8+XtTgmCt27y6WS2skJa991XUg0Z+PPET oASw== X-Gm-Message-State: AOJu0YyF2OrFjkaJhL6h0IBGi/qc6iZk+hAy3n3wZLoV5FPzKJUamZgg w0am5NDnWxyXF6W1Ka/cTGhp0FXYRTYzHrqyxkGr9VctfF+kqOzM8LPYcUVK7FE= X-Google-Smtp-Source: AGHT+IHfI52dvC6OqQXSPocpfhnlQTaTV5SCNu8BxKIkNJ0EN6xI3YXiY2B69GiBkO77L/Y0gH0wGA== X-Received: by 2002:a17:907:803:b0:a80:d64f:6734 with SMTP id a640c23a62f3a-a8367070b7dmr432663066b.60.1723733357286; Thu, 15 Aug 2024 07:49:17 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a838393599asm112187266b.132.2024.08.15.07.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:14 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2BABB5F940; Thu, 15 Aug 2024 15:49:12 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Gustavo Romero , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , Thomas Huth Subject: [PULL 05/21] configure: Fix GDB version detection for GDB_HAS_MTE Date: Thu, 15 Aug 2024 15:48:55 +0100 Message-Id: <20240815144911.1931487-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x530.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Gustavo Romero The test gdbstub/test-mte.py requires a GDB version that supports the qIsAddressTagged packet. According to GDB NEWS [0], this packet was first made available in the GDB 15.1 release, not in 15.0, so this commit fixes it in configure. [0] https://www.sourceware.org/gdb/news/ Signed-off-by: Gustavo Romero Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2477 Message-Id: <20240804161850.2646299-4-gustavo.romero@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-6-alex.bennee@linaro.org> diff --git a/configure b/configure index 97de85d710..d08b71f14b 100755 --- a/configure +++ b/configure @@ -1675,7 +1675,7 @@ for target in $target_list; do echo "GDB=$gdb_bin" >> $config_target_mak fi - if test "${gdb_arches#*aarch64}" != "$gdb_arches" && version_ge $gdb_version 15.0; then + if test "${gdb_arches#*aarch64}" != "$gdb_arches" && version_ge $gdb_version 15.1; then echo "GDB_HAS_MTE=y" >> $config_target_mak fi From patchwork Thu Aug 15 14:48:56 2024 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: 13764846 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C0409C52D7D for ; Thu, 15 Aug 2024 14:50:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebn3-0003OV-Kb; Thu, 15 Aug 2024 10:49:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebmz-0003D8-EY for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:21 -0400 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebmx-0000Cc-AB for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:21 -0400 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-52efbb55d24so1813171e87.1 for ; Thu, 15 Aug 2024 07:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733357; x=1724338157; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XlVm4bFaARcVP1rknNRsQtAnzRUhJ++dQu53YaEvbis=; b=sfhJmv6AsHrQt/9f3ulpstXjZUq5Dre0ZzQsdk6WBeo04HVijLY5fz8IsdH8gpE/Mf bjbeBiiIbXpsg46ad3A8rsyeodmXD5IOzYIqzO4Bha/WmbcUo77xIsuxTHa8nCjZ5b40 cJQE+2GRpOjGCvJicpEHlKYEvLfqGO5OJM2sSgBysgOK6Da3ITgPxuxmMx8zOO/xg3Bm i0TaGJhKYqPTUJFiuGTcLt4r2VDgYEiAGK/UALQ9Ct4ncaVKHLdwI+Kpl89NW3/Uy8wz UgEVRQqcJDTQMOe68AVrS7AyLpeCH1r5fl9UpDHiPIxF3+A7Fo+bsFwh7tMaBwkKDdHe S/Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733357; x=1724338157; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XlVm4bFaARcVP1rknNRsQtAnzRUhJ++dQu53YaEvbis=; b=w+ielk/ihscMvLL2CplE6JBoYnJ9Z53Kz9CtTIGeohzR4wRgaDIAgzEtxf39upr22j 8I1PDCTlC7CbBJZ+kNj8ZPNbBVb0CDhgCLUNZzEvqIz1gPuSlEH/Z4fwqL91iWx9jIxx 4SonzEGFWmg3CZe4XQQ+HCg293HCsjUOTrDFv89K409DBJzUzMKnWa1hC1Snx9H6RyIA rQMRHmtqr+52h1fZ3fhIL9GgzBJoWfllBxWX39ofH4jl9vfZX91s9yvh40nhV+KCSoLA pSS9s5i6GDoQ03jV32vsOmakR+7e8BAGO1aSqYlpOZuMr44NQL8a8Xxosg2B2aW4dgQR 5zRg== X-Gm-Message-State: AOJu0YyjNs3WEeef9D1eZX+NiwORgK6/c4w9jc4RcKqE4NpR8SBHDiyh Fmf6bmyMxuWTki0Bu7Qaz28YePcRjUV0SvJduTMh7luPyI0MlhzJPWqz/EuIzlQ= X-Google-Smtp-Source: AGHT+IHcL4qbC5MZgNQOgWzymD8gZCDlv44EIwf363GkVNkeKJ8rFhcRUCHGV8017F69yBZgax7Zng== X-Received: by 2002:a05:6512:33c2:b0:52e:716a:1898 with SMTP id 2adb3069b0e04-532edbd145cmr5432741e87.58.1723733356960; Thu, 15 Aug 2024 07:49:16 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a83838cfac5sm111481866b.80.2024.08.15.07.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:14 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 4000B5F953; Thu, 15 Aug 2024 15:49:12 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Stefano Garzarella , Cornelia Huck , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , =?utf-8?q?Ale?= =?utf-8?q?x_Benn=C3=A9e?= Subject: [PULL 06/21] scripts/checkpatch: more checks on files imported from Linux Date: Thu, 15 Aug 2024 15:48:56 +0100 Message-Id: <20240815144911.1931487-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x12d.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Stefano Garzarella If a file imported from Linux is touched, emit a warning and suggest using scripts/update-linux-headers.sh. Also check that updating imported files from Linux are not mixed with other changes, in which case emit an error. Signed-off-by: Stefano Garzarella Reviewed-by: Cornelia Huck Reviewed-by: Daniel P. Berrangé Message-Id: <20240718072050.9503-1-sgarzare@redhat.com> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-7-alex.bennee@linaro.org> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index ff373a7083..65b6f46f90 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1374,6 +1374,9 @@ sub process { my $in_header_lines = $file ? 0 : 1; my $in_commit_log = 0; #Scanning lines before patch my $reported_maintainer_file = 0; + my $reported_mixing_imported_file = 0; + my $in_imported_file = 0; + my $in_no_imported_file = 0; my $non_utf8_charset = 0; our @report = (); @@ -1673,6 +1676,27 @@ sub process { # ignore non-hunk lines and lines being removed next if (!$hunk_line || $line =~ /^-/); +# Check that updating imported files from Linux are not mixed with other changes + if ($realfile =~ /^(linux-headers|include\/standard-headers)\//) { + if (!$in_imported_file) { + WARN("added, moved or deleted file(s) " . + "imported from Linux, are you using " . + "scripts/update-linux-headers.sh?\n" . + $herecurr); + } + $in_imported_file = 1; + } else { + $in_no_imported_file = 1; + } + + if (!$reported_mixing_imported_file && + $in_imported_file && $in_no_imported_file) { + ERROR("headers imported from Linux should be self-" . + "contained in a patch with no other changes\n" . + $herecurr); + $reported_mixing_imported_file = 1; + } + # ignore files that are being periodically imported from Linux next if ($realfile =~ /^(linux-headers|include\/standard-headers)\//); From patchwork Thu Aug 15 14:48:57 2024 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: 13764844 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4764EC52D7C for ; Thu, 15 Aug 2024 14:49:48 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebn3-0003Tw-MO; Thu, 15 Aug 2024 10:49:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebmz-0003EB-Md for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:21 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebmx-0000Cm-JR for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:21 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a8385f38fcdso62758566b.3 for ; Thu, 15 Aug 2024 07:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733358; x=1724338158; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O/2O2QWI/Uf5GFig2yGm0H8WH7A5Eq7y7uzfXzjAjGQ=; b=VHI+ezQy9nJYvXNJ9KJNSjLGmRnEBI80BE+9s1djV91H1MWGtTQYuhjSHD9pQNeiUs TNsXQd9pQwKEfD4Dz+jOmVb2FlFEIfyLZKR7pdecxCKOGdY/YaHlgnRSQnOclntV1pGT JbO/UFTNLoeyhYfdTn105lt8Ls2oZhkfMC8vOiOs9GMtBfnNeeWe9G4r+vFh/oUZ3k2o w47ymYNjhCgPskd4eLk3IFhYg2FfvCCOOJEqijopCIjaynetAkhCbIbfLgGm6wG1yByD XkdouJW/is6JF6W5VZsCeDPbMS10zUXxUvVNRE9pKAqi1+kg5w8p0bbQA/z+yWfyJ1E+ PybQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733358; x=1724338158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O/2O2QWI/Uf5GFig2yGm0H8WH7A5Eq7y7uzfXzjAjGQ=; b=M25g6LnvPDicAbCn4NV3/T1wPl8BKKP0jHksnhToab1q6lv+sVl98vx2jYF1u4MUC0 ZYulSYvaC3+E6Ee/j0GMo2+uzFGsT5RWi7rfvhR9f74fejUbfremG6m6Hrknzawpy5y6 QPp6boqalZA3ZNbm3Y/zTaQdYSYJyxenMp6wVp0t04guhOeE0xmqzqrWk6LD+7ORaak0 waHog0hK/VvqEEYfBiiZ7SpcpCQKKFD+s5ToJNi5xsUUIdz9ewJ6NDARPwcTQzfhpff1 UZJQCLmEelXl0RCkv1BrNrUKNDNZ5vKYvNj711khWuH79dHCFxDX7OIibbSvGC61jWCZ D48w== X-Gm-Message-State: AOJu0YxRYzwMgf1ItVHZ1yU8DlLr+5yi3+ryG8INsGCRl82lfM1pxe/I XdMKuXkywXFGgpnPdtACEfMy6U2kQ1tlORKcOvhfaQICbhyxtUMhv9pX3b0okvc= X-Google-Smtp-Source: AGHT+IHXTM05zKcMC3ai7A5C/iBWIIgK3CctC56tk/IKn4JZbRNe8vqdBLyxeG6i9ObU80ciNjkSQg== X-Received: by 2002:a17:906:cad9:b0:a7d:a29e:5c33 with SMTP id a640c23a62f3a-a8366c36624mr400869666b.28.1723733357602; Thu, 15 Aug 2024 07:49:17 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a83838c6c07sm112618866b.43.2024.08.15.07.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:14 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 59A465F95A; Thu, 15 Aug 2024 15:49:12 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Eduardo Habkost Subject: [PULL 07/21] target/i386: allow access_ptr to force slow path on failed probe Date: Thu, 15 Aug 2024 15:48:57 +0100 Message-Id: <20240815144911.1931487-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x636.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org When we are using TCG plugin memory callbacks probe_access_internal will return TLB_MMIO to force the slow path for memory access. This results in probe_access returning NULL but the x86 access_ptr function happily accepts an empty haddr resulting in segfault hilarity. Check for an empty haddr to prevent the segfault and enable plugins to track all the memory operations for the x86 save/restore helpers. As we also want to run the slow path when instrumenting *-user we should also not have the short cutting test_ptr macro. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2489 Fixes: 6d03226b42 (plugins: force slow path when plugins instrument memory ops) Reviewed-by: Alexandre Iooss Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-8-alex.bennee@linaro.org> diff --git a/target/i386/tcg/access.c b/target/i386/tcg/access.c index 56a1181ea5..e68b73a24b 100644 --- a/target/i386/tcg/access.c +++ b/target/i386/tcg/access.c @@ -58,6 +58,11 @@ static void *access_ptr(X86Access *ac, vaddr addr, unsigned len) assert(addr >= ac->vaddr); + /* No haddr means probe_access wants to force slow path */ + if (!ac->haddr1) { + return NULL; + } + #ifdef CONFIG_USER_ONLY assert(offset <= ac->size1 - len); return ac->haddr1 + offset; @@ -78,17 +83,11 @@ static void *access_ptr(X86Access *ac, vaddr addr, unsigned len) #endif } -#ifdef CONFIG_USER_ONLY -# define test_ptr(p) true -#else -# define test_ptr(p) likely(p) -#endif - uint8_t access_ldb(X86Access *ac, vaddr addr) { void *p = access_ptr(ac, addr, sizeof(uint8_t)); - if (test_ptr(p)) { + if (likely(p)) { return ldub_p(p); } return cpu_ldub_mmuidx_ra(ac->env, addr, ac->mmu_idx, ac->ra); @@ -98,7 +97,7 @@ uint16_t access_ldw(X86Access *ac, vaddr addr) { void *p = access_ptr(ac, addr, sizeof(uint16_t)); - if (test_ptr(p)) { + if (likely(p)) { return lduw_le_p(p); } return cpu_lduw_le_mmuidx_ra(ac->env, addr, ac->mmu_idx, ac->ra); @@ -108,7 +107,7 @@ uint32_t access_ldl(X86Access *ac, vaddr addr) { void *p = access_ptr(ac, addr, sizeof(uint32_t)); - if (test_ptr(p)) { + if (likely(p)) { return ldl_le_p(p); } return cpu_ldl_le_mmuidx_ra(ac->env, addr, ac->mmu_idx, ac->ra); @@ -118,7 +117,7 @@ uint64_t access_ldq(X86Access *ac, vaddr addr) { void *p = access_ptr(ac, addr, sizeof(uint64_t)); - if (test_ptr(p)) { + if (likely(p)) { return ldq_le_p(p); } return cpu_ldq_le_mmuidx_ra(ac->env, addr, ac->mmu_idx, ac->ra); @@ -128,7 +127,7 @@ void access_stb(X86Access *ac, vaddr addr, uint8_t val) { void *p = access_ptr(ac, addr, sizeof(uint8_t)); - if (test_ptr(p)) { + if (likely(p)) { stb_p(p, val); } else { cpu_stb_mmuidx_ra(ac->env, addr, val, ac->mmu_idx, ac->ra); @@ -139,7 +138,7 @@ void access_stw(X86Access *ac, vaddr addr, uint16_t val) { void *p = access_ptr(ac, addr, sizeof(uint16_t)); - if (test_ptr(p)) { + if (likely(p)) { stw_le_p(p, val); } else { cpu_stw_le_mmuidx_ra(ac->env, addr, val, ac->mmu_idx, ac->ra); @@ -150,7 +149,7 @@ void access_stl(X86Access *ac, vaddr addr, uint32_t val) { void *p = access_ptr(ac, addr, sizeof(uint32_t)); - if (test_ptr(p)) { + if (likely(p)) { stl_le_p(p, val); } else { cpu_stl_le_mmuidx_ra(ac->env, addr, val, ac->mmu_idx, ac->ra); @@ -161,7 +160,7 @@ void access_stq(X86Access *ac, vaddr addr, uint64_t val) { void *p = access_ptr(ac, addr, sizeof(uint64_t)); - if (test_ptr(p)) { + if (likely(p)) { stq_le_p(p, val); } else { cpu_stq_le_mmuidx_ra(ac->env, addr, val, ac->mmu_idx, ac->ra); From patchwork Thu Aug 15 14:48:58 2024 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: 13764858 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7E6B9C52D7C for ; Thu, 15 Aug 2024 14:51:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebnH-0004Bx-KG; Thu, 15 Aug 2024 10:49:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebn4-0003VX-0k for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:27 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebmx-0000Co-P2 for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:25 -0400 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5b3fff87e6bso1341963a12.0 for ; Thu, 15 Aug 2024 07:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733358; x=1724338158; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FYuCdV1ZyypnBkOQom8SjG60bCuzuxobSZg1OwBHFdk=; b=O2d5eFYarK8rjagqIDeHbgc3JGFlXkBXWDO1GqeL10a5wjvNeomQPZG7WhjLJ/oSs2 5jbF+U7e+rai1ryxhrUYoWIokJgjxe/jVsG3gEqdj1VAJnwIYspkul4VriJ/6VgHKCTp +mMQiO6eUCbUftzVXd0skSGoPI8Cb3M06d3aqvz5OFJXEoPBqItEerggZ/s/xjdgvFKh w3wPrK37E9vmM8C0rGujyAOeipVIw0NH+7/ZlrUy3ydyNOReqftgeyP+0RzArbzmN2tR yIyylRwX1pluOeqEmng0CxuWAoacJ8vSEXtA9t3BTpQv9WK69lfFxwh9ey++vXBtapLN cZbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733358; x=1724338158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FYuCdV1ZyypnBkOQom8SjG60bCuzuxobSZg1OwBHFdk=; b=hLcQ1KU9K6t2B9VsCg2WO4StQGzVhq30HbVA9aX066H1qETkDVJsgCObWdHDBGZrOo RoqAXcaIu9sXuZdFcldcbycUH6rvNgEzYyHkAskqwYESWl8EpYJrv7KDkR22TexSPCNv 7TfER46XMUzBhMlz9o465x8O7K4mbdBqeDXPwvjrpMXQWqyiqdfffqk6SVU/z6bG91mg h6wmpEv7y62M72SwFzjAgY5I9kiiZ0u+Vt/jyKcDThdsf5pbXMtnOT1RP5ZCmpLsbtMO V9tobm2HpiqRl9XXMl0ktNlA/flAaqVI47qzLzgD1fnFaeEtaSAPg6uN5RoLpP3In/zl jzJQ== X-Gm-Message-State: AOJu0YxeWAmSpv2Ayl06mIsTOqrwn4lqE3wQ8p5D0n0uBqqTwX9VdXaA cYhED8kHNzOG1RhCkBPgXB7JDETLkX5pyQkWzLGmLrzbM3y1QC8zz8zUN70cVOo= X-Google-Smtp-Source: AGHT+IHnK0W0JlmGU+dwzmyXNucu9cfL2BQktxsgdXDkBXHDvall0HsYxSdryLlDUzuzVx97PTJ4ew== X-Received: by 2002:a05:6402:27c8:b0:5af:874d:1b7b with SMTP id 4fb4d7f45d1cf-5bea1c6ccfamr4177154a12.1.1723733357941; Thu, 15 Aug 2024 07:49:17 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bebbdfb923sm964102a12.54.2024.08.15.07.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:14 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 71A825F9DD; Thu, 15 Aug 2024 15:49:12 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour , Pierrick Bouvier Subject: [PULL 08/21] buildsys: Fix building without plugins on Darwin Date: Thu, 15 Aug 2024 15:48:58 +0100 Message-Id: <20240815144911.1931487-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52f.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Philippe Mathieu-Daudé Since commit 0082475e26 the plugin symbol list is unconditionally added to the linker flags, leading to a build failure: Undefined symbols for architecture arm64: "_qemu_plugin_entry_code", referenced from: ... ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. Fix by restricting the whole meson file to the --enable-plugins configure argument. Fixes: 0082475e26 ("meson: merge plugin_ldflags into emulator_link_args") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2476 Signed-off-by: Philippe Mathieu-Daudé Acked-by: Richard Henderson Message-Id: <20240813112457.92560-1-philmd@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-9-alex.bennee@linaro.org> diff --git a/plugins/meson.build b/plugins/meson.build index 18a0303bff..1cc039d29b 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -1,3 +1,7 @@ +if not get_option('plugins') + subdir_done() +endif + # Modules need more symbols than just those in plugins/qemu-plugins.symbols if not enable_modules if host_os == 'darwin' @@ -12,29 +16,27 @@ if not enable_modules endif endif -if get_option('plugins') - if host_os == 'windows' - dlltool = find_program('dlltool', required: true) +if host_os == 'windows' + dlltool = find_program('dlltool', required: true) - # Generate a .lib file for plugins to link against. - # First, create a .def file listing all the symbols a plugin should expect to have - # available in qemu - win32_plugin_def = configure_file( - input: files('qemu-plugins.symbols'), - output: 'qemu_plugin_api.def', - capture: true, - command: ['sed', '-e', '0,/^/s//EXPORTS/; s/[{};]//g', '@INPUT@']) - # then use dlltool to assemble a delaylib. - win32_qemu_plugin_api_lib = configure_file( - input: win32_plugin_def, - output: 'libqemu_plugin_api.a', - command: [dlltool, '--input-def', '@INPUT@', - '--output-delaylib', '@OUTPUT@', '--dllname', 'qemu.exe'] - ) - endif - specific_ss.add(files( - 'loader.c', - 'core.c', - 'api.c', - )) + # Generate a .lib file for plugins to link against. + # First, create a .def file listing all the symbols a plugin should expect to have + # available in qemu + win32_plugin_def = configure_file( + input: files('qemu-plugins.symbols'), + output: 'qemu_plugin_api.def', + capture: true, + command: ['sed', '-e', '0,/^/s//EXPORTS/; s/[{};]//g', '@INPUT@']) + # then use dlltool to assemble a delaylib. + win32_qemu_plugin_api_lib = configure_file( + input: win32_plugin_def, + output: 'libqemu_plugin_api.a', + command: [dlltool, '--input-def', '@INPUT@', + '--output-delaylib', '@OUTPUT@', '--dllname', 'qemu.exe'] + ) endif +specific_ss.add(files( + 'loader.c', + 'core.c', + 'api.c', +)) From patchwork Thu Aug 15 14:48:59 2024 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: 13764847 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 72222C52D7C for ; Thu, 15 Aug 2024 14:50:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebnI-0004Gr-MC; Thu, 15 Aug 2024 10:49:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebn8-0003mE-Jt for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:33 -0400 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebmy-0000D7-NM for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:30 -0400 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-530c2e5f4feso1004815e87.0 for ; Thu, 15 Aug 2024 07:49:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733359; x=1724338159; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IWTACBv+HeAaQXi6YaAMOGKH3fj3f0D4lBpZw0s1ht4=; b=BPnpheNxgBpHViJV7NaJdCWAidwqytdHOtlglwKZQHShPK17QldoysXIrmfeiSZ0I7 HB9oTJmLPR6/xcrWA513aNtyO2flPVFv0yNiISMz6dhjzHgZM5O0E+dFlcfZwxAp3x2X dpHzVPAxz9Z3MYySlCb+g6YrG9QCri6IPNhmx18Jkq/6fXlkyaoC2ycEACQQR0Gku87S TemOKeWPkTvkNaORA4oHFC7GpUpjlF7F1Y+OZPrfz9yHFgdVzxYD2NQQB75hTuWTgf4M tnLH7KGWRX6kKHN5Az0KAIaRlotbaicLnUmqOkOIfBp9vmn/YOeR/U+f5nbPJuIFKtt+ vqsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733359; x=1724338159; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IWTACBv+HeAaQXi6YaAMOGKH3fj3f0D4lBpZw0s1ht4=; b=tmRNcjMP4PzrVk+vW0e4NZYBNy9r1/6UZ3IIHzQe5yACfBPZUkpeTIt66zEGp1YnZo 1bAiQyPjLOhLzl5xsworf5t8zbNJrkYEMvJ8wl2/Y5wakLHwYWtI6nbyoMKh85xQEnN+ a9/1OYyJgbw++rmDBdl5KakMSsfk3svML5pbikLAPNEH3MndnSjYbALVn0/FfCcIYBQE ZAxUuZQJ4DnPd2yCtIEZKkX0r6ZRCWqbTeOQvWE4kdcg9O5bKSnTLClYX27ccuPBRr/G l/cCmLQM3WbNhZ0DiTgC3zqvbXgZHqmSNq569MkC2cSj+4AaWmxunAZ14sNlqlX6j7YK DPjg== X-Gm-Message-State: AOJu0Yw65oFqkGw8DrZV+VxaZKjdG+RAeOPs3UhhLEepZfd0/ypmXWjM VYP13PMJkCcglAuopQiSH1KSaWu0c99k7k6thOfZVFYd1fYpXCR3aisidAAuVPs= X-Google-Smtp-Source: AGHT+IHyXX5T+WmtZHNGlqwfXT+SWZSFk15EGj0d+0oHXN8/9iGf7e/oqAVcvanobgr6dOkr6vBSaQ== X-Received: by 2002:a05:6512:400c:b0:52e:9f76:53dc with SMTP id 2adb3069b0e04-532ed727a86mr4350639e87.0.1723733358302; Thu, 15 Aug 2024 07:49:18 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a838396cddfsm111806966b.199.2024.08.15.07.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:14 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 897B35F9EA; Thu, 15 Aug 2024 15:49:12 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Nicholas Piggin , =?utf-8?q?Alex_Benn=C3=A9e?= , John Snow , Cleber Rosa Subject: [PULL 09/21] scripts/replay-dump.py: Update to current rr record format Date: Thu, 15 Aug 2024 15:48:59 +0100 Message-Id: <20240815144911.1931487-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x136.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Nicholas Piggin The v12 format support for replay-dump has a few issues still. This fixes async decoding; adds event, shutdown, and end decoding; fixes audio in / out events, fixes checkpoint checking of following async events. Reviewed-by: Alex Bennée Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-2-npiggin@gmail.com> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-10-alex.bennee@linaro.org> diff --git a/scripts/replay-dump.py b/scripts/replay-dump.py index d668193e79..419ee3257b 100755 --- a/scripts/replay-dump.py +++ b/scripts/replay-dump.py @@ -20,6 +20,7 @@ import argparse import struct +import os from collections import namedtuple from os import path @@ -134,6 +135,17 @@ def swallow_async_qword(eid, name, dumpfile): print(" %s(%d) @ %d" % (name, eid, step_id)) return True +def swallow_bytes(eid, name, dumpfile, nr): + """Swallow nr bytes of data without looking at it""" + dumpfile.seek(nr, os.SEEK_CUR) + +def decode_exception(eid, name, dumpfile): + print_event(eid, name) + return True + +# v12 does away with the additional event byte and encodes it in the main type +# Between v8 and v9, REPLAY_ASYNC_BH_ONESHOT was added, but we don't decode +# those versions so leave it out. async_decode_table = [ Decoder(0, "REPLAY_ASYNC_EVENT_BH", swallow_async_qword), Decoder(1, "REPLAY_ASYNC_INPUT", decode_unimp), Decoder(2, "REPLAY_ASYNC_INPUT_SYNC", decode_unimp), @@ -142,8 +154,8 @@ def swallow_async_qword(eid, name, dumpfile): Decoder(5, "REPLAY_ASYNC_EVENT_NET", decode_unimp), ] # See replay_read_events/replay_read_event -def decode_async(eid, name, dumpfile): - """Decode an ASYNC event""" +def decode_async_old(eid, name, dumpfile): + """Decode an ASYNC event (pre-v8)""" print_event(eid, name) @@ -157,6 +169,35 @@ def decode_async(eid, name, dumpfile): return call_decode(async_decode_table, async_event_kind, dumpfile) +def decode_async_bh(eid, name, dumpfile): + op_id = read_qword(dumpfile) + print_event(eid, name) + return True + +def decode_async_bh_oneshot(eid, name, dumpfile): + op_id = read_qword(dumpfile) + print_event(eid, name) + return True + +def decode_async_char_read(eid, name, dumpfile): + char_id = read_byte(dumpfile) + size = read_dword(dumpfile) + print_event(eid, name, "device:%x chars:%s" % (char_id, dumpfile.read(size))) + return True + +def decode_async_block(eid, name, dumpfile): + op_id = read_qword(dumpfile) + print_event(eid, name) + return True + +def decode_async_net(eid, name, dumpfile): + net_id = read_byte(dumpfile) + flags = read_dword(dumpfile) + size = read_dword(dumpfile) + swallow_bytes(eid, name, dumpfile, size) + print_event(eid, name, "net:%x flags:%x bytes:%d" % (net_id, flags, size)) + return True + total_insns = 0 def decode_instruction(eid, name, dumpfile): @@ -166,6 +207,10 @@ def decode_instruction(eid, name, dumpfile): print_event(eid, name, "+ %d -> %d" % (ins_diff, total_insns)) return True +def decode_shutdown(eid, name, dumpfile): + print_event(eid, name) + return True + def decode_char_write(eid, name, dumpfile): res = read_dword(dumpfile) offset = read_dword(dumpfile) @@ -177,7 +222,7 @@ def decode_audio_out(eid, name, dumpfile): print_event(eid, name, "%d" % (audio_data)) return True -def decode_checkpoint(eid, name, dumpfile): +def __decode_checkpoint(eid, name, dumpfile, old): """Decode a checkpoint. Checkpoints contain a series of async events with their own specific data. @@ -189,14 +234,20 @@ def decode_checkpoint(eid, name, dumpfile): # if the next event is EVENT_ASYNC there are a bunch of # async events to read, otherwise we are done - if next_event != 3: - print_event(eid, name, "no additional data", event_number) - else: + if (old and next_event == 3) or (not old and next_event >= 3 and next_event <= 9): print_event(eid, name, "more data follows", event_number) + else: + print_event(eid, name, "no additional data", event_number) replay_state.reuse_event(next_event) return True +def decode_checkpoint_old(eid, name, dumpfile): + return __decode_checkpoint(eid, name, dumpfile, False) + +def decode_checkpoint(eid, name, dumpfile): + return __decode_checkpoint(eid, name, dumpfile, True) + def decode_checkpoint_init(eid, name, dumpfile): print_event(eid, name) return True @@ -212,15 +263,23 @@ def decode_clock(eid, name, dumpfile): def decode_random(eid, name, dumpfile): ret = read_dword(dumpfile) - data = read_array(dumpfile) - print_event(eid, "%d bytes of random data" % len(data)) + size = read_dword(dumpfile) + swallow_bytes(eid, name, dumpfile, size) + if (ret): + print_event(eid, name, "%d bytes (getrandom failed)" % (size)) + else: + print_event(eid, name, "%d bytes" % (size)) return True +def decode_end(eid, name, dumpfile): + print_event(eid, name) + return False + # pre-MTTCG merge v5_event_table = [Decoder(0, "EVENT_INSTRUCTION", decode_instruction), Decoder(1, "EVENT_INTERRUPT", decode_interrupt), Decoder(2, "EVENT_EXCEPTION", decode_plain), - Decoder(3, "EVENT_ASYNC", decode_async), + Decoder(3, "EVENT_ASYNC", decode_async_old), Decoder(4, "EVENT_SHUTDOWN", decode_unimp), Decoder(5, "EVENT_CHAR_WRITE", decode_char_write), Decoder(6, "EVENT_CHAR_READ_ALL", decode_unimp), @@ -242,7 +301,7 @@ def decode_random(eid, name, dumpfile): v6_event_table = [Decoder(0, "EVENT_INSTRUCTION", decode_instruction), Decoder(1, "EVENT_INTERRUPT", decode_interrupt), Decoder(2, "EVENT_EXCEPTION", decode_plain), - Decoder(3, "EVENT_ASYNC", decode_async), + Decoder(3, "EVENT_ASYNC", decode_async_old), Decoder(4, "EVENT_SHUTDOWN", decode_unimp), Decoder(5, "EVENT_CHAR_WRITE", decode_char_write), Decoder(6, "EVENT_CHAR_READ_ALL", decode_unimp), @@ -266,7 +325,7 @@ def decode_random(eid, name, dumpfile): v7_event_table = [Decoder(0, "EVENT_INSTRUCTION", decode_instruction), Decoder(1, "EVENT_INTERRUPT", decode_interrupt), Decoder(2, "EVENT_EXCEPTION", decode_unimp), - Decoder(3, "EVENT_ASYNC", decode_async), + Decoder(3, "EVENT_ASYNC", decode_async_old), Decoder(4, "EVENT_SHUTDOWN", decode_unimp), Decoder(5, "EVENT_SHUTDOWN_HOST_ERR", decode_unimp), Decoder(6, "EVENT_SHUTDOWN_HOST_QMP", decode_unimp), @@ -296,32 +355,31 @@ def decode_random(eid, name, dumpfile): v12_event_table = [Decoder(0, "EVENT_INSTRUCTION", decode_instruction), Decoder(1, "EVENT_INTERRUPT", decode_interrupt), - Decoder(2, "EVENT_EXCEPTION", decode_plain), - Decoder(3, "EVENT_ASYNC", decode_async), - Decoder(4, "EVENT_ASYNC", decode_async), - Decoder(5, "EVENT_ASYNC", decode_async), - Decoder(6, "EVENT_ASYNC", decode_async), - Decoder(6, "EVENT_ASYNC", decode_async), - Decoder(8, "EVENT_ASYNC", decode_async), - Decoder(9, "EVENT_ASYNC", decode_async), - Decoder(10, "EVENT_ASYNC", decode_async), - Decoder(11, "EVENT_SHUTDOWN", decode_unimp), - Decoder(12, "EVENT_SHUTDOWN_HOST_ERR", decode_unimp), - Decoder(13, "EVENT_SHUTDOWN_HOST_QMP_QUIT", decode_unimp), - Decoder(14, "EVENT_SHUTDOWN_HOST_QMP_RESET", decode_unimp), - Decoder(14, "EVENT_SHUTDOWN_HOST_SIGNAL", decode_unimp), - Decoder(15, "EVENT_SHUTDOWN_HOST_UI", decode_unimp), - Decoder(16, "EVENT_SHUTDOWN_GUEST_SHUTDOWN", decode_unimp), - Decoder(17, "EVENT_SHUTDOWN_GUEST_RESET", decode_unimp), - Decoder(18, "EVENT_SHUTDOWN_GUEST_PANIC", decode_unimp), - Decoder(19, "EVENT_SHUTDOWN_GUEST_SUBSYSTEM_RESET", decode_unimp), - Decoder(20, "EVENT_SHUTDOWN_GUEST_SNAPSHOT_LOAD", decode_unimp), - Decoder(21, "EVENT_SHUTDOWN___MAX", decode_unimp), + Decoder(2, "EVENT_EXCEPTION", decode_exception), + Decoder(3, "EVENT_ASYNC_BH", decode_async_bh), + Decoder(4, "EVENT_ASYNC_BH_ONESHOT", decode_async_bh_oneshot), + Decoder(5, "EVENT_ASYNC_INPUT", decode_unimp), + Decoder(6, "EVENT_ASYNC_INPUT_SYNC", decode_unimp), + Decoder(7, "EVENT_ASYNC_CHAR_READ", decode_async_char_read), + Decoder(8, "EVENT_ASYNC_BLOCK", decode_async_block), + Decoder(9, "EVENT_ASYNC_NET", decode_async_net), + Decoder(10, "EVENT_SHUTDOWN", decode_shutdown), + Decoder(11, "EVENT_SHUTDOWN_HOST_ERR", decode_shutdown), + Decoder(12, "EVENT_SHUTDOWN_HOST_QMP_QUIT", decode_shutdown), + Decoder(13, "EVENT_SHUTDOWN_HOST_QMP_RESET", decode_shutdown), + Decoder(14, "EVENT_SHUTDOWN_HOST_SIGNAL", decode_shutdown), + Decoder(15, "EVENT_SHUTDOWN_HOST_UI", decode_shutdown), + Decoder(16, "EVENT_SHUTDOWN_GUEST_SHUTDOWN", decode_shutdown), + Decoder(17, "EVENT_SHUTDOWN_GUEST_RESET", decode_shutdown), + Decoder(18, "EVENT_SHUTDOWN_GUEST_PANIC", decode_shutdown), + Decoder(19, "EVENT_SHUTDOWN_SUBSYS_RESET", decode_shutdown), + Decoder(20, "EVENT_SHUTDOWN_SNAPSHOT_LOAD", decode_shutdown), + Decoder(21, "EVENT_SHUTDOWN___MAX", decode_shutdown), Decoder(22, "EVENT_CHAR_WRITE", decode_char_write), Decoder(23, "EVENT_CHAR_READ_ALL", decode_unimp), Decoder(24, "EVENT_CHAR_READ_ALL_ERROR", decode_unimp), - Decoder(25, "EVENT_AUDIO_IN", decode_unimp), - Decoder(26, "EVENT_AUDIO_OUT", decode_audio_out), + Decoder(25, "EVENT_AUDIO_OUT", decode_audio_out), + Decoder(26, "EVENT_AUDIO_IN", decode_unimp), Decoder(27, "EVENT_RANDOM", decode_random), Decoder(28, "EVENT_CLOCK_HOST", decode_clock), Decoder(29, "EVENT_CLOCK_VIRTUAL_RT", decode_clock), @@ -334,6 +392,7 @@ def decode_random(eid, name, dumpfile): Decoder(36, "EVENT_CP_CLOCK_VIRTUAL_RT", decode_checkpoint), Decoder(37, "EVENT_CP_INIT", decode_checkpoint_init), Decoder(38, "EVENT_CP_RESET", decode_checkpoint), + Decoder(39, "EVENT_END", decode_end), ] def parse_arguments(): From patchwork Thu Aug 15 14:49:00 2024 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: 13764859 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5736CC52D7D for ; Thu, 15 Aug 2024 14:51:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebnK-0004Ns-CZ; Thu, 15 Aug 2024 10:49:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebn2-0003PJ-EU for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:25 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebn0-0000DO-7m for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:24 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a7d26c2297eso125796066b.2 for ; Thu, 15 Aug 2024 07:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733361; x=1724338161; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6AOhP2ldyW9UA6bgoSKwypPabALbgykDRW8dOBoMAIA=; b=lLj4QVBvlQoFeurEdEgjWfYD5kb9gn2VDyHmg2dMYG62EXDUNRAEXoaRsaIEnLnGbE mjLn5y5ERcarD/AprsvNQtye1Je9XlPxSAozqYt3iCRcMrLgquWQbk3xqCF1GGp+fefK X2un2xKnGNj2XH/Hr2Ssp4FTp9JUD83rjS+qeGiZoAE7jpbFieaGS/o31CeUddiWXRCf ukb98IkrFkwWqvtt1vj3fra2w73Zguw0Dpink2rJ1TFkQmxMADa3kCyWt5a+6D4380K2 5hngoaLn3DNb1ob3Mhtr3v2x0RedQx5XklpNgZPmhU8bEKsDugYteEKLPmJCSaOU15dp 9FaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733361; x=1724338161; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6AOhP2ldyW9UA6bgoSKwypPabALbgykDRW8dOBoMAIA=; b=Q/XyubXhtb7zya+t0CTymL2n5SI4Q6fhPdgx/JidklTS9cyStSs2d0lYodEpEr+5gx bnO0QU+OL6RGr8tCafSVitIPgGXbBHosrIMiH0Us9ss/VNMfGmt+QMKEmGdfWEYzUl2k 1ovT6oVV3bP/5iR9ZwlEG0vOV9zsBYALkaU2AJNDXcp7KGigMBgftMn+G7Q8edink+IO JclFwDXbs81ECVBDCjPbFQlBpF3PYLj6pHC3m+ONn6qy4QOx260znkLR/RxgFLeUxjUg KBgTeB3aAos0mHV0p5D86aLAHpct5pzNV4i0prIKQYfPuGZbmqmVAvVsC3QaDfnlNr7s u24g== X-Gm-Message-State: AOJu0YyT9FREyIzf1ymc8FG2Qd9fRFtDhAndUzpMGCwH3YEBLx7OYcpJ wrmmodsXVdLK6fzfrUXrm/HZ2u3nE+NXOMjm3VWvC/rCUodjQGpk55I1eFgxkFw= X-Google-Smtp-Source: AGHT+IGTR7+5pIbUmpdxbLtANIQPNulj2j4SMqLKCNgnhSxUZyB6aSJXv9qzgNLMrIcPORNUVg3hkQ== X-Received: by 2002:a17:907:e2e2:b0:a77:d773:54ec with SMTP id a640c23a62f3a-a8366c0beefmr428795666b.8.1723733360172; Thu, 15 Aug 2024 07:49:20 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a83838cfb47sm113120066b.74.2024.08.15.07.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:14 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 9E07F5FC0F; Thu, 15 Aug 2024 15:49:12 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Nicholas Piggin , =?utf-8?q?Alex_Benn=C3=A9e?= , John Snow , Cleber Rosa Subject: [PULL 10/21] scripts/replay-dump.py: rejig decoders in event number order Date: Thu, 15 Aug 2024 15:49:00 +0100 Message-Id: <20240815144911.1931487-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62c.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Nicholas Piggin Sort decoder functions to be ascending in order of event number, same as the decoder tables. Reviewed-by: Alex Bennée Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-3-npiggin@gmail.com> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-11-alex.bennee@linaro.org> diff --git a/scripts/replay-dump.py b/scripts/replay-dump.py index 419ee3257b..b82659cfb6 100755 --- a/scripts/replay-dump.py +++ b/scripts/replay-dump.py @@ -139,6 +139,19 @@ def swallow_bytes(eid, name, dumpfile, nr): """Swallow nr bytes of data without looking at it""" dumpfile.seek(nr, os.SEEK_CUR) +total_insns = 0 + +def decode_instruction(eid, name, dumpfile): + global total_insns + ins_diff = read_dword(dumpfile) + total_insns += ins_diff + print_event(eid, name, "+ %d -> %d" % (ins_diff, total_insns)) + return True + +def decode_interrupt(eid, name, dumpfile): + print_event(eid, name) + return True + def decode_exception(eid, name, dumpfile): print_event(eid, name) return True @@ -198,15 +211,6 @@ def decode_async_net(eid, name, dumpfile): print_event(eid, name, "net:%x flags:%x bytes:%d" % (net_id, flags, size)) return True -total_insns = 0 - -def decode_instruction(eid, name, dumpfile): - global total_insns - ins_diff = read_dword(dumpfile) - total_insns += ins_diff - print_event(eid, name, "+ %d -> %d" % (ins_diff, total_insns)) - return True - def decode_shutdown(eid, name, dumpfile): print_event(eid, name) return True @@ -222,6 +226,21 @@ def decode_audio_out(eid, name, dumpfile): print_event(eid, name, "%d" % (audio_data)) return True +def decode_random(eid, name, dumpfile): + ret = read_dword(dumpfile) + size = read_dword(dumpfile) + swallow_bytes(eid, name, dumpfile, size) + if (ret): + print_event(eid, name, "%d bytes (getrandom failed)" % (size)) + else: + print_event(eid, name, "%d bytes" % (size)) + return True + +def decode_clock(eid, name, dumpfile): + clock_data = read_qword(dumpfile) + print_event(eid, name, "0x%x" % (clock_data)) + return True + def __decode_checkpoint(eid, name, dumpfile, old): """Decode a checkpoint. @@ -252,25 +271,6 @@ def decode_checkpoint_init(eid, name, dumpfile): print_event(eid, name) return True -def decode_interrupt(eid, name, dumpfile): - print_event(eid, name) - return True - -def decode_clock(eid, name, dumpfile): - clock_data = read_qword(dumpfile) - print_event(eid, name, "0x%x" % (clock_data)) - return True - -def decode_random(eid, name, dumpfile): - ret = read_dword(dumpfile) - size = read_dword(dumpfile) - swallow_bytes(eid, name, dumpfile, size) - if (ret): - print_event(eid, name, "%d bytes (getrandom failed)" % (size)) - else: - print_event(eid, name, "%d bytes" % (size)) - return True - def decode_end(eid, name, dumpfile): print_event(eid, name) return False From patchwork Thu Aug 15 14:49:01 2024 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: 13764853 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A7E14C3DA7F for ; Thu, 15 Aug 2024 14:50:59 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebnJ-0004LH-PZ; Thu, 15 Aug 2024 10:49:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebn3-0003Tg-Is for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:25 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebn1-0000Dh-EN for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:25 -0400 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5a309d1a788so1280888a12.3 for ; Thu, 15 Aug 2024 07:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733362; x=1724338162; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5GlC9DIF5/JKDes/L5KgAf0CY2UX88jzKAHhIzM/8FI=; b=shfJg6BnSAzXePRmYEUPD+yAMCnFJtS4pebrhdhkZXDJDZ9v4/6M0URVi522DFJD/E F7KY/OzVI25iZBNzJfppJ+ggIqSg0UKmrhNVu6I3Q4+LAGxY+yqyJV405dYZoRyvmbHI nMlstNPnhJAcpHmwnh/oRtDs5rDZ7+yJo21o9Gvb10F1tnYHdtX3k5fxL6JNnLCcvir2 K1H1+wgNPiNWC/rJnpsGp3UUpMB4zlYLCxWb7qBpdlJ9/KfWqyHTZxd2oEATNEvltpmZ Ue1uP+P0JqoBwfiXXRWOjmspRuhZc3gmd4uWL8VjC5umrrxhUVcMC5x+bsLov6i79eCD qJrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733362; x=1724338162; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5GlC9DIF5/JKDes/L5KgAf0CY2UX88jzKAHhIzM/8FI=; b=xRmq+qsGzKG7c+LbYdYOav+sWeK/liMN4YyRMrJ+1cCBTNXKvjCtLqcOK1M6ZHzxrL OG7uFs2V8lDti0sCeOJZjyT8IRZkuF/QXYvNUaaqvBji8ojlF+p1IekZCNmIcM9a89xF S0YiPAs7zYASVvwIfZEZ2e3gaildDCNVPoEX/xZp6Oz/obYA92t7wJAJjiQYns/i+Cp8 wTEz6lcX7am2XlCrTc+haNJ0uwyNRPQzmJuleBmPZJnvAl0WASKkzzQTmECTDIhLmM1s n5WViXZmPN2E8nFH1/CWflfJg6UnDVTEoBoaPyfwkCiwOss9GsZhypwoNBmG4mI4H3Ih BhoQ== X-Gm-Message-State: AOJu0YzzvLyWc2MwApRQYrxZuUzyFZewbWwzH+ONQLs0EEh0/a4rIdpb vhvYktJbaoJZQcoqF1RutZrMXrHGRUCm6AJ6Wwpuw7asKsZRNF0ObB58KsK86Z3Bm4XqHbfoqhP m X-Google-Smtp-Source: AGHT+IGgvsSlxO7bF8l2j62iweyr31Ounb8K+OodmdPj0zBP79s8zOkfZKaTslOaeUiG8gTdTMMXKg== X-Received: by 2002:a17:907:d846:b0:a77:e55a:9e89 with SMTP id a640c23a62f3a-a8366ff435dmr421603466b.52.1723733360909; Thu, 15 Aug 2024 07:49:20 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8383947b86sm113033866b.187.2024.08.15.07.49.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:20 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B65505FD21; Thu, 15 Aug 2024 15:49:12 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Nicholas Piggin , =?utf-8?q?Alex_Benn=C3=A9e?= , Pavel Dovgalyuk , John Snow , Cleber Rosa , Pavel Dovgalyuk , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 11/21] tests/avocado: excercise scripts/replay-dump.py in replay tests Date: Thu, 15 Aug 2024 15:49:01 +0100 Message-Id: <20240815144911.1931487-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52e.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Nicholas Piggin This runs replay-dump.py after recording a trace, and fails the test if the script fails. replay-dump.py is modified to exit with non-zero if an error is encountered while parsing, to support this. Reviewed-by: Alex Bennée Reviewed-by: Pavel Dovgalyuk Signed-off-by: Nicholas Piggin gitlab with this change v5: Update timeout to 180s because x86 was just exceeding 120s in Message-Id: <20240813050638.446172-4-npiggin@gmail.com> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-12-alex.bennee@linaro.org> diff --git a/scripts/replay-dump.py b/scripts/replay-dump.py index b82659cfb6..4ce7ff51cc 100755 --- a/scripts/replay-dump.py +++ b/scripts/replay-dump.py @@ -21,6 +21,7 @@ import argparse import struct import os +import sys from collections import namedtuple from os import path @@ -100,7 +101,7 @@ def call_decode(table, index, dumpfile): print("Could not decode index: %d" % (index)) print("Entry is: %s" % (decoder)) print("Decode Table is:\n%s" % (table)) - return False + raise(Exception("unknown event")) else: return decoder.fn(decoder.eid, decoder.name, dumpfile) @@ -121,7 +122,7 @@ def print_event(eid, name, string=None, event_count=None): def decode_unimp(eid, name, _unused_dumpfile): "Unimplemented decoder, will trigger exit" print("%s not handled - will now stop" % (name)) - return False + raise(Exception("unhandled event")) def decode_plain(eid, name, _unused_dumpfile): "Plain events without additional data" @@ -434,6 +435,7 @@ def decode_file(filename): dumpfile) except Exception as inst: print(f"error {inst}") + sys.exit(1) finally: print(f"Reached {dumpfile.tell()} of {dumpsize} bytes") diff --git a/tests/avocado/replay_kernel.py b/tests/avocado/replay_kernel.py index 232d287c27..a668af9d36 100644 --- a/tests/avocado/replay_kernel.py +++ b/tests/avocado/replay_kernel.py @@ -13,6 +13,7 @@ import shutil import logging import time +import subprocess from avocado import skip from avocado import skipUnless @@ -31,7 +32,7 @@ class ReplayKernelBase(LinuxKernelTest): terminates. """ - timeout = 120 + timeout = 180 KERNEL_COMMON_COMMAND_LINE = 'printk.time=1 panic=-1 ' def run_vm(self, kernel_path, kernel_command_line, console_pattern, @@ -63,6 +64,8 @@ def run_vm(self, kernel_path, kernel_command_line, console_pattern, vm.shutdown() logger.info('finished the recording with log size %s bytes' % os.path.getsize(replay_path)) + self.run_replay_dump(replay_path) + logger.info('successfully tested replay-dump.py') else: vm.wait() logger.info('successfully finished the replay') @@ -70,6 +73,14 @@ def run_vm(self, kernel_path, kernel_command_line, console_pattern, logger.info('elapsed time %.2f sec' % elapsed) return elapsed + def run_replay_dump(self, replay_path): + try: + subprocess.check_call(["./scripts/replay-dump.py", + "-f", replay_path], + stdout=subprocess.DEVNULL) + except subprocess.CalledProcessError: + self.fail('replay-dump.py failed') + def run_rr(self, kernel_path, kernel_command_line, console_pattern, shift=7, args=None): replay_path = os.path.join(self.workdir, 'replay.bin') diff --git a/tests/avocado/replay_linux.py b/tests/avocado/replay_linux.py index b4673261ce..5916922435 100644 --- a/tests/avocado/replay_linux.py +++ b/tests/avocado/replay_linux.py @@ -94,6 +94,8 @@ def launch_and_wait(self, record, args, shift): vm.shutdown() logger.info('finished the recording with log size %s bytes' % os.path.getsize(replay_path)) + self.run_replay_dump(replay_path) + logger.info('successfully tested replay-dump.py') else: vm.event_wait('SHUTDOWN', self.timeout) vm.wait() @@ -108,6 +110,14 @@ def run_rr(self, args=None, shift=7): logger = logging.getLogger('replay') logger.info('replay overhead {:.2%}'.format(t2 / t1 - 1)) + def run_replay_dump(self, replay_path): + try: + subprocess.check_call(["./scripts/replay-dump.py", + "-f", replay_path], + stdout=subprocess.DEVNULL) + except subprocess.CalledProcessError: + self.fail('replay-dump.py failed') + @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') class ReplayLinuxX8664(ReplayLinux): """ From patchwork Thu Aug 15 14:49:02 2024 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: 13764864 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A5960C52D7C for ; Thu, 15 Aug 2024 14:54:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebnK-0004Np-DB; Thu, 15 Aug 2024 10:49:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebn4-0003Vt-3j for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:27 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebn2-0000Dm-2G for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:25 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5bebd3b7c22so881407a12.0 for ; Thu, 15 Aug 2024 07:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733362; x=1724338162; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Q14NFcjm+pOoVDQJIzMT7lWclsNqJbgHZCvrVMkJVPA=; b=X3hMY+d36VaFj6tWAMdcMu+SwliPV2N/R3jif1BlRK8EwqzBjHCp2RWqpC0IqgBUo1 LyWtrPk4J18AH1D7giV2fDG9+qzNa1JV5hxvbQaDUwOe219HMKfdDlGfR6XyVi8ETWl1 37S2KqbuuWelohA+DI444nB9QOCqJEKzROZLfPhGXTRD4/kByCv6t5lE0kOsHJDjXdY3 AQRuDKcjqD2tVSuh2UYzFxYfpsa03UXjElQEYm72bhTbM6Mj/RPfbDQ7v2ZQ/x1c0DeS 8Yl3PorN6bHGcsFSRmPz4qaxiCiiYFSv8fTWnPWIT56h+v+IyREv1/CTv3Mn+XvrBrDy l+Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733362; x=1724338162; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q14NFcjm+pOoVDQJIzMT7lWclsNqJbgHZCvrVMkJVPA=; b=vlxSTxTgtN0cmOe5TYKcSX4x2MjJM8xxJ8GDluvdGwpC+gMLFPPoHT2Uyy6LfmX44T F9j3W8j+i5/OUdenhwd4+4GjC+U5kiwU7Ywm/Snzvdqowj9FzGqjQp8ahQ5MYwDhUZoh cHJjuigAmIP5jK0iBKLJOZcGs2PEEKsouUhRdhYvmMWLuIMf4BY4r4kQ+KlPb4RrQNPT AGj6OvWSnWnb4KNESpifF1Z7gKuaYQ+F6nf9vX64Je1JP3CYb6cGetiSce1RFP6J03TR g03paBn6JgGEx+1GpCUvueMi+YhR+un39BPvJcWb7vgplLr4oR/ZoAvsBTcnAIQt5hTb 1iUw== X-Gm-Message-State: AOJu0Yzkbki2jKTyHNopZXySJu55j0zmSjnv5DUsml8cZHxzZNXjYdN4 I8QEAa5eJDy6klzNUT4hKB/qbgHEPDJ3DrpnFFgWQCki73ynv/KrXCEQTF/9+Is= X-Google-Smtp-Source: AGHT+IGSLzj0jLlcFFdgKGNL1moTkKTD+RSr8ZHkEKmu5ihEzUTw2aIQvSJ8nj1PR9CEijArGRGvnQ== X-Received: by 2002:a17:907:e2d7:b0:a7a:acae:3419 with SMTP id a640c23a62f3a-a837ce46bc2mr294083166b.28.1723733362137; Thu, 15 Aug 2024 07:49:22 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a83838cf9c3sm112156966b.70.2024.08.15.07.49.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:20 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id CFDD85FD40; Thu, 15 Aug 2024 15:49:12 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Nicholas Piggin , =?utf-8?q?Alex_Benn=C3=A9e?= , Pavel Dovgalyuk , Paolo Bonzini , Pavel Dovgalyuk Subject: [PULL 12/21] replay: allow runstate shutdown->running when replaying trace Date: Thu, 15 Aug 2024 15:49:02 +0100 Message-Id: <20240815144911.1931487-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52b.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Nicholas Piggin When replaying a trace, it is possible to go from shutdown to running with a reverse-debugging step. This can be useful if the problem being debugged triggers a reset or shutdown. This can be tested by making a recording of a machine that shuts down, then using -action shutdown=pause when replaying it. Continuing to the end of the trace then reverse-stepping in gdb crashes due to invalid runstate transition. Just permitting the transition seems to be all that's necessary for reverse-debugging to work well in such a state. Reviewed-by: Alex Bennée Reviewed-by: Pavel Dovgalyuk Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-5-npiggin@gmail.com> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-13-alex.bennee@linaro.org> diff --git a/include/sysemu/runstate.h b/include/sysemu/runstate.h index e210a37abf..11c7ff3ffb 100644 --- a/include/sysemu/runstate.h +++ b/include/sysemu/runstate.h @@ -9,6 +9,7 @@ void runstate_set(RunState new_state); RunState runstate_get(void); bool runstate_is_running(void); bool runstate_needs_reset(void); +void runstate_replay_enable(void); typedef void VMChangeStateHandler(void *opaque, bool running, RunState state); diff --git a/replay/replay.c b/replay/replay.c index a2c576c16e..b8564a4813 100644 --- a/replay/replay.c +++ b/replay/replay.c @@ -385,6 +385,8 @@ static void replay_enable(const char *fname, int mode) replay_fetch_data_kind(); } + runstate_replay_enable(); + replay_init_events(); } diff --git a/system/runstate.c b/system/runstate.c index c833316f6d..a0e2a5fd22 100644 --- a/system/runstate.c +++ b/system/runstate.c @@ -181,6 +181,12 @@ static const RunStateTransition runstate_transitions_def[] = { { RUN_STATE__MAX, RUN_STATE__MAX }, }; +static const RunStateTransition replay_play_runstate_transitions_def[] = { + { RUN_STATE_SHUTDOWN, RUN_STATE_RUNNING}, + + { RUN_STATE__MAX, RUN_STATE__MAX }, +}; + static bool runstate_valid_transitions[RUN_STATE__MAX][RUN_STATE__MAX]; bool runstate_check(RunState state) @@ -188,14 +194,33 @@ bool runstate_check(RunState state) return current_run_state == state; } -static void runstate_init(void) +static void transitions_set_valid(const RunStateTransition *rst) { const RunStateTransition *p; - memset(&runstate_valid_transitions, 0, sizeof(runstate_valid_transitions)); - for (p = &runstate_transitions_def[0]; p->from != RUN_STATE__MAX; p++) { + for (p = rst; p->from != RUN_STATE__MAX; p++) { runstate_valid_transitions[p->from][p->to] = true; } +} + +void runstate_replay_enable(void) +{ + assert(replay_mode != REPLAY_MODE_NONE); + + if (replay_mode == REPLAY_MODE_PLAY) { + /* + * When reverse-debugging, it is possible to move state from + * shutdown to running. + */ + transitions_set_valid(&replay_play_runstate_transitions_def[0]); + } +} + +static void runstate_init(void) +{ + memset(&runstate_valid_transitions, 0, sizeof(runstate_valid_transitions)); + + transitions_set_valid(&runstate_transitions_def[0]); qemu_mutex_init(&vmstop_lock); } From patchwork Thu Aug 15 14:49:03 2024 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: 13764852 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B8E7CC52D7C for ; Thu, 15 Aug 2024 14:50:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebnJ-0004Le-Sd; Thu, 15 Aug 2024 10:49:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebn4-0003Wj-B2 for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:27 -0400 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebn1-0000Di-T4 for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:26 -0400 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2f01e9f53e3so15908381fa.1 for ; Thu, 15 Aug 2024 07:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733362; x=1724338162; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aOj2cgvMvGGvvAwDFJY/i7+D7jI4xMnmqcjq9GVb3BQ=; b=hoIQySz3fOp8NAtyT23B9ad5O/YAHSJk3fA8ewT0NspYq7zvPaFVu6DClT6zjVcHLK 37ayg7N9z8nr1+GDzOyJlUM/DbzqaZm8AkDT0STf6Fo9qf3uBb0BeAio6o2DBR9+rtRt icTid+lDZ2xHU9J7BXaHN+xnw4oB60CwLP2HEk4ckKdcBn/96Bc8Q3Or+DigU95RReHc /NCc9qX2xds1CVn0dbuM/f0S8eTlV1w2+piQZb4r+z16wpoIiTDzY9wSnWNcsIWBRb2B k3zTuZT5aC191x7H4inSBw5IQsyT+owaN4uE7QgH7lkzItfo/rKvF9VVQbG8qobN2Sy7 CoDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733362; x=1724338162; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aOj2cgvMvGGvvAwDFJY/i7+D7jI4xMnmqcjq9GVb3BQ=; b=OMDOLOIgmoa9/hyTzNV/w0zPDwFltXu0AjxzWldY7OAgKNrdEiXZrZjFRI2FWDT4/x ki0+xFIU18ZGsVlbYC8Rv06SrRY6ydh4wvzQUopldvW1KvNB9/KXWC3pSeqLl0+CVGg5 as9aNcBdjPebn/p14xnbNKKvjD5BEC71l6HCNqTZCX+s2lZMfF++IdBCp3OHF7xQ2ysS xDgpLdqkljOSGxpWEzkMGTIjZ5lucYJ4VHAgvSkQhc+DyTZHSBJ/vhlVqwJfAynQ165f fj5gLXgEjIttJhb8XLbgDIAMqCwEqb6OQ4SfEej8g+ry15xJraw+4edSE6HmrXZm554c X6fw== X-Gm-Message-State: AOJu0Yw1DdasYgKN8MbEnCuo7TvKBBSws/fn7C5Y5YjBfHalT2zrmSum FgNi7YZW1JN2eYl0j3BWo+EZYT4HCD8K1mReM9PirBxOn2pU/aP3KUH4pkDyIzw= X-Google-Smtp-Source: AGHT+IHRt2mu9zgT2DnLwWUlbpdFU+rI3JPPqFqEql1LRzDDs3Fndaq7ZpPqLVBo2SV7ZaL9JYiLxg== X-Received: by 2002:a2e:99d1:0:b0:2f2:9df8:e64e with SMTP id 38308e7fff4ca-2f3aa1df09dmr42915991fa.11.1723733361248; Thu, 15 Aug 2024 07:49:21 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8383946441sm113194966b.148.2024.08.15.07.49.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:20 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id EA87C5FD74; Thu, 15 Aug 2024 15:49:12 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Nicholas Piggin , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Pavel Dovgalyuk Subject: [PULL 13/21] Revert "replay: stop us hanging in rr_wait_io_event" Date: Thu, 15 Aug 2024 15:49:03 +0100 Message-Id: <20240815144911.1931487-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::230; envelope-from=alex.bennee@linaro.org; helo=mail-lj1-x230.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Nicholas Piggin This reverts commit 1f881ea4a444ef36a8b6907b0b82be4b3af253a2. That commit causes reverse_debugging.py test failures, and does not seem to solve the root cause of the problem x86-64 still hangs in record/replay tests. The problem with short-cutting the iowait that was taken during record phase is that related events will not get consumed at the same points (e.g., reading the clock). A hang with zero icount always seems to be a symptom of an earlier problem that has caused the recording to become out of synch with the execution and consumption of events by replay. Acked-by: Alex Bennée Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-6-npiggin@gmail.com> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-14-alex.bennee@linaro.org> diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h index f229b2109c..8102fa54f0 100644 --- a/include/sysemu/replay.h +++ b/include/sysemu/replay.h @@ -73,11 +73,6 @@ int replay_get_instructions(void); /*! Updates instructions counter in replay mode. */ void replay_account_executed_instructions(void); -/** - * replay_can_wait: check if we should pause for wait-io - */ -bool replay_can_wait(void); - /* Processing clocks and other time sources */ /*! Save the specified clock */ diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c index 48c38714bd..c59c77da4b 100644 --- a/accel/tcg/tcg-accel-ops-rr.c +++ b/accel/tcg/tcg-accel-ops-rr.c @@ -109,7 +109,7 @@ static void rr_wait_io_event(void) { CPUState *cpu; - while (all_cpu_threads_idle() && replay_can_wait()) { + while (all_cpu_threads_idle()) { rr_stop_kick_timer(); qemu_cond_wait_bql(first_cpu->halt_cond); } diff --git a/replay/replay.c b/replay/replay.c index b8564a4813..895fa6b67a 100644 --- a/replay/replay.c +++ b/replay/replay.c @@ -451,27 +451,6 @@ void replay_start(void) replay_enable_events(); } -/* - * For none/record the answer is yes. - */ -bool replay_can_wait(void) -{ - if (replay_mode == REPLAY_MODE_PLAY) { - /* - * For playback we shouldn't ever be at a point we wait. If - * the instruction count has reached zero and we have an - * unconsumed event we should go around again and consume it. - */ - if (replay_state.instruction_count == 0 && replay_state.has_unread_data) { - return false; - } else { - replay_sync_error("Playback shouldn't have to iowait"); - } - } - return true; -} - - void replay_finish(void) { if (replay_mode == REPLAY_MODE_NONE) { From patchwork Thu Aug 15 14:49:04 2024 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: 13764845 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EE500C52D7D for ; Thu, 15 Aug 2024 14:49:54 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebnG-00045N-2a; Thu, 15 Aug 2024 10:49:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebn5-0003bh-JL for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:27 -0400 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebn3-0000ED-GL for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:27 -0400 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a7aa212c1c9so129051266b.2 for ; Thu, 15 Aug 2024 07:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733364; x=1724338164; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZqpOMl7awKhcLh3PsdzLgfKFh1wtkG9PTMoyFGQ145A=; b=EV0279/M4zRnG+XVK7Zht3KD0wsMX+pXv5eMsMVU8Pe2+uFaKLFxddij9xvCbk8phw Rd+arGsdEhuuOskU5atW/W+LHCrjfTO3Cs9MtPlR1hQal2YVE2T0h8mVAqS0Tq/xyj84 W9USFBfFBXlgyvxJnVWQaIu3dFwaVjbo9fV2uABYLowQppTjgT8TwanyKLJ85VK2lsJ8 cGoYvEb7tJe/Zxrwi5EKsaQhCZH2Dij2AqDjumHQskN1P1jaVJgbOCg/wsoUzhoJctfb Ptj80vN7sBQjvLYIy2xR0DOkKKykAuzfoiHkYiC+1JJOe+xlJ7vEmaU5GQOqwqhPgLX0 +8bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733364; x=1724338164; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZqpOMl7awKhcLh3PsdzLgfKFh1wtkG9PTMoyFGQ145A=; b=sII0vWqO2JGAGzeTOAlPc18E/K0W1Hwse2s5YWzjHgNRtF0Tn5NOCQxxgiMN4AbGTw G5FBbaPMlFKMaDqXxjWboK6ZX8AeATa1BgxrOhx6z3oxiaDUpxUQkTqAPYTkVjMu0yNE WZ2uf7jD5skqgjguZaXlTxoyI6pnC+mmaupe9R6AfFzbD57QOPLEdsomAfBvJZrDi86K T92zgq5KUc2RSukP5rO+/4RUW9C+wpBskW2Um+VxUzHT+spyM3tx0Ma4OWDKZPTcHorP Ws7xeKWZRqK+lzyeoE/ayKuSdQTzxLnfECk+ea6KHdPDCPsyZFHm105Hm0ITl8jCEbBk peqQ== X-Gm-Message-State: AOJu0YxtyLx5e7OqF7Cuv/lru/LqaLCGwuki/v+2VbARuj1xBd9xD3Sh g+18T3j/o/Fw4tMduQkqB8d2NVVSV2vET8yPqhcXWZQxSyR3z0zE76agBx3CcWI= X-Google-Smtp-Source: AGHT+IEYW/Bfh5DHX4kIR/W1gRAtB9YuD+ePXGui1o4a03z2mgrYLmHYdhbqrQoz8ZDgIMUYT5vfMw== X-Received: by 2002:a17:907:7290:b0:a7a:a212:be48 with SMTP id a640c23a62f3a-a83670d5bfdmr396396966b.56.1723733363589; Thu, 15 Aug 2024 07:49:23 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a838396b7b3sm111659266b.194.2024.08.15.07.49.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:20 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 0C0425FEE6; Thu, 15 Aug 2024 15:49:13 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Nicholas Piggin , =?utf-8?q?Alex_Benn=C3=A9e?= , Pavel Dovgalyuk , Paolo Bonzini , Cleber Rosa , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 14/21] tests/avocado: replay_kernel.py add x86-64 q35 machine test Date: Thu, 15 Aug 2024 15:49:04 +0100 Message-Id: <20240815144911.1931487-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x631.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Nicholas Piggin The x86-64 pc machine is flaky with record/replay, but q35 is more stable. Add a q35 test to replay_kernel.py. Reviewed-by: Alex Bennée Tested-by: Alex Bennée Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-7-npiggin@gmail.com> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-15-alex.bennee@linaro.org> diff --git a/tests/avocado/replay_kernel.py b/tests/avocado/replay_kernel.py index a668af9d36..e22c200a36 100644 --- a/tests/avocado/replay_kernel.py +++ b/tests/avocado/replay_kernel.py @@ -110,7 +110,7 @@ def test_i386_pc(self): self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5) # See https://gitlab.com/qemu-project/qemu/-/issues/2094 - @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test sometimes gets stuck') + @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'pc machine is unstable with replay') def test_x86_64_pc(self): """ :avocado: tags=arch:x86_64 @@ -128,6 +128,22 @@ def test_x86_64_pc(self): self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5) + def test_x86_64_q35(self): + """ + :avocado: tags=arch:x86_64 + :avocado: tags=machine:q35 + """ + kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora' + '/linux/releases/29/Everything/x86_64/os/images/pxeboot' + '/vmlinuz') + kernel_hash = '23bebd2680757891cf7adedb033532163a792495' + kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) + + kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' + console_pattern = 'VFS: Cannot open root device' + + self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5) + def test_mips_malta(self): """ :avocado: tags=arch:mips From patchwork Thu Aug 15 14:49:05 2024 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: 13764862 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EEACAC3DA7F for ; Thu, 15 Aug 2024 14:53:11 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebnH-0004Bn-JG; Thu, 15 Aug 2024 10:49:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebn6-0003eA-5n for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:29 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebn4-0000EG-61 for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:27 -0400 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5bec78c3f85so252779a12.1 for ; Thu, 15 Aug 2024 07:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733365; x=1724338165; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ANsPiSjLHElnluRHF+jBoUXCzn/4iakx0mEan1/xlMw=; b=LaS1yfGj90UbOSMgL8UrbN8fGP2CD9tSFDloBHATuizj9n3ifGOiFFcgVVPxpAWq5A 0Sn/kbaYOjrmlpOPR8JAK0WdcXtwZCH7Qieq4RYaQVALqG12lmQjc0ktA8LOK7wVTG3Q IMVjdeCWbJcAj4484Jc49hz9y6F3iQ6sOZhd4Y/XXP5ZtEKDoGTTixDRp7idc1J4IQkx N+wkEXVU/Iw3LWRZsMK1aXJ35NQJ2nx8uMk7Uy2MCKKGPBCqN1RSi8pGk1F2rkhSAIPj S5EO/gmGIWr6C1r/6T2yQUzYLfOqUjYs/UWEwwbJzPhhs2BF9NvuswIg0pf6bwdR1TK3 i8Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733365; x=1724338165; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ANsPiSjLHElnluRHF+jBoUXCzn/4iakx0mEan1/xlMw=; b=aZG/6n6XMh+SgncLQFSsOkbggj/756FIT+H1nQ6mIbG+leWTdBPn9EyL4XOJbC0ADX w+WsBTI5Lqz+cgrJ+V0wVULvkUhaBLBD3mM2b0CQiqx0Kyzv2NwjyrQ01Kz57yJR47uj Gnzr7T5La+lotQe68CaDtliSd+8SbMPjBwKlyviCIKZpAo0U7NFK6qs7D5Kh+cnSfMni qKikBe882aMf9TpK5B413sqI8oo/YlZmtCLPPpjw+R74aIio1VWaie6T0c7k572k+xPj mHlCXLAM6lrVhEY4gB/unURFN14iFz9rVtPKMWlvFsBtHWGw2AgOG3rYK9GUufu2mySn OpkA== X-Gm-Message-State: AOJu0YznlwXVOj7TvTAOaXDTdxZBJha8W39ZwUtfS8rdUMIrW4XhUwIZ 6R/o+44C8S95iYziRapHupkQxdQ5Q3R+ZQbzqnJFSElL2FSWUoXbClqP4GYo6AI= X-Google-Smtp-Source: AGHT+IFvhkcP2ugHHp8zYDYF7AUd1wBO/1X90Asc+Rxn6YFbhmDAzQc3nh6ezyeAIDijP0iq+agIfw== X-Received: by 2002:a05:6402:360b:b0:5a8:2f2b:d2d3 with SMTP id 4fb4d7f45d1cf-5bea1cb4ef1mr3638752a12.37.1723733364142; Thu, 15 Aug 2024 07:49:24 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bebbdfb923sm964129a12.54.2024.08.15.07.49.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:20 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 242AB5FF6C; Thu, 15 Aug 2024 15:49:13 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Nicholas Piggin , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , Paolo Bonzini Subject: [PULL 15/21] chardev: set record/replay on the base device of a muxed device Date: Thu, 15 Aug 2024 15:49:05 +0100 Message-Id: <20240815144911.1931487-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52d.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Nicholas Piggin chardev events to a muxed device don't get recorded because e.g., qemu_chr_be_write() checks whether the base device has the record flag set. This can be seen when replaying a trace that has characters typed into the console, an examination of the log shows they are not recorded. Setting QEMU_CHAR_FEATURE_REPLAY on the base chardev fixes the problem. Reviewed-by: Alex Bennée Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-8-npiggin@gmail.com> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-16-alex.bennee@linaro.org> diff --git a/chardev/char.c b/chardev/char.c index 3c43fb1278..ba847b6e9e 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -615,11 +615,24 @@ ChardevBackend *qemu_chr_parse_opts(QemuOpts *opts, Error **errp) return backend; } -Chardev *qemu_chr_new_from_opts(QemuOpts *opts, GMainContext *context, - Error **errp) +static void qemu_chardev_set_replay(Chardev *chr, Error **errp) +{ + if (replay_mode != REPLAY_MODE_NONE) { + if (CHARDEV_GET_CLASS(chr)->chr_ioctl) { + error_setg(errp, "Replay: ioctl is not supported " + "for serial devices yet"); + return; + } + qemu_chr_set_feature(chr, QEMU_CHAR_FEATURE_REPLAY); + replay_register_char_driver(chr); + } +} + +static Chardev *__qemu_chr_new_from_opts(QemuOpts *opts, GMainContext *context, + bool replay, Error **errp) { const ChardevClass *cc; - Chardev *chr = NULL; + Chardev *base = NULL, *chr = NULL; ChardevBackend *backend = NULL; const char *name = qemu_opt_get(opts, "backend"); const char *id = qemu_opts_id(opts); @@ -657,11 +670,11 @@ Chardev *qemu_chr_new_from_opts(QemuOpts *opts, GMainContext *context, chr = qemu_chardev_new(bid ? bid : id, object_class_get_name(OBJECT_CLASS(cc)), backend, context, errp); - if (chr == NULL) { goto out; } + base = chr; if (bid) { Chardev *mux; qapi_free_ChardevBackend(backend); @@ -681,11 +694,25 @@ Chardev *qemu_chr_new_from_opts(QemuOpts *opts, GMainContext *context, out: qapi_free_ChardevBackend(backend); g_free(bid); + + if (replay && base) { + /* RR should be set on the base device, not the mux */ + qemu_chardev_set_replay(base, errp); + } + return chr; } -Chardev *qemu_chr_new_noreplay(const char *label, const char *filename, - bool permit_mux_mon, GMainContext *context) +Chardev *qemu_chr_new_from_opts(QemuOpts *opts, GMainContext *context, + Error **errp) +{ + /* XXX: should this really not record/replay? */ + return __qemu_chr_new_from_opts(opts, context, false, errp); +} + +static Chardev *__qemu_chr_new(const char *label, const char *filename, + bool permit_mux_mon, GMainContext *context, + bool replay) { const char *p; Chardev *chr; @@ -693,14 +720,22 @@ Chardev *qemu_chr_new_noreplay(const char *label, const char *filename, Error *err = NULL; if (strstart(filename, "chardev:", &p)) { - return qemu_chr_find(p); + chr = qemu_chr_find(p); + if (replay) { + qemu_chardev_set_replay(chr, &err); + if (err) { + error_report_err(err); + return NULL; + } + } + return chr; } opts = qemu_chr_parse_compat(label, filename, permit_mux_mon); if (!opts) return NULL; - chr = qemu_chr_new_from_opts(opts, context, &err); + chr = __qemu_chr_new_from_opts(opts, context, replay, &err); if (!chr) { error_report_err(err); goto out; @@ -722,24 +757,18 @@ out: return chr; } +Chardev *qemu_chr_new_noreplay(const char *label, const char *filename, + bool permit_mux_mon, GMainContext *context) +{ + return __qemu_chr_new(label, filename, permit_mux_mon, context, false); +} + static Chardev *qemu_chr_new_permit_mux_mon(const char *label, const char *filename, bool permit_mux_mon, GMainContext *context) { - Chardev *chr; - chr = qemu_chr_new_noreplay(label, filename, permit_mux_mon, context); - if (chr) { - if (replay_mode != REPLAY_MODE_NONE) { - qemu_chr_set_feature(chr, QEMU_CHAR_FEATURE_REPLAY); - } - if (qemu_chr_replay(chr) && CHARDEV_GET_CLASS(chr)->chr_ioctl) { - error_report("Replay: ioctl is not supported " - "for serial devices yet"); - } - replay_register_char_driver(chr); - } - return chr; + return __qemu_chr_new(label, filename, permit_mux_mon, context, true); } Chardev *qemu_chr_new(const char *label, const char *filename, From patchwork Thu Aug 15 14:49:06 2024 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: 13764849 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 17830C3DA7F for ; Thu, 15 Aug 2024 14:50:11 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebnG-00045H-2W; Thu, 15 Aug 2024 10:49:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebn6-0003ec-9Y for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:29 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebn4-0000EM-Di for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:28 -0400 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a7a9cf7d3f3so135897666b.1 for ; Thu, 15 Aug 2024 07:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733365; x=1724338165; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UBR0r40jCRTspwNEStddr6vUXgECDiH3mfiz9pfztnM=; b=jB40umleR5f85DzfTxAFI25FwzUWKKumtNscJGHmOzBKWvg3NGwOu2ThoVAZ+K6YuN xmiarQZreEKyIrhcpKCefet7ImLkv2gS8HMXLHFUOnnoc/HGRU7Zpc9hmYYQsI8M0saK 8tr/zdo+43yRbgqyxTb8XlPIXAQswEsuWedZBGrancwRhBj6rUT8dIjMCnGwxEBO/RiY ye/VuG4w2OGoV9pRFaZjJQh2e7OYGXUx/6IUdY7VyE5TM5foQfYvfVSJjDg+wvQR8Yze PxmidGNdgOBH0OhqgHcoaNPlBeniPz0dw/HhLU5yHTc24aduZOCnGvJj8tW3sxbKa/eX cJlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733365; x=1724338165; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UBR0r40jCRTspwNEStddr6vUXgECDiH3mfiz9pfztnM=; b=a/l1aRuYCWnvetPUkENEfwy9NuC98ivzaDdZR5JjGopZqo/MLw56FnEuLZVatp1nMr 8HsijR0W4jAJD5eaQSEMjyQ1Zmoi4MJCRROoKdiTFZAwSqD+dvMF7Aapu0ynJMl/VCgK +l2jXAUFuxMrNosbEr9ywjaucWckwgeCS6wxHG+0aZpuTEgzwP5waNqUkgTTgXC9Gjvi 1bEXYhhdzbwwa+b/k0mc3kMA2xMB3bxUC5+74o0uUrp4d3zzN5/a0vKqmD5x8SxfUEE/ 8swIca1ILONpQCXdufL+P83B+yUWvS5gccddU/hcCGGGHQ3DkaTxNThHGJ6E1WPzj32L xEgw== X-Gm-Message-State: AOJu0YzRmCYUhMTwN+uqTZTinP9VLB3+dJKYoHDA5UjGUR7WIsoBOAJC gG9ta5/scPgd5ODjwsBUsREcnXkQXbVVIxU6SP1FQE27Ug3bvdzuxTCiwb72OgQ= X-Google-Smtp-Source: AGHT+IGzCWa4rpICawVcDkjOLELPmUCXjQufyc710s0ueQV7SxhwHssgVB3t737Jjd4JFVVIstVo8Q== X-Received: by 2002:a17:907:f19e:b0:a7a:9d1e:3b25 with SMTP id a640c23a62f3a-a8366d758abmr414830966b.30.1723733364459; Thu, 15 Aug 2024 07:49:24 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a83838cf05dsm112111966b.53.2024.08.15.07.49.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:20 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 39D2C6007F; Thu, 15 Aug 2024 15:49:13 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Nicholas Piggin , =?utf-8?q?Alex_Benn=C3=A9e?= , Pavel Dovgalyuk , "Michael S. Tsirkin" , Jason Wang Subject: [PULL 16/21] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state Date: Thu, 15 Aug 2024 15:49:06 +0100 Message-Id: <20240815144911.1931487-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62f.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Nicholas Piggin The regular qemu_bh_schedule() calls result in non-deterministic execution of the bh in record-replay mode, which causes replay failure. Reviewed-by: Alex Bennée Reviewed-by: Pavel Dovgalyuk Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-9-npiggin@gmail.com> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-17-alex.bennee@linaro.org> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 08aa0b65e3..10ebaae5e2 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -40,6 +40,7 @@ #include "migration/misc.h" #include "standard-headers/linux/ethtool.h" #include "sysemu/sysemu.h" +#include "sysemu/replay.h" #include "trace.h" #include "monitor/qdev.h" #include "monitor/monitor.h" @@ -417,7 +418,7 @@ static void virtio_net_set_status(struct VirtIODevice *vdev, uint8_t status) timer_mod(q->tx_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + n->tx_timeout); } else { - qemu_bh_schedule(q->tx_bh); + replay_bh_schedule_event(q->tx_bh); } } else { if (q->tx_timer) { @@ -2672,7 +2673,7 @@ static void virtio_net_tx_complete(NetClientState *nc, ssize_t len) */ virtio_queue_set_notification(q->tx_vq, 0); if (q->tx_bh) { - qemu_bh_schedule(q->tx_bh); + replay_bh_schedule_event(q->tx_bh); } else { timer_mod(q->tx_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + n->tx_timeout); @@ -2838,7 +2839,7 @@ static void virtio_net_handle_tx_bh(VirtIODevice *vdev, VirtQueue *vq) return; } virtio_queue_set_notification(vq, 0); - qemu_bh_schedule(q->tx_bh); + replay_bh_schedule_event(q->tx_bh); } static void virtio_net_tx_timer(void *opaque) @@ -2921,7 +2922,7 @@ static void virtio_net_tx_bh(void *opaque) /* If we flush a full burst of packets, assume there are * more coming and immediately reschedule */ if (ret >= n->tx_burst) { - qemu_bh_schedule(q->tx_bh); + replay_bh_schedule_event(q->tx_bh); q->tx_waiting = 1; return; } @@ -2935,7 +2936,7 @@ static void virtio_net_tx_bh(void *opaque) return; } else if (ret > 0) { virtio_queue_set_notification(q->tx_vq, 0); - qemu_bh_schedule(q->tx_bh); + replay_bh_schedule_event(q->tx_bh); q->tx_waiting = 1; } } From patchwork Thu Aug 15 14:49:07 2024 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: 13764867 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8D662C531DD for ; Thu, 15 Aug 2024 14:56:59 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebtx-0007wV-KO; Thu, 15 Aug 2024 10:56:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebts-0007an-49 for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:56:29 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebto-00014T-53 for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:56:27 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5bebd3b7c22so890888a12.0 for ; Thu, 15 Aug 2024 07:56:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733780; x=1724338580; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7vFtKZMCqZ//aDW9JM8+1eoo4MiLhC2zYG7YF5q15rM=; b=phvu/T9SnomwTs47tYDaem6MvlkKJ6Z6ukZ1X/bHeA4aYLlUESLJ+ne9kUlJPQ+L0G v2K37YQkgP+jg7AZAe85LcXNIrj6bhDkSMz4cSxnIDvN7TsYjk3Xse15d7fB/u/jhdKO wyHzsBFimU9qbaTeQX5SgYnw1Qu/nOp7mjxLEMQcplTi3uisV5ymS736VYdHkmXXZcwc I6+bokGiCie8MOnLudxiOANjTCPrc+ZoZZBfV3zZVC24CpytDNQWrasTtkayluHaJHKQ 6vRgabSZcx0UXhSAuZC8+QI177bIcKPIKkBvifwv/5QPXFF1RRtx41EuZ4x2ks/ZMPN/ XTUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733780; x=1724338580; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7vFtKZMCqZ//aDW9JM8+1eoo4MiLhC2zYG7YF5q15rM=; b=S77UbVFtNUwimFxHVk0PVZ3oBPaf0Kkh6PCWjZ9p9qDGxmLQDq3HaeW62hk9BDGE2C XlTy/Hv7wj8ykUUN7i671a6xt7tp1R6wDLoNbn6OW/W4U29ic9FfpOnk4UWm2CznTb5K EHLjAFft6YjuPqb0CpVE1XmYY5uX/hffwPJUu6ql1+iTGI94GR3Tyu0SE6cZgU0R7Thf MtRlGcHATGlbsUBZoqHLUEyN5Xce/Qrg+AwaKvdQc21/1Cix82dcRxC7oIcD3wIV4vDQ K52YTrCK4mtfo5g/f77/SuYLOl90JlfxdJHEpfHhVgBfwkL/63eyImUCewUqQHn5Zh/T h/Wg== X-Gm-Message-State: AOJu0YzjQBxjGcdQ/GiO1RgAuWpBZxhgOggDE06ZYWZ7oBm24NJVaN8B ao9RbNcns2t1N6Wd8V3xhL3/ZFvXdr1oSkk3fp97T/RGfEgL06AYaLiSySKaE5c= X-Google-Smtp-Source: AGHT+IEdvW69uizgr/OssDuGL/mJIkDRhSrDYVv1+9FYzxBVxzhHUX/DxDpoxUfI1O9/a9EugGCu1g== X-Received: by 2002:a17:907:7f13:b0:a72:5967:b34 with SMTP id a640c23a62f3a-a837cce9ab7mr292721766b.22.1723733779664; Thu, 15 Aug 2024 07:56:19 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a83838c6975sm112618766b.41.2024.08.15.07.56.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:56:18 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 503B860263; Thu, 15 Aug 2024 15:49:13 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Nicholas Piggin , "Michael S . Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Jason Wang Subject: [PULL 17/21] virtio-net: Use virtual time for RSC timers Date: Thu, 15 Aug 2024 15:49:07 +0100 Message-Id: <20240815144911.1931487-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52b.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Nicholas Piggin Receive coalescing is visible to the target machine, so its timers should use virtual time like other timers in virtio-net, to be compatible with record-replay. Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-10-npiggin@gmail.com> Acked-by: Michael S. Tsirkin Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-18-alex.bennee@linaro.org> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 10ebaae5e2..ed33a32877 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -2124,7 +2124,7 @@ static void virtio_net_rsc_purge(void *opq) chain->stat.timer++; if (!QTAILQ_EMPTY(&chain->buffers)) { timer_mod(chain->drain_timer, - qemu_clock_get_ns(QEMU_CLOCK_HOST) + chain->n->rsc_timeout); + qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + chain->n->rsc_timeout); } } @@ -2360,7 +2360,7 @@ static size_t virtio_net_rsc_do_coalesce(VirtioNetRscChain *chain, chain->stat.empty_cache++; virtio_net_rsc_cache_buf(chain, nc, buf, size); timer_mod(chain->drain_timer, - qemu_clock_get_ns(QEMU_CLOCK_HOST) + chain->n->rsc_timeout); + qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + chain->n->rsc_timeout); return size; } @@ -2598,7 +2598,7 @@ static VirtioNetRscChain *virtio_net_rsc_lookup_chain(VirtIONet *n, chain->max_payload = VIRTIO_NET_MAX_IP6_PAYLOAD; chain->gso_type = VIRTIO_NET_HDR_GSO_TCPV6; } - chain->drain_timer = timer_new_ns(QEMU_CLOCK_HOST, + chain->drain_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, virtio_net_rsc_purge, chain); memset(&chain->stat, 0, sizeof(chain->stat)); From patchwork Thu Aug 15 14:49:08 2024 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: 13764865 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6D2B8C52D7D for ; Thu, 15 Aug 2024 14:56:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebtw-0007jc-JY; Thu, 15 Aug 2024 10:56:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebtp-0007Ry-VD for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:56:26 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebto-00014U-4k for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:56:25 -0400 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5a108354819so1463705a12.0 for ; Thu, 15 Aug 2024 07:56:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733780; x=1724338580; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=En32C6zo6LeZ5uTVMpvZgvYVpJHuCehnEf43V3Hg1AQ=; b=OwGZ94Iur311OE06stnHDxZeOY1cx4qagGu/qWPg3uPaqp89vJ0aTWOeyupgLOdNgk CyNhfZLC7tg1sjFpp5s+s+WzVZPTko12ailpim6Hi/JDa1auGTwpEqeZTKYbiAKovEG7 8Lp1zRK++J6BDim8hPyeqth6cHkSiGkDEWIWCIUWUN/tE+bB0+2MO5LYJeVJxbclsoN9 gpwdQz4PrEm1Gn/xESd/wMMZlR5OaRRF+rV1tdsCTlzn7yygJCdHuC/n/4HCl0W4xcZJ n9HVOulhetybBTkwKv9dCrXHXULvABYbcUEGuqHybwgUig7F+Vdf5pnm4bJfsgPM7grg nTSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733780; x=1724338580; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=En32C6zo6LeZ5uTVMpvZgvYVpJHuCehnEf43V3Hg1AQ=; b=joTRKE9s/r+KAfr5z1MkfrGIOpj6tckJVOsO7LcEdiAyIXk5uNFex1QCnEOL/nKCdR S3T1JFituX/sknbwyWeC2SG9XgbaGTSyBI7FMv/5tHp6WQTve/vk5d8zbWDkzov/k2dR vZ16OE1toCinoHvQ9NbMCrb4i/617omnBnigw+Vd3GkzxPkRaG+/mNtXGi/qK3xJVVWy FUkknH0FiykKSlrC64ABkgBgLLxk1ge+35nPt+V9jRf3NK5Tyyg4I8tjef6+qwH9ZcvL iMhpLmCjSFG6MjMDOjV2xOP6v8KKGiTBlaffiH9DI4kj3DYLhi7pKouG7ebakcysxgub JapA== X-Gm-Message-State: AOJu0YyBPa5d7LLflnLoVdXKRhudpXUGM3oJm784qKnx5OrzA/Q/U1Hk cSDLMP8FreP5zDQaWIbN2t6pqyB32KlzVbF502P6nyNwr68mVYAPnO2PZUzBtYtxDCYOXIT1tSa W X-Google-Smtp-Source: AGHT+IHG6SzE5+3gRWKDddS92cWtKaVDVLswkGSQNYH/QffKGbq+vzlIAI3YQr+uhM4b3GrkvfSQ+Q== X-Received: by 2002:a17:906:eecc:b0:a7d:3ab9:6a5d with SMTP id a640c23a62f3a-a836705aae4mr404095266b.69.1723733779945; Thu, 15 Aug 2024 07:56:19 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a83838cefe0sm113152666b.47.2024.08.15.07.56.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:56:18 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 646FF60295; Thu, 15 Aug 2024 15:49:13 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Nicholas Piggin , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas Subject: [PULL 18/21] savevm: Fix load_snapshot error path crash Date: Thu, 15 Aug 2024 15:49:08 +0100 Message-Id: <20240815144911.1931487-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x536.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Nicholas Piggin An error path missed setting *errp, which can cause a NULL deref. Reviewed-by: Alex Bennée Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-11-npiggin@gmail.com> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-19-alex.bennee@linaro.org> diff --git a/migration/savevm.c b/migration/savevm.c index 85958d7b09..6bb404b9c8 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -3288,6 +3288,7 @@ bool load_snapshot(const char *name, const char *vmstate, /* Don't even try to load empty VM states */ ret = bdrv_snapshot_find(bs_vm_state, &sn, name); if (ret < 0) { + error_setg(errp, "Snapshot can not be found"); return false; } else if (sn.vm_state_size == 0) { error_setg(errp, "This is a disk-only snapshot. Revert to it " From patchwork Thu Aug 15 14:49:09 2024 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: 13764860 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 254B4C52D7C for ; Thu, 15 Aug 2024 14:51:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebnJ-0004JH-8m; Thu, 15 Aug 2024 10:49:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebn7-0003kY-Q2 for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:33 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebn5-0000Ew-DS for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:29 -0400 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a80eab3945eso119424166b.1 for ; Thu, 15 Aug 2024 07:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733366; x=1724338166; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8bup+6NeSiIzm/eSwtgbo7ETG7RN/Czsn26dY1f0S5U=; b=mQFjtTyTXpwEIgJ8dTOf3R/lStud44Mvi3WDOmHg53KXExWV5YBjEphIAJJT9THZcJ 7ATbxy+huLTjcdW2aDHm1DKVG4GVBABXq5kYYVWQsVAmdY//0aHnBKXsiFMAUD88x4gT TDnYMcSijH8j2hmi926PyajsJ/sIqz+rj48AY1u8KCHb4ftOHWgckmWuYpu0JdGRztIR 9SEpj0zVJ73pW1hDddOQtnN/YJv8DHfRtopyVr3ZmLzRdzotaQ9iZWQVfCP0/N5jONAj vpMQVyqitT147Dql/un2Y3kGm9smJ00bvqRSLaq2aPnPNqFUOXQm8jMiEglhSLgUKxT9 OFog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733366; x=1724338166; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8bup+6NeSiIzm/eSwtgbo7ETG7RN/Czsn26dY1f0S5U=; b=SiaMzVenUojrGb9SS4trKAdo1BkQ5cLV7hI1HXogFq7ekxtPuRQ313jak6h5clbz7d 7UNrZUvqJFBNOHLc19HUfxBiU2QQazDeTuHN/EE5kZyYw6B5a3GarW6d3+uEjPE69ews WHinuh9y6ig9r0YVTO8FSWHJYzcClgi0HGgE+F9x9dfAL1+8+GUdZS+IIKVXJD5gmEuG FrlquhGlgHXluSeuj6YHbHRLBvU51wmc4VGmyPnz7YpTRNddKwMXoyOa74DBZnGqIK+8 wEKt4qNR77gEAhs/tm08jMfupgIJQURgKDsT8t7V6oCAmcvlnLGEBiQubENGkCUiV4l2 5LEg== X-Gm-Message-State: AOJu0YxccC8vIimnzaAaONLDYcLti0Bi6iH1h6S7SIv0p3cTBwBDldmL SxEYfATQkhqE/END6EQdbgAH+l/QSQ51VxY2SA7X6LAI5Z3RmbnxjHmcfjqR7no= X-Google-Smtp-Source: AGHT+IEyBl26rmnghuBi0BhVflap4nOkn8zahcMdxFCDTo+jriaMulDSDyxGns25+TJmYrgPkq402Q== X-Received: by 2002:a17:907:e685:b0:a7a:b9dd:7762 with SMTP id a640c23a62f3a-a836701733amr453811966b.42.1723733365375; Thu, 15 Aug 2024 07:49:25 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a838396bc50sm112218666b.198.2024.08.15.07.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:20 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 82668603CF; Thu, 15 Aug 2024 15:49:13 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Stefan Weil , Peter Maydell , Peter Xu , Eric Auger , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Michael Roth , Konstantin Kostiuk , Paolo Bonzini , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jiri Pirko , Eric Blake , Markus Armbruster , qemu-arm@nongnu.org (open list:ARM SMMU) Subject: [PULL 19/21] docs: Fix some typos (found by typos) and grammar issues Date: Thu, 15 Aug 2024 15:49:09 +0100 Message-Id: <20240815144911.1931487-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62d.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Stefan Weil via Fix the misspellings of "overriden" also in code comments. Signed-off-by: Stefan Weil Reviewed-by: Peter Maydell Message-Id: <20240813125638.395461-1-sw@weilnetz.de> Reviewed-by: Peter Xu Reviewed-by: Eric Auger Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-20-alex.bennee@linaro.org> diff --git a/docs/devel/migration/uadk-compression.rst b/docs/devel/migration/uadk-compression.rst index 3f73345dd5..64cadebd21 100644 --- a/docs/devel/migration/uadk-compression.rst +++ b/docs/devel/migration/uadk-compression.rst @@ -114,7 +114,7 @@ Make sure all these above kernel configurations are selected. Accelerator dev node permissions -------------------------------- -Harware accelerators(eg: HiSilicon Kunpeng Zip accelerator) gets registered to +Hardware accelerators (eg: HiSilicon Kunpeng Zip accelerator) gets registered to UADK and char devices are created in dev directory. In order to access resources on hardware accelerator devices, write permission should be provided to user. @@ -134,7 +134,7 @@ How To Use UADK Compression In QEMU Migration Set ``migrate_set_parameter multifd-compression uadk`` Since UADK uses Shared Virtual Addressing(SVA) and device access virtual memory -directly it is possible that SMMUv3 may enounter page faults while walking the +directly it is possible that SMMUv3 may encounter page faults while walking the IO page tables. This may impact the performance. In order to mitigate this, please make sure to specify ``-mem-prealloc`` parameter to the destination VM boot parameters. diff --git a/docs/interop/qemu-ga.rst b/docs/interop/qemu-ga.rst index 9c7380896a..11f7bae460 100644 --- a/docs/interop/qemu-ga.rst +++ b/docs/interop/qemu-ga.rst @@ -50,7 +50,7 @@ Options .. option:: -c, --config=PATH Configuration file path (the default is |CONFDIR|\ ``/qemu-ga.conf``, - unless overriden by the QGA_CONF environment variable) + unless overridden by the QGA_CONF environment variable) .. option:: -m, --method=METHOD diff --git a/docs/tools/qemu-vmsr-helper.rst b/docs/tools/qemu-vmsr-helper.rst index 6ec87b49d9..9ce10b9af9 100644 --- a/docs/tools/qemu-vmsr-helper.rst +++ b/docs/tools/qemu-vmsr-helper.rst @@ -17,8 +17,8 @@ driver to advertise and monitor the power consumption or accumulated energy consumption of different power domains, such as CPU packages, DRAM, and other components when available. -However those register are accesible under priviliged access (CAP_SYS_RAWIO). -QEMU can use an external helper to access those priviliged register. +However those registers are accessible under privileged access (CAP_SYS_RAWIO). +QEMU can use an external helper to access those privileged registers. :program:`qemu-vmsr-helper` is that external helper; it creates a listener socket which will accept incoming connections for communication with QEMU. diff --git a/qapi/rocker.json b/qapi/rocker.json index 6950ca9602..73c7363b16 100644 --- a/qapi/rocker.json +++ b/qapi/rocker.json @@ -42,7 +42,7 @@ ## # @RockerPortDuplex: # -# An eumeration of port duplex states. +# An enumeration of port duplex states. # # @half: half duplex # @@ -55,7 +55,7 @@ ## # @RockerPortAutoneg: # -# An eumeration of port autoneg states. +# An enumeration of port autoneg states. # # @off: autoneg is off # diff --git a/include/exec/memory.h b/include/exec/memory.h index 02f7528ec0..296fd068c0 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1852,7 +1852,7 @@ void memory_region_iommu_replay(IOMMUMemoryRegion *iommu_mr, IOMMUNotifier *n); * memory_region_unregister_iommu_notifier: unregister a notifier for * changes to IOMMU translation entries. * - * @mr: the memory region which was observed and for which notity_stopped() + * @mr: the memory region which was observed and for which notify_stopped() * needs to be called * @n: the notifier to be removed. */ diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c index d73ad62211..3f82728758 100644 --- a/hw/arm/smmu-common.c +++ b/hw/arm/smmu-common.c @@ -674,7 +674,7 @@ error: /* * combine S1 and S2 TLB entries into a single entry. - * As a result the S1 entry is overriden with combined data. + * As a result the S1 entry is overridden with combined data. */ static void combine_tlb(SMMUTLBEntry *tlbe, SMMUTLBEntry *tlbe_s2, dma_addr_t iova, SMMUTransCfg *cfg) diff --git a/qga/main.c b/qga/main.c index b8f7b1e4a3..50186760bf 100644 --- a/qga/main.c +++ b/qga/main.c @@ -257,7 +257,7 @@ QEMU_COPYRIGHT "\n" "\n" " -c, --config=PATH configuration file path (default is\n" " %s/qemu-ga.conf\n" -" unless overriden by the QGA_CONF environment variable)\n" +" unless overridden by the QGA_CONF environment variable)\n" " -m, --method transport method: one of unix-listen, virtio-serial,\n" " isa-serial, or vsock-listen (virtio-serial is the default)\n" " -p, --path device/socket path (the default for virtio-serial is:\n" From patchwork Thu Aug 15 14:49:10 2024 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: 13764866 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4BFC5C3DA7F for ; Thu, 15 Aug 2024 14:56:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebu0-00086G-1D; Thu, 15 Aug 2024 10:56:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebts-0007ao-5R for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:56:29 -0400 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebtp-00014d-5z for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:56:27 -0400 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2ef23d04541so12992931fa.2 for ; Thu, 15 Aug 2024 07:56:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733783; x=1724338583; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VFH+GkIlDVHJtYZuDNv3/msjkfbYLWmbwCbvi/sSR+0=; b=KrQEufhKRNyhwVSMMCLcGiz0NYaED/gHsP1iwLplhy/vWzvPg94sRtAqrCLBKo+hDp aQGKpxo0wlbZRZo7RB1n4jtWZoUd7UzRwK3+4tLpF1Yoj764f8JfvHnTNFiE8rEAQ4Wb YmAfgA6FDOQcNlxJ3ydIW6P7C70w+QF5mHiUCqt9Su39v6QdqIzrFQ+4zZ2sXAnR1XFg oNOmrdP1+fOyOVoHXnqthUg+0Ay/t2kX7oY6P2BOXUi4LLoVBIIeX1vZp2hs9p6JXdM8 SvK6F7kdhK9ZGQfNU4KuqZGPLsz9QxnvWCiXXAZX/AuHfnyDlW+CCgM/o5IdeBRZTiHy FYBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733783; x=1724338583; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VFH+GkIlDVHJtYZuDNv3/msjkfbYLWmbwCbvi/sSR+0=; b=s7iVuBGsA/nmvc/7qvAYxF6N9ZQF3NjOZ0zTX5xQPybxSNfhZdi9KiB4Rw6gcaF1+5 fStOLCcYKOxUdXHzhbUGUVm3glINS2MnHYf5NQSa+dPBmkkLrDB+m4xMKXj7DRRsOkOB nv8z8IT2xnFQcIN+o7iT+w7iYRj4OP7UayZBOHwGehwlNiGaf3NjeaG4QlFLjQHYb0FZ DotsFZGJB4dzSamn8bAVEbJX//sT1rqEHHSifuz//hqs/yBB985bRjZ8BNIG0cKRQqeK Y+zN5pXOHgjBose9nRATmZ5aNMPOGDjgMa3BJ2ttzPDwcz8VcBckF925mEAfQNXaxRz5 RjMQ== X-Gm-Message-State: AOJu0Yz12iWy6syOYp6Pb+w1dyFJYDF4jQNIEAZdOrlxW668OWaejnwi ojG++i8eT+aLYNqGcL2xpNzqqsH3UdRAsH/2AEEzA2dDfYDoD1rguZ3I9NE0QNA= X-Google-Smtp-Source: AGHT+IE1ph4ENd3E3Jpbv4/dfKcC0wUpbZDAwbOHvz52a/E8yhgb5iyPFXca786dBiq6wpBdq+kbig== X-Received: by 2002:a2e:510a:0:b0:2f1:a7f8:810f with SMTP id 38308e7fff4ca-2f3aa1f4cffmr38727451fa.36.1723733779403; Thu, 15 Aug 2024 07:56:19 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bebbde4b42sm994961a12.35.2024.08.15.07.56.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:56:18 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 9EDED6067B; Thu, 15 Aug 2024 15:49:13 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Richard Henderson , Paolo Bonzini , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 20/21] docs/devel: update tcg-plugins page Date: Thu, 15 Aug 2024 15:49:10 +0100 Message-Id: <20240815144911.1931487-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=alex.bennee@linaro.org; helo=mail-lj1-x229.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Pierrick Bouvier Reflect recent changes on API (inline ops) and new plugins. Signed-off-by: Pierrick Bouvier Message-Id: <20240812231945.169310-1-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-21-alex.bennee@linaro.org> diff --git a/docs/about/emulation.rst b/docs/about/emulation.rst index c03033e4e9..eea1261baa 100644 --- a/docs/about/emulation.rst +++ b/docs/about/emulation.rst @@ -207,8 +207,8 @@ Once built a program can be run with multiple plugins loaded each with their own arguments:: $QEMU $OTHER_QEMU_ARGS \ - -plugin contrib/plugin/libhowvec.so,inline=on,count=hint \ - -plugin contrib/plugin/libhotblocks.so + -plugin contrib/plugins/libhowvec.so,inline=on,count=hint \ + -plugin contrib/plugins/libhotblocks.so Arguments are plugin specific and can be used to modify their behaviour. In this case the howvec plugin is being asked to use inline @@ -219,6 +219,14 @@ Linux user-mode emulation also evaluates the environment variable QEMU_PLUGIN="file=contrib/plugins/libhowvec.so,inline=on,count=hint" $QEMU +QEMU plugins avoid to write directly to stdin/stderr, and use the log provided +by the API (see function ``qemu_plugin_outs``). +To show output, you may use this additional parameter:: + + $QEMU $OTHER_QEMU_ARGS \ + -d plugin \ + -plugin contrib/plugins/libhowvec.so,inline=on,count=hint + Example Plugins ~~~~~~~~~~~~~~~ @@ -260,8 +268,7 @@ Behaviour can be tweaked with the following arguments: * - Option - Description * - inline=true|false - - Use faster inline addition of a single counter. Not per-cpu and not - thread safe. + - Use faster inline addition of a single counter. * - idle=true|false - Dump the current execution stats whenever the guest vCPU idles @@ -381,6 +388,15 @@ run:: 160 1 0 135 1 0 +Test inline operations +...................... + +``tests/plugins/inline.c`` + +This plugin is used for testing all inline operations, conditional callbacks and +scoreboard. It prints a per-cpu summary of all events. + + Hot Blocks .......... @@ -394,9 +410,6 @@ with linux-user execution as system emulation tends to generate re-translations as blocks from different programs get swapped in and out of system memory. -If your program is single-threaded you can use the ``inline`` option for -slightly faster (but not thread safe) counters. - Example:: $ qemu-aarch64 \ @@ -736,6 +749,28 @@ The plugin will log the reason of exit, for example:: 0xd4 reached, exiting +Limit instructions per second +............................. + +This plugin can limit the number of Instructions Per Second that are executed:: + + # get number of instructions + $ num_insn=$(./build/qemu-x86_64 -plugin ./build/tests/plugin/libinsn.so -d plugin /bin/true |& grep total | sed -e 's/.*: //') + # limit speed to execute in 10 seconds + $ time ./build/qemu-x86_64 -plugin ./build/contrib/plugins/libips.so,ips=$(($num_insn/10)) /bin/true + real 10.000s + + +.. list-table:: IPS arguments + :widths: 20 80 + :header-rows: 1 + + * - Option + - Description + * - ips=N + - Maximum number of instructions per cpu that can be executed in one second. + The plugin will sleep when the given number of instructions is reached. + Other emulation features ------------------------ diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index d8725c2854..9463692c41 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -61,11 +61,14 @@ translation event the plugin has an option to enumerate the instructions in a block of instructions and optionally register callbacks to some or all instructions when they are executed. -There is also a facility to add an inline event where code to -increment a counter can be directly inlined with the translation. -Currently only a simple increment is supported. This is not atomic so -can miss counts. If you want absolute precision you should use a -callback which can then ensure atomicity itself. +There is also a facility to add inline instructions doing various operations, +like adding or storing an immediate value. It is also possible to execute a +callback conditionally, with condition being evaluated inline. All those inline +operations are associated to a ``scoreboard``, which is a thread-local storage +automatically expanded when new cores/threads are created and that can be +accessed/modified in a thread-safe way without any lock needed. Combining inline +operations and conditional callbacks offer a more efficient way to instrument +binaries, compared to classic callbacks. Finally when QEMU exits all the registered *atexit* callbacks are invoked. From patchwork Thu Aug 15 14:49:11 2024 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: 13764861 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 998CAC3DA7F for ; Thu, 15 Aug 2024 14:52:59 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebnI-0004E2-3e; Thu, 15 Aug 2024 10:49:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sebn5-0003aR-8F for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:27 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebn2-0000Dr-Cm for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:26 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a7aac70e30dso120862566b.1 for ; Thu, 15 Aug 2024 07:49:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733363; x=1724338163; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fGNwWa3S5TX7tw+jVxHwopux+SCGaD9vnHCk/doezEQ=; b=TEradAnQNc2vat9wviJ0YlSOR+iYRNK5Md2UgbZ2CGu4ikk0fsM5iS1IwZuOUMpVDs s1wCAuL+1IWS0JbCnS99fJ4BzqSBEAdCtX9blWUpm5fxL5w6IGxv1dNijYTxGkZYEeYi bReg9k+Yvlcfpe5RLmrJdJ+C4xxFmb7+BTD+8YAlGbKzUSRzhKKY4xSq2bM3GO1YRGu8 sftTUXw39akPMU8ZP17NF/Ie+18Cofx6jri4jbwFT50hir7i7pgER5L7dnThl6Psif7j JYaPEdlKjC0GWITM1b6RZU1qLj2M7aweKsA/k874a5DXnzd+hlv8A6NezVR7c1Q2+CSC Idsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733363; x=1724338163; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fGNwWa3S5TX7tw+jVxHwopux+SCGaD9vnHCk/doezEQ=; b=tuswgPRJrqRA6zICxyTD8YE5rU3fVh7MX2VwVDutwJBopvm54pbNHI7MkvYTb4d9v/ +BqQNZHHYeNs6ig1skV75hC1EkicS1bGKWkeNDhfhD7BwAzpZC1TFJm8cqvcrjGsBILz AfuHGDkkei1/zLCA1mqHNxUtmNJcEbeB3OpuGxrPhRI2qCpL6mmdTYK0QfNkRpyUmqO8 G1uzIW9lpfOvnGYxESwBI6XURhLxqy4h66kMKwzQZDhl2U1YlphJGRagKwQQqMP5Lmcg a9wbWZ+w+RVL4DQPxMxrdrsd3jF9AnxbrQ8C0Ho6FQ8VANiO7CEH3x3F/vaBR7737DYz FU9g== X-Gm-Message-State: AOJu0YzuixN3NxeQppnajZ5zvy5vYdmhsryW6T4L4CvqltqpvUxIZPP6 J8tt+SMM8guz+keOSZDpOJGcAxJUmvUypaT8Xue+AkuozQidBZJvk4mBPVTtCOzlUrWu1ubSU8g 6 X-Google-Smtp-Source: AGHT+IFG+JYdR8k28AF8t9wmxtN9aFr6ywujt3U9J0/xHVK7QUhooazY37v4RAVC7Hfg0OThu1yHbQ== X-Received: by 2002:a17:907:d58f:b0:a77:d7f1:42eb with SMTP id a640c23a62f3a-a8366d396ebmr495271366b.23.1723733362446; Thu, 15 Aug 2024 07:49:22 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a83838cefe0sm112307466b.47.2024.08.15.07.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:20 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B35ED5F8ED; Thu, 15 Aug 2024 15:49:13 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Richard Henderson , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 21/21] plugins: fix race condition with scoreboards Date: Thu, 15 Aug 2024 15:49:11 +0100 Message-Id: <20240815144911.1931487-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62c.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Pierrick Bouvier A deadlock can be created if a new vcpu (a) triggers a scoreboard reallocation, and another vcpu (b) wants to create a new scoreboard at the same time. In this case, (a) holds the plugin lock, and starts an exclusive section, waiting for (b). But at the same time, (b) is waiting for plugin lock. The solution is to drop the lock before entering the exclusive section. This bug can be easily reproduced by creating a callback for any tb exec, that allocates a new scoreboard. In this case, as soon as we reach more than 16 vcpus, the deadlock occurs. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2344 Signed-off-by: Pierrick Bouvier Message-Id: <20240812220748.95167-2-pierrick.bouvier@linaro.org> [AJB: tweak var position to meet coding style] Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20240813202329.1237572-22-alex.bennee@linaro.org> diff --git a/plugins/core.c b/plugins/core.c index 12c67b4b4e..2897453cac 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -214,30 +214,49 @@ CPUPluginState *qemu_plugin_create_vcpu_state(void) static void plugin_grow_scoreboards__locked(CPUState *cpu) { - if (cpu->cpu_index < plugin.scoreboard_alloc_size) { + size_t scoreboard_size = plugin.scoreboard_alloc_size; + bool need_realloc = false; + + if (cpu->cpu_index < scoreboard_size) { return; } - bool need_realloc = FALSE; - while (cpu->cpu_index >= plugin.scoreboard_alloc_size) { - plugin.scoreboard_alloc_size *= 2; - need_realloc = TRUE; + while (cpu->cpu_index >= scoreboard_size) { + scoreboard_size *= 2; + need_realloc = true; } + if (!need_realloc) { + return; + } - if (!need_realloc || QLIST_EMPTY(&plugin.scoreboards)) { - /* nothing to do, we just updated sizes for future scoreboards */ + if (QLIST_EMPTY(&plugin.scoreboards)) { + /* just update size for future scoreboards */ + plugin.scoreboard_alloc_size = scoreboard_size; return; } + /* + * A scoreboard creation/deletion might be in progress. If a new vcpu is + * initialized at the same time, we are safe, as the new + * plugin.scoreboard_alloc_size was not yet written. + */ + qemu_rec_mutex_unlock(&plugin.lock); + /* cpus must be stopped, as tb might still use an existing scoreboard. */ start_exclusive(); - struct qemu_plugin_scoreboard *score; - QLIST_FOREACH(score, &plugin.scoreboards, entry) { - g_array_set_size(score->data, plugin.scoreboard_alloc_size); + /* re-acquire lock */ + qemu_rec_mutex_lock(&plugin.lock); + /* in case another vcpu is created between unlock and exclusive section. */ + if (scoreboard_size > plugin.scoreboard_alloc_size) { + struct qemu_plugin_scoreboard *score; + QLIST_FOREACH(score, &plugin.scoreboards, entry) { + g_array_set_size(score->data, scoreboard_size); + } + plugin.scoreboard_alloc_size = scoreboard_size; + /* force all tb to be flushed, as scoreboard pointers were changed. */ + tb_flush(cpu); } - /* force all tb to be flushed, as scoreboard pointers were changed. */ - tb_flush(cpu); end_exclusive(); }