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: 819421 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1197082wrm; Thu, 15 Aug 2024 07:50:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX3YN4wwdYEZKM9Imei6DR443PQk+8ifLe0CqGNRSphR+YiExk9Sgx//f1vLV18W99rAhz59ZtOZyew/wLXoHz8 X-Google-Smtp-Source: AGHT+IH8EYCnTUAbvnjX9ZG/BQSjbsf5upqyFQ07qAR9/ttpSBcrC9+P7CFLnpSQiRmDQgBBa2qS X-Received: by 2002:a05:620a:240f:b0:79f:17af:e360 with SMTP id af79cd13be357-7a4ee33bf80mr790689685a.33.1723733441626; Thu, 15 Aug 2024 07:50:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733441; cv=none; d=google.com; s=arc-20160816; b=UIo10zC/DT03TmAkINY4lPrkNcshloXozo8mbXMWBPFi7PtjRWGRx9+GG219Byjorr XLI5PsVGXtWEJ0YWKTO4gg/Ct7pCEkANgo5Pdv/g1Vn3TB8+vkUf6uoiYdfuRltfvlvn 2nndbHn4W6WNSUBrLFburPjTcD26lCkgToLQj/hIyABJs8s0iqkaD47dmHLk55PT6Drs k7jWtvktOrpokm9v71mC4dsl8vA283eyuEBV4cGNRoqLAEr96mAFqSinHtSutrwpa0HF pDOLYfreE3YwMNH/8fo7XeoSMAWOlPHVO77oi34yj9kHVbUmWPtWDhcRyfFVIgydFHh7 TPXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yWTKlDd6LK1VooQusJJbhCpW5WJ0iCeY5ofYJWN9ldI=; fh=JZ8CoZkQx4vya4jjFfvH8FacGr3KnSM1f/FQNCva8WI=; b=KTt1VR7SvKHPBS8V9irL9xE9IS/LFefxG8xWETb0Rys7GKCyZQ4qChh2TUjo1WTXEU aGR3t4ff018QCHFOw9qNcXMh0wyuvlazR0I02lMCCEx7rcdo8xdSPR1j6WWZE28df5Sy Bu97R/nw6CEy+VxU2K6bL4Afpmtdd4mFmqyD/BuTrOwO5MccTuY1IN27MBFmKBzfqtAz 6V3ujQencS6TTd186mIYlCoXlwnNwuNPIEQN6R09VVigwgjFAqqqaysPSEGr9VOhW2LZ O9Tzz1EEGZDTA3uUexE56dfC5kAbi0aZN7d3t0fJRR6AsMmK6NP2ml1III0KCb841ggl /57A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wwRl0KHB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a4ff0eb739si186820685a.472.2024.08.15.07.50.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:50:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wwRl0KHB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819431 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1198179wrm; Thu, 15 Aug 2024 07:53:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUv9I6SMZr4vRr80r7nj37ujw/xWRcW3F6s9+A/v4xSkjDeu1By1YG4Ukptw/OS6BBdhAaMZKNBSxwc/gQP5DKF X-Google-Smtp-Source: AGHT+IHNcPphZkpZijwBx72k4yIJz/HCc8GOIMDtLvxv3KzCryxlKr9BGuU2pz0sxvkzGNI7vHma X-Received: by 2002:a05:6214:318d:b0:6b5:e403:4418 with SMTP id 6a1803df08f44-6bf5d163fe8mr58084756d6.10.1723733603479; Thu, 15 Aug 2024 07:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733603; cv=none; d=google.com; s=arc-20160816; b=LzSlCKCpB4mCypHaAXBJgyblkEN9fPRJinqAbOwraRK8Aa7xNiQn2/2Km7cn1UjyNk 2JoK3keokb+YezovplUvievUOlSIhRW85FixosB+GD2BYqemYsiijkTMInPawI4MRLCy mEoFSKXPBWZknefy9VHMcjEqr4zuTrq1Tf62fUZy/xskVrjHNXCa1hpCr2xcLe+WS+D3 4qhMsrhpxIn0DrkdXrryvgjNiCvyK5hUDuyohRtae9G0pqoEaajC3Xj+grAwRsLBgEJ8 Mm96dZWJTZkfWFRhxtg3BMPW6h8FP7GDemyG8L1Fy2/4GV5VlnKI5ky1m1Ervmvh44Oj XSyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=F7MaSXOA/ZMqYEU3CV7ts37a7U6olYGDg0a62DJzx+I=; fh=mgv8OYSOeauXO2peFYGA66chUW8CqzYzCzfNs7FK1N4=; b=HeZpfpb0+3DQzFeh7WYjnv7XJwmdiDWafPQDGOPCjHi3QnCo/Wm5tUX0BS1+6f6gzL B0sgg8ieS2QpvsoEKCb5K26jV2XCPO8bEhRuJhltqXaAiuiMvkJi2vplK9hm4Eb6RZ8d 62+PJ78PC3HuVzUcD32ALT3p79uYhrdJJXxIBdKdAAHvyWymgEZvQQx/lHKVO8gtCqUf HtkY3o4uTeI7TxYFsR4e35Ychnb2tb+tbENIIOLPPpmLHVHL2kK7Kx06xa6J8ixLDedM EUy4x5fyEWWkyzYdkJ/0A7gr2z12m6hfzrrCerlpBl202tCKsP76jsS+X6xCaB7Egjv/ 4tWw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aaADOblk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6bf6feec41bsi18670326d6.350.2024.08.15.07.53.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:53:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aaADOblk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819418 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1196869wrm; Thu, 15 Aug 2024 07:50:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCURzE2CWKH2MoOEKcrMLTIwD6GaYhzp1RoOUd5pinbOLif2Ch5v2gjzm7+F0fuKrIpqN9Jaic76Fzb2JbcBr3HA X-Google-Smtp-Source: AGHT+IHnQctjGdx16EBPqzVn0tgY+TCBApXns1x/4aPFFzKl8nfVMoQU8WwpRcMDG3k2rXyN3eHq X-Received: by 2002:a05:6102:3714:b0:48f:4a50:233e with SMTP id ada2fe7eead31-497799e61d2mr22335137.21.1723733407766; Thu, 15 Aug 2024 07:50:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733407; cv=none; d=google.com; s=arc-20160816; b=KwPv2wQj3NvcOokJj6hf7bFLv5kwFPAXo6iMRcACplZhFbiDpIXvSlCMKSmigyEEVs m60FEGW9kKmAJ657Xh50HYaV0gC9OeLj8n5LcN7LbA6UFzRtgGLzZaNxeAHUoB/0qJpT n1i0iFdiMVfOp5b+NAQUvlPYE56gHpkqkdPFO/pTItOXOd8ndXidY2JFNVYoGLaaFeN0 Y+70v62qzL5Vr6O7ZiZVkUcJUoTTBtdfUbroH2yM33BQM8iSaXjhU8+radnH+kGabqmp qgCT9O6EGKv2lDjzjzmjw03hMWgedSv6+2vQtX0nH88h0BdMEPHYUmz3tSiWMbWHmoSQ EJzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=j0KEoUGEE33PJpI6PwWgjdeA/8L5WleKbgGt33xqUss=; fh=+M+8gO26t5vlbWcGapebAnMZlKU/cMZ//ycVIxef2Bs=; b=X8lfqFf6wM3I/4NkwYC0u4ady7wGsGWgghIzfxqboNtmtJUf+dGMwvJMXgW51Mwnn+ 8YdSXciL3RadLZNFNW/JjzUSYD2k2SvtpjXEi4kwqTg3oD1nFmevrhWhFhDw59C6yv4n GIZ+nU34/S3MMJAHLQd21Lh9KrG7jFghbPIwA66J29oEIYR/AxEp+KCSRfMjKs7BA/v8 4wtGTloeBN/RVgide//tz4yGrJ+dRvSjhLsT6xp5ayMwiH97bMSwhwY1AjBGIr70GR1H B3YsdaDaoqiqN8Ek/aC5g1fOXbSyR5sJohXoZS6dpqvVf/YHZrKkoVCETDZQHBUOwHJE zbBg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zZzJPTza; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a4ff0e6072si214023985a.408.2024.08.15.07.50.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:50:07 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zZzJPTza; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819425 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1197281wrm; Thu, 15 Aug 2024 07:51:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU1meJ/T6Cs5e6TVh1O4aBGmS87vpUNT0bnIbeQn9YqMiyPCi8uvWcMC4MPETKsPR1iRkqGcOsIYUryKGeqrjGe X-Google-Smtp-Source: AGHT+IFOeFdJsijCEhMI3QAieUf6jyHxHF5ossnXXBqi4BS3nn2GSMGhzh+ENW8nBLBdFQyDgiV5 X-Received: by 2002:a05:6214:c68:b0:6af:c2ec:3313 with SMTP id 6a1803df08f44-6bf6de85cf7mr52380966d6.26.1723733468249; Thu, 15 Aug 2024 07:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733468; cv=none; d=google.com; s=arc-20160816; b=m5Thqxv7J+gxow5TE0UaX32T+o4VX7PalL2JYOFUVGqNun7ueBwsEfNmU/2Ihjzche qHqbCBt0C0ZhsiYc2KVf1Z5mQrb/rX5W4Fmz8T7WSVE8MwEizm+sug5Zq7yS3APvS+eK IC+4jipmTu4CAIPsK/OTLB54rfn3MYhUlidB7z8xiRJ8c2mWCtG1YbHaEpJqExG8vQYJ qPMa2Gw5V7IgCEd/uCo+leiYFAeyeQ/XcejzdFefEuSCdOIFRucvno8Nyo/GZ4IT2EVH OWgCL3eTQHFuXxQmOv4XS7saSY7/6hs5JLZotgH/fElwgI7sBIEMuyaO6fLvCSxR4fXz US7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=t1sXjiCdRpLULlo+gpPa91iiSnoCu2OdnjrYlFXOa+Q=; fh=+M+8gO26t5vlbWcGapebAnMZlKU/cMZ//ycVIxef2Bs=; b=iQQVnEG3L/c6RCSyCFfGMyWqBUV1x85+G1Szsl/yOR4WeRIfHqg6b4oXGRAgkVjdP5 59uQeFLkgYH6AAEwlmC9C+P4PHTZr+9i4/14Z3V/NgKLiH8Kq5T75fu1egznXSksA08U yrAmCyXEixcQsoY4oFyb4leYZOhNvHIYm6pteA8KQik+aQiaZUFNnF+XF6wGdmXsLOpR AKBG3JkunB2Egu41KET6+n1+jpY1IhaIbZdWURTcYrk0filoC8ddDK8Hhs4sgkUyhsFh WE1i7aVUxfkmC3+1aTuGaV9YvsexpArGx8Hq5KZCoU904qh/Dl52Lk1DloFS1aFKr3Q6 jP/w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lOG23gpL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6bf6feec61bsi18716266d6.367.2024.08.15.07.51.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:51:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lOG23gpL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819424 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1197267wrm; Thu, 15 Aug 2024 07:51:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUXZjlTKQKz9GkQFUi3bI3JYUWzpaswat9XMJrmiWMe/9xgYlAejJDaM/8AsYdGAXfBLayTQ+myfNcQ88DTF3gv X-Google-Smtp-Source: AGHT+IFVDKjuxWd4KMJzWt3VyVfx3/pnguRvKBQscyueLwKWE2ReJGn54bjx9+TfPNa9tkMa2vD7 X-Received: by 2002:a05:620a:2906:b0:79d:7cfb:884e with SMTP id af79cd13be357-7a4ee31ce62mr812343085a.4.1723733466190; Thu, 15 Aug 2024 07:51:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733466; cv=none; d=google.com; s=arc-20160816; b=lPrhQQxI4U0glMChpiGAuicv0f+S7d87QoKX+9Pt5sUlZD2pRZvq/PMamx5l0AgVI2 7Imidbd3rXSASoImCpAjM29/Pf5rT0dJJF0JLR8pdDmUYOaltyMrWu18pfxLfgEtq/SS WQf3NgQvop/tN1I5jNgUOFUEx6g9UTWC/XonDLDPpfNAEVVYL3ukLyN1+3s5MholsfT0 1R1upO8Yo3HuoPFHS2Qfwu54W+tlyHkDzfnTkcxJ7bKIuGfVQhz+vdEHm81Sxb1f4qhQ ZwN0ED7A/WLEGcTFOs7jSJzNfjBCf+RKkhfsoyAkNJlyNZIQamP/HuIe7Vo4WxtWcK3w v8ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6qa09G1wxoease4Cu4sCuCaUUU6r75hWrRIJjosTbxU=; fh=+M+8gO26t5vlbWcGapebAnMZlKU/cMZ//ycVIxef2Bs=; b=kAQuGeSepKcW2MCtOwqP20sD8ZDYga1ieDV5f9JAk4jadUg7ejd8kaqwV3trN5dYPW 9S2teiMAFBxggHJmZUhSVKQ+PEN5S52snfTDsmJGPCvjtDd9rvM6pzQE5gYqV07K5DnR wBzO/J8JhF5BOWVwFoYZqJ1AXHFLaadMV8qg2+JPCbkP95B8dwwoHdszk7FRbwkfTJmy QkyyRL8Vtjh6Jgj33N22auAWfdRzvTQuYTwxqQczuMc2O8792ZlkSUCCRGTUqtrpYWQh d99Rp/naNRbGqIhckwQABl09CUHzUANR7S3zWuIsiAPFGX1qkyxvu8mtreTCr/GOUbdC 4S6w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WCe8LRdC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a4ff0e55b0si199290785a.453.2024.08.15.07.51.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:51:06 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WCe8LRdC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819417 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1196838wrm; Thu, 15 Aug 2024 07:50:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUxCLt3GikCJocDTJplo1FLjqOBKYYqZ6oTXx7yM5uAxHmZnRNnGvlfhv7czx+xcSJaiETC6pC99z59bFKXKAEP X-Google-Smtp-Source: AGHT+IFZqrHtHOscPncZAepfHUsgQaWbe/FN5XyySihKZAb/fEUWMR2eLm13CxzJOrRvg/Pyja8n X-Received: by 2002:a05:620a:2990:b0:7a2:2de:efc7 with SMTP id af79cd13be357-7a4ee31aae9mr745488385a.14.1723733404600; Thu, 15 Aug 2024 07:50:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733404; cv=none; d=google.com; s=arc-20160816; b=H/b+rDzz3DX/9NroPwo9CCDnW3LuaA0Hxe5vVoIlzYw7tHiI0ymMxjd51pV/3j1GqX y7KNgX4mGxfjheYVkUWdZ0ao9U3wstLNUhcf6jqfphNEji78GrRB5+jXRa10GDf3qN9Q hNZvOSClayh4OHsPxfB12rsk9iesHoE1dUrfzdzofWa3YCbXSyoWPEdnPt3A3fghEpSl 7WgVwKItslopPIrqF94bQWRk4TO0IOGS7rXFz8ArGoyw98YAJ7GNydtMUXRhkjRI63BN gYTrE05CwJb0OZIYRpgMC40d4gOV8okvO4amtUSSsGXxymNrc8WQKm+oV9i1eGsuaDpN F6Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XlVm4bFaARcVP1rknNRsQtAnzRUhJ++dQu53YaEvbis=; fh=WhzbqIBMoa+7rSvYlsNZ6gEOIe1HcEGgLa/eFb8696A=; b=fBJwBU7qmfGNUxZLpfHON8tsSoZokWPcudcfL5e2z6fn3TgLJfG1UhPRprzPOVhpgI JEfi/r4Fg9VpSi+X+/PuglAjy9cMBtE1p413aZwoKX7s4whR/tEbM2dy4Xn5thoNRGup xSA4skuUqNDT0thdzQGWrmmxIhS+eB1XsTap1FYz548gnNs5hxfgssa/3N6U7EZ0nBe8 gDF/Iz5zWSzFeS31VyZCoWouvsTUGgrtXUa6qm1FdQO/3/F9MBZ467dYDAKhr9WkWPKm SWVGSH3Lmxh1j86b9mpHchyL5Y2ky4GkRCDa9qDp1eyuZbwbcuROIglgWc4fKlG/s/5g wsSw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sfhJmv6A; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a4ff11148bsi189420885a.643.2024.08.15.07.50.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:50:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sfhJmv6A; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819414 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1196717wrm; Thu, 15 Aug 2024 07:49:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX1WNy8bbuhE8wB9ZxgwLTzz9eO7XXTPFmSLEB+PrR3xD14ZURsGC1U81G6UrgXydq/MyypPXP3/zDl9Xx84to6 X-Google-Smtp-Source: AGHT+IHK64cjb/1W474ZchJL1x0B+nO2tflyk+2iawpm84KsG9/v6J02+uo3jf5Uz37Qe0YO3zWd X-Received: by 2002:a05:6358:2d86:b0:1b1:acd4:d155 with SMTP id e5c5f4694b2df-1b3931c349emr7477455d.16.1723733388178; Thu, 15 Aug 2024 07:49:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733388; cv=none; d=google.com; s=arc-20160816; b=q/hkyG6vxN3HKBJ8ub5kgFyi7+Nceq6JUhE9z1EyLlokNRhRjp5vioaik13YtxwvVu iHZArws6bQ85hOYD6npgXeAsxcD0FrSQJ4wqpSwZZa88UR4qJhyCOQvgpqngUl6K3c/C 2xmpuCm0H/xMDZ8Z5h86mkYGtQmv2jFcBBxWOJYMbZsfacS8KjLguGASr0NpjqTLp+48 Sa/33cxSRs/DxD2wo6aygv9O5xQNIfmKjA7TUvd9iZ27ytOvjRzY6B1s3GeDdCo6nf78 Hc8vQAFaiOinHX/Gbba9Y88/t2NrfSjsBa2XiOVZrqdZ/NQV5b5ZdHDRZRmcmnOjRRm4 mY1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=O/2O2QWI/Uf5GFig2yGm0H8WH7A5Eq7y7uzfXzjAjGQ=; fh=yBdPxbk/fIh0WWGyE4QIHAQkRG4fxf5ocDA2RtWSFdA=; b=lLPfqGl+ggoiqGjAYAjXyYo/ybBa2kbXXh6PknqpQLhd7qNBdPOaxefL30oxW9TN/i 4rdB5QSQBFJoun4RMx3Y+YREnJt6vlQMRquPDlxT/tekx4S4dOMdp98AADc0E7AcjDAX 0fL2wR6fLaDD9raBaAp6R3ZAB4mgV23eMbQpNfDQpVm1G0malTsalmdmSGfKZ7mwcgmk zlgfjKx1oXTxLbOzGsPO/NC6yDNnRJgs01o0t5J8olBV4/evBhZ+L1SyZz1B3QlizThn K6jSIY3Wjhmho/7SiFiIp0RRRzuqyfjVdaE+cUPmeKABpS/9upRb8Aas5yx+/aMlgxIs owuw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VHI+ezQy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a4ff0e5c56si203890085a.420.2024.08.15.07.49.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:49:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VHI+ezQy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819426 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1197383wrm; Thu, 15 Aug 2024 07:51:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWy1oizjUyKS8pAZu1X3dYCgXkRa+WPOYEMW94ABGmyo0XdQ6d+dlbVc7KfiqDCPfvLQJ42obXigFKp7z48ChpH X-Google-Smtp-Source: AGHT+IHoTS8x2e7xlsdxU0j7/9Z5MNws1qJgwDfYhxKU/KRiQJnZalxKWRQOZOz4a5n0Q16RfQDE X-Received: by 2002:a05:6808:159c:b0:3d9:385d:8747 with SMTP id 5614622812f47-3dd2997c41fmr7638942b6e.32.1723733481284; Thu, 15 Aug 2024 07:51:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733481; cv=none; d=google.com; s=arc-20160816; b=ox9QmPgQz2+HsKQvnpBeAdNe476Yv6JU2P/beyZcpp12qGS5d+TKYD2vCQWX3XiVjc IfAdH7/V5X0hB520zN70kRgBQOitPZ8huKK0XSVcSizPHlSECq1FTPygS3yYiF6BWNK8 WlIl60O8DzYuh60SXTsmD9ror+VDgg6AjCKU/yB3evrvX+Lj3L61YEqWc5DUSJBhW05e NNm/8i0Pl9M+cORpCE6PXhnEyve3fup68+rIg5fWdxQovhGK7hmZSyBI1z+4jrkUXT9P FAk3APjRlRzASKUMR7MupGqyjWDWE+1IaWvvn8fFyvhjvXqeBks6N/uhkue8cgwv95Qt 8c/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FYuCdV1ZyypnBkOQom8SjG60bCuzuxobSZg1OwBHFdk=; fh=xR9vZYb7WOWmPV9P5VOSU9am3MBmVp7ZE+SgxbKHtYI=; b=Xi2k6tECIJqba4Qu0zDTGfE1kYHKYWUdcSCs6G+HpN1NpMaSF3flkiERU+0PFmEdQF p3A/CkkWlrCrHQtHO/q1C4Mk4ZJPvyZySLYNpsgd7vSknOdWnK8KMtCgnsub3t5nNVQD +wR8b/iOHJ1l3etcn3P8d3+PPgkitRWcXzGAVeDjcNTOaxCw8WB7weYQzjGBVJv+SI1J 1SlgYY9w96E1k5uUZq9b52tI3NBV4NyU9fLpLKNS6cXY2C/H9oKwQ9HeGWreeZVunhs/ 2ZCXj45HqVpZRRBYcc+t6/A7e+hSiOzvExTwfmVWFndgAImP/5sYP76zEViKjamMNpDy Jm0A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O2d5eFYa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-45369fe6be3si18594061cf.118.2024.08.15.07.51.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:51:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O2d5eFYa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819416 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1196833wrm; Thu, 15 Aug 2024 07:50:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWCqPiZrjUm6UHGKkgtWrlvrcYoj4W3YoDCuFnLyGScpbaFlVQd5+njLB90HsM70b9uK9SQ4wEtmg16vOU2Mp9E X-Google-Smtp-Source: AGHT+IEHpF0Jsy7iI2AlR/Pdw09+IZQuFOHMhA0atFi+IxRjtwqR+rrLZ7J6+25YUAx1xa8qIp9n X-Received: by 2002:a05:620a:2413:b0:79f:17da:6444 with SMTP id af79cd13be357-7a4ee3ac678mr817818985a.47.1723733404268; Thu, 15 Aug 2024 07:50:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733404; cv=none; d=google.com; s=arc-20160816; b=kXT/pkO16+ZIgDuKZ49SOPz+qyvIPLbzXO1YYr6/9lHAkpsXgmytRWMEle6X7Y+/xf /ieB+74k1z5UDdbZYlgQoYAEzN+udtwmwvFeqn6PQev5/8q7PnFLYNjDFI9VXFqeTI0j ++2RkENz8+yqkvgyPebJc96C4vg01vXkeivMI3vjA2GbQ+Ht5YfdzXmn+FHIPo2pzBsg mHZUIQK1UMVFpe3PGatBaETY4o1IYx1Af9zvRkWBcfK9md5uzQ6KRUqRSh+2RxeczfXm kgZlY3uBcY7oLgi0UP3gpKIQTL0374JQOgrg+A66nA1jSQ+L/AAvpzfJcoHwImJJD7ag kvBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IWTACBv+HeAaQXi6YaAMOGKH3fj3f0D4lBpZw0s1ht4=; fh=OyP2l+7filHyY8JL7Y5pQ8SMBqzILNpmcOkqwdHLBx8=; b=inc+CCBm9u6O9n0ztWNCMU5PtlTqhYRpsg7GyGwwY+2gQgdSc1ORis3tKuPgAeGiUf 45vocOD3yPmLr98Pvb1Tc5UzsepGTppZTCvdpQCD1wYaN7PXki1p45pUQCX+47nHzZ9I oJTMbJg9FPPK7ieUhAy0msoi7I6/3OAF+5LVOEEFoLKwvvZKxFy38kvA9wMW+dcs7IHe kgkBe9uiz3OGPNXznjgn+Kt9/WkiV6b5OFnwxbYS52kbGcoqxHVmYMD/0iRXq2W7CjN4 Up846Wm9dTna41GxASvBnD9S9eVOq3OMIiqeyqQUzOGaFcMUS9yNP1udd0FrW/Iono9J QOSA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BPnpheNx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a4ff0b82c2si187032185a.261.2024.08.15.07.50.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:50:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BPnpheNx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819427 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1197399wrm; Thu, 15 Aug 2024 07:51:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVJmKtXH4jbMkZ9RqeYsUHe9c1UbdCc1TebkSbUJDzHwD33SyfPqIv724CEVGWMOpzhnRbmhE9ojsWsw7IajJWJ X-Google-Smtp-Source: AGHT+IHxuGU4MOrLnpeo4v2ZAeP5Chnog+E+1tRU1bXV6tiKJAsyc0dFishko/goBMGDVcsN5v2g X-Received: by 2002:a05:622a:4d87:b0:446:5ac5:f9dd with SMTP id d75a77b69052e-4535ba9f6c0mr73278911cf.14.1723733483164; Thu, 15 Aug 2024 07:51:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733483; cv=none; d=google.com; s=arc-20160816; b=BHkCnESXvyZ/r4T25x1FgxWZZxwHQJqUeBgdgEFZjd+XnGEO0/Fj2/4Y2JKNA6U2MV IlDR/wIXI1zOiDJsp7zcgzE6qHmqtycZ1JC+KlNdIjwDNLMk9ExQ83o9xib30C9+yHAY f77wRewh2pttGeo9eDzsugho0Fr3lXDmaXQQd6YTn6ItXYBXnMpiRcC/pa8qyB+jCI0k flf2JOyhS+/Zc30Mk4c3W+mAb0RFVUyoMLGmUpLId38WJ5958Z6xgn/EDMK9n7IeA9oE eHnRghSX2KBp8DlWumU0yPUaUWPGbr8/ukzYN9KXchiSV4E2Wm0rIOwo18KoJYmg+jQ5 O+Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6AOhP2ldyW9UA6bgoSKwypPabALbgykDRW8dOBoMAIA=; fh=OyP2l+7filHyY8JL7Y5pQ8SMBqzILNpmcOkqwdHLBx8=; b=xD97aFjFo+2LOdABJzwQG2fABuIEjyfx/v+i+CUqreOliccOcUcfGWHslfC0QK+FpJ LJDr5JUymdfj51NrY7rLESzZsYjQnqgjsvVG4B3jsbNBTvc5c/GL4p2TNM28FGmrwviE cayKB2RDZN986GTpn9IoPWVRrv0inHka+g11lNM5gXtOKAEgqoabl3ZaipH2ZiWYxLEg kODgAuc0XjPqz48T9KsqwMZ6TgjvsB9dLWklinEkeZ2dBatenDXPWLwmVboJ6xHFDC6T uP/zbvcFj4BMgygQOa0dziQCjLwITKtGr1Fvm3GvLbFIwN1Xemu138hJNG51drYXuq0U Ua/Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lLj4QVBv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4536a06f8casi18971441cf.351.2024.08.15.07.51.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:51:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lLj4QVBv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819423 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1197209wrm; Thu, 15 Aug 2024 07:50:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUvVfF7hu37dfo2jeyDQ5I/PTiWtemHY3P1hclvXOcKQAiYAryw6In+m0KHhTGTI/er36fjYMoytAmPlmx8YL82 X-Google-Smtp-Source: AGHT+IGFB6dMN9CyoQWx/BJy46pJAgnCBdt+zxUChyYK9ZQP/hTLkeuCGRo9YGxQCwsvTMXtQehR X-Received: by 2002:a05:622a:1f05:b0:44f:fe65:9d0 with SMTP id d75a77b69052e-4535baadabdmr79496211cf.21.1723733459544; Thu, 15 Aug 2024 07:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733459; cv=none; d=google.com; s=arc-20160816; b=KVzfNVw0t5Ruwlx2Fo5C0PbjXvpUYaY7sFcYvCObRt5GCkewrHNursqk9CZNJsArC/ EJJqdhYAi+iU+s9YyOgAzE2Tseh0juJ/hklpzOU7yN1dfMjY80WPGiWH7FjhqxbYHMfz 9URt/hElEpFocAxJsfMfEX2nQ4RGpVovwyZXyrUqSg14HbzsLvu29nQgx4EghaE4b6mN RAd6NpEGGmdGLWmZZGVqR9HQ4c4K74TcLWLUBhBH8sKL3T1Fh/WYbKhyOcNXXeADpuYT O7o/ACDSfdBnz9AxHh6+3v/fwK5NWP/E9ktdAq6KOe6+5FLdI24fg19MgqF9HoJteJk0 qJcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5GlC9DIF5/JKDes/L5KgAf0CY2UX88jzKAHhIzM/8FI=; fh=owHifRqMxe7xYGi2Ftw7hSwr5Tz7J6ppIfy/tqm+a/w=; b=MVk5gjUVvhhFlRr3yp+aXf044nmFvUoSOKNMHG3/4bFTgIF954TGzzedtyUt8dd+dd p5toOcrLOfR/SEYsChyVQoA0+avSvdXXy1Lv5eblDQQ+lP1ZEN4LPwODJyVRw63NRF/y c3iOrfytqvAUEgnvvWEGNGeu0P8UAPcNi08r4amhEo9mJiOPUHTlt+hv/8+oCl8e7Im0 sJ3L+nWX85iZz2j1LstUIt212H9Tzm8gn9vfftp27zlySfxpKbmxGlRptpSdoiNbVBkR 6TDKZRZOXoW9wjOnXY3h/Uskw3ZGvwN4qyrMOpokV4Xd7J0oL5QdVFeSEdxmCd0omcMg dfdQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=shfJg6Bn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4536a0037bbsi17698491cf.193.2024.08.15.07.50.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:50:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=shfJg6Bn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819432 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1198556wrm; Thu, 15 Aug 2024 07:54:27 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXk6e3zJLy+/Ldln5egOiBIa9bD2i5q1KEjZXLJF8KLHe6QbDXOqymxoMqaZFyNlSvbDxppqIAypZkFMtqZNhJ4 X-Google-Smtp-Source: AGHT+IHU1g9thRXivjcmdEPjUCbL0kBszcYy/XMyV0NKYlNUcMZCDTZOLkkeipiKbCWw2inmtWO2 X-Received: by 2002:a05:6358:b3d6:b0:1ad:95db:b6f2 with SMTP id e5c5f4694b2df-1b3931c7cf6mr5109955d.17.1723733666720; Thu, 15 Aug 2024 07:54:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733666; cv=none; d=google.com; s=arc-20160816; b=zt0G/+XF97JMf15t0qb88ORiWN7oLOoyJbxD6KhxOo7fmfUXbfkUgwZDnu43Q/KAw/ eMCmjC3ma6BPyX+Ymvzk3wYXk6bD2R5YMaWcFvslZSWziW+cR0/6aZvZR1F+9cqTib6C ijd+a0QB0MYH8BcDgjV3IBbJhcjU3c6opnb5kiEcj8qlKTHXPH+iJrN8SCpat3pkzx06 RiiXVGkGY5y9OqQh+rYe/08ayXgxGZnIWjsRDtTK0loSuPL6CReNMssCPnj4Ph4YjUJw aSIXh4h4431g95X2RE47X0SJl4AnxYEjIm2mlv9pXvfvsKbY29k9mR8PR0RfleFpRVxo B3Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Q14NFcjm+pOoVDQJIzMT7lWclsNqJbgHZCvrVMkJVPA=; fh=E/m77jHp35yVCgnDp+HiiCEHBFfDbA+VGlwjcOCCI+U=; b=JQ79w3NdocL1JfkgpXaLIlYpInbn5kzeH1wio7m5mh92vDGYKNtrla9JO/om8Xe9Ce 2DITgPKX0wROE9RZOdDjA9V4Ich2n0gSYzDVAmXvXlksCpG6ifbykqmaHNl5zSpLySoU qNehT0GP5oc9lmHHx+r6OTGuew3MSnDiOG1c+RumcrVoKEu2ukIsbM8f4ElkpTneZinf GcilewSNl4vze307vYaiD4pHpjRiYSwmObdTf8uRCGuvc+AgX/UsZTftrRBYe5AQ68JF oPEmfX+Cw/ifx+2Y3uRkibjrX9ZCpKKKDwpyh8zMARIJt3lTXrWb0yHXXNVJWfgv0fOg 0Nkw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X3hMY+d3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a4ff0e5990si211675785a.455.2024.08.15.07.54.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:54:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X3hMY+d3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819422 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1197105wrm; Thu, 15 Aug 2024 07:50:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVJUHe8rX1FlPpntD5Qk1IcdlOZzWcmQu4yYttK1hrY7cJQVYDTBdaxYkToYfLZAr2/hWj/enM3wn231VLBS5LP X-Google-Smtp-Source: AGHT+IGW6LaXvcdLq1kB4a+5TYK7J4kNJOu4LjPr1tJbYx3ZgjhiirRTezwNX5FiPFEqsRYjomZG X-Received: by 2002:a05:622a:17c6:b0:451:d75e:abb2 with SMTP id d75a77b69052e-4535baaa7e8mr80067441cf.19.1723733443614; Thu, 15 Aug 2024 07:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733443; cv=none; d=google.com; s=arc-20160816; b=rEQvAjG12VUKl+ZDFsRFCGqsLUvNYGdx1IcnoekJiM/1896whHMHaUzd7xsm+SJqs3 MQvXlfPT8QL16wkbIiDKh3kcKLtIp7UkRcIql7Equ12/WjGWsKpzlkwhSys6wqY5xBxv v9NOcex6bsGpdFy8ZtkvKLuSkLNvmBPadaAmX2FVarJWpyVdldAll0qzPv923NofMMOg YrjvOEm/h9BvBTd7v0eYdHF/ld+g8EcpLtz5OdR1W0uP/Vd23SBGBVV5efGU95t1Z+N/ cVmrqPJsG1dCC2kbcu5lBg7JW7tpILvcXBYjRH8VcTEnUqBLHsl0E8sr73DyQoZrFHNs PXWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aOj2cgvMvGGvvAwDFJY/i7+D7jI4xMnmqcjq9GVb3BQ=; fh=F4c82ZNfTiHQOtd+Nu9Gqt0PpumRm8gnMIBATM7m4Uc=; b=IhQgt1eODa8q9oHuzSD+oYxggHUkQWOXMqTD+gh49FGOoYb5aMb2pdC5331Gg6XYba VX69bmjyEKXExC2xA6uP4rabgX2FnqgWrDjnxqAlJhrf34BgerHT/aHSOAa9BDVT+Slb AxeurDPM3Chlx8K1dnkdvezXZ0a2zPJ3ePpOUgEe/pYaUoGGZhmKmNK6iarPiVt3vKYD 6+gngP06D5cbws+hYjLPBcSHXJFWcFj4S1k/kM4tsTFbMhY18GfeWEoC45SH30o+1tOA nbSTlvgULI3RdaD+kwiPmgAmsVXSrsKoUNFAq1WMWXfh1PcWHn7Ch0QYjXj2uGZI9Y1G OBfQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hoIQySz3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-45369fe4f5asi18530791cf.51.2024.08.15.07.50.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:50:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hoIQySz3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819415 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1196763wrm; Thu, 15 Aug 2024 07:49:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVCc2sJxtP8TvCnjwOSFIcMM8u+ssc92uVWWOX0rX2ZgFYWD02V0QXt0D53Kn+xL9Z1kzYmlhvTWr5L+TobvK+K X-Google-Smtp-Source: AGHT+IEp90UOQk5I2Y2wIAp7gNtucW0Obc0h9dkahGtxSJ68F5AKBzgcQ5lOhqcCucVwU30vHggt X-Received: by 2002:a05:6102:3593:b0:494:829:835b with SMTP id ada2fe7eead31-4977990760amr60271137.9.1723733395239; Thu, 15 Aug 2024 07:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733395; cv=none; d=google.com; s=arc-20160816; b=Evha6soiHdznDmodIxn5TJsINr3zVXtgwIgzAu4XLiIZjUVqpASyRC1NRDnzoeyYMj oZWUEQq65H5WolMjgzwylmhRgYJgEJ0X5Lk+ni+Q/jgaMotnN+LgcgItNiXMSgABHX2k tG6DjAG5SOjmWt/1RymS6p4V16cnLi/SXT/OIPHonS7wwwazdUK6uYem5ThQxFALFty+ Nihgvgdr9q5WLN42yla0kJVISdCoVM70/+02tCpStP02HpX5Y41shTxzbABHGsWQjeyc iDK+BdswyR3cHPmhV/i6UCaO3+Ed32L7DBbWUapDxRfq1E/VNiTqY/Gm0xfILIqiHKeN b/tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZqpOMl7awKhcLh3PsdzLgfKFh1wtkG9PTMoyFGQ145A=; fh=HRsp/lXYuMNgNUPCwujrVRzXLgOzwQvzRwRa+N8pag8=; b=Pvf8Ky5FFLzx/AXzxFaqY8ML5U1+9kRIMiy25y+UxsELu/UspIitH/XjLhRGGDDwKd Dg7TP9hWmYucfGt5IlZMoCrcOizV/W6N+BSqJfXgMm9DMR4hyqkj/r0Ikfwg+MuJ1Yk6 xu6H5PTluqR2FfRlMcQIbp0K3FFf12qWx/WZkLpob71sauiydLcUlTnYzbT0HcXeshJB ZFEtijT0tlndF9lvwEldNL7WQ6WhgpOakOj0msBBSafOcCZpT048D66AR0dq54Drx6yj ns/L1fSeBscad5Qq/ccCaVFkrfmy2LHrKnIJWxlYesrfE4XGWYvviiNaG5pQgDzUN6cR TPtQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="EV0279/M"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4536a0e7760si18787621cf.656.2024.08.15.07.49.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:49:55 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="EV0279/M"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819430 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1198110wrm; Thu, 15 Aug 2024 07:53:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXbk3PHWLAKo3wpAKwNpjJsqf2TkiUVhZ4jksdVyWKuR9MhGq1gTBkXfY0OLlML2MuyZVsjvSk9KvUOFjQ7YDlE X-Google-Smtp-Source: AGHT+IFhf3aMRuJBj/hrbesLG1Q0lDLGe/ORCwtOiluhxAka9hPofMJw60aW8qr/ygQzPsG6Ishe X-Received: by 2002:a05:6358:478e:b0:1af:1b14:791f with SMTP id e5c5f4694b2df-1b3931a5e0dmr8671855d.12.1723733591800; Thu, 15 Aug 2024 07:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733591; cv=none; d=google.com; s=arc-20160816; b=EI2Sgg1/zyzkTtfw3KqupC8xjUR2DsEo9ZiOhYMlcKJVaAlb5Cgoazi5IbSmjlYha6 56hRie3K2NMgY3p9DrTangsqloP0KR5N5vREx3Ej4eSk2gYHUHzlIb3F0bplvTf2Rv9k AZu+GSsEVbqhRHzTq8qzV63WKVmrpV51drmaoTdxuNj28GpN58yzUliPHiYxHxVnMpCF dkaFf6z6SFmDJpt7cNKKODaS+dDxR6zYdyQ/kt57WJqImVJvQj6N80pOp/VDMAt7Q2Fp BlBJuHNTtw4qIgXerZcAoFbZRWgK12qFunwE5VnPT0hfmfYnIjr86wTY1OWT3us81Ajo cQ/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ANsPiSjLHElnluRHF+jBoUXCzn/4iakx0mEan1/xlMw=; fh=YPO7RJ5xekwF7jc9wIKZgz4hzVz/pRFcJeNjtB4xtAY=; b=jWn3cvOM/dN2JFx2Rb+CKEy7MIafLvAyZzn4HIFB11As/+hVi0a2MYTXrCOEX1MbEd etPX7k8e8Tfjr8rbggSPiKU5EnLBF6+FCzWvPGXFMpbu00kX6kpryBMPngGy+lawuKte HIJeD3PcN3pfpkQdKaL0EtDRbtap84EMCdbPTUQweEGbCSF8sN/G4BYREnOW7OxJo2qs crW0m1N4okNq+fvWD3C7PTH/+tlRTzTdF+c4irPDoZAR24wjZT1AW8BssLngNJlYP0J/ ZKefCwtC/wejpZf8/ckRM/M4za8jFhhy7pmkX1l900TACpc3FU/bxHShaWx/UsXP4F67 AZTQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LaS1yfGj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6bf6fdc80cbsi18849596d6.24.2024.08.15.07.53.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:53:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LaS1yfGj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819419 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1196890wrm; Thu, 15 Aug 2024 07:50:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXP+NeToIPyhUsG90ciY9xdw97mzYSnZ2ceCQTavPvazYXg/YVWMoUN7GfVmLQB8jYsjvTtr0DwHDc0N4CktEXV X-Google-Smtp-Source: AGHT+IGo3HBtaKDCs9J2NhmfVKP6jjviQBdP8zc9mpAeTI5KokzAbxtskE0xToehYwQ8F3mCGDHp X-Received: by 2002:a05:622a:13c7:b0:453:5f79:b662 with SMTP id d75a77b69052e-4535f79cademr63842511cf.62.1723733410927; Thu, 15 Aug 2024 07:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733410; cv=none; d=google.com; s=arc-20160816; b=bUlsr/wq056Dp6kySGkw65eyf27IPP1CLAqEQxtxKF9gyPVeKJnFoDEs9na/fQV9OW uZMGu5qxGrYgR7xRtx/M7ynyPVz3eKqt8K9+Kp4j8HKsVDupEIyTUSpQ5AF6JIwSQ5TQ HDYsojeX1sH7UbCKYweu/8vPE901XboUwljanlfPfvx3zxsJ5OisIWQAJcJszDP3g5ww zA+XwDqdWsJIhRHR9/Ucp3ApWjLHwFn5W1TVQ69vVDFFqWvY5lrmKksJ4tgbRJReX6Le 6NFODo1mPEvEx4jDKyn61X4yLB0w0xiLbgIWk92GXuFP1ODx1u42AI9kZc5Gq8PZUbl3 U7yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UBR0r40jCRTspwNEStddr6vUXgECDiH3mfiz9pfztnM=; fh=jL4v53HJrR9qrEzllT5MF7iWWSLQI4kfFg88IcUizsI=; b=QsbXUWvHOViyJEXFJJRg20KMUZydsm9HPkav1sTenVns4FFokkTZQwjNMJ1tQBc2os HIDaLYkrbJHa0Rab2V0L+NBIwKwWZokK8p/NsoOxRqQWNVNVWtCAxz92N+FfpB3LAvd8 /Y0RaiuoT8NBDIs3/QqgIhn1Cl+UWLodGryL4Z7G+J8IlF4J86KYkQ8onl0A48YvNy65 XvS1Qo396RmU9aEIoTJ3FlCwgx6BYEOFdulG9wBwMaxYgwC6agH4SW/1Xcpj7uxCdoK5 5iSyF5v/firx5nahAjftUeFZo7kVgEZltw1+cRz5S4eXXEHnW5QN+Hbx71y8KZDYAuTk IGjQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jB40umle; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4536a0c8355si18600181cf.619.2024.08.15.07.50.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:50:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jB40umle; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819435 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1199556wrm; Thu, 15 Aug 2024 07:56:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVicnb/qrLbWdyaTbXike/+mSghGNF1kVr8ljH/bDVWhJmUufN2e9whtG2RImx7Qfj4WsLrUH2cOwnqrER7C8fs X-Google-Smtp-Source: AGHT+IH6Qyf0dDVm2/wpFVWaM0staaAVbkYdJBCQwsad/3hEXdLs9XpzefgEWGW7aTiASH9ha/jZ X-Received: by 2002:a05:6808:3985:b0:3da:b3cb:cfc1 with SMTP id 5614622812f47-3dd297dfad4mr7549250b6e.3.1723733819714; Thu, 15 Aug 2024 07:56:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733819; cv=none; d=google.com; s=arc-20160816; b=vWByaWSMvS7aXtJv7FP15Z2RrN+QN2mnry8S4vb3VvwWQwGTN+4TxrGCQSI3rACE9L 5QX5lLpB0V+KbLvxoXMYa8R0OdsXRChAiWCLg+9qZbrpJFAjQ0nWLVh6NjSskwGObJYG 57rXTPpyxvnB12f3nzBGapg3ollPvXjOLCJFq7m3huK0gtsbd1jGTVVJPS2ubgd5RerT 1+m/VnrHkvO89VzkM17YL/j+YNbxpNPuQ6R4TGvY6kW8LjnocxW5ImPNdsHm7mP0ndHw NWkcZzoRkTOqXKoCYbwAIj7h32gBS00VZDvhxGMumExYYmuQXKRVrkgaIbJ1tPb4wh3e CuVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7vFtKZMCqZ//aDW9JM8+1eoo4MiLhC2zYG7YF5q15rM=; fh=oCjegEnsHQ6amnaOSImjmN3nxWU4UnbL73VQbwQfwRo=; b=ifxYAcOwC/C1nDWFmSu8k09Xx4tyaCPGv/cXkO2vR2V6lu7R5zrgp//K6dwmmmPEx9 EgjCcr6OfPUzEln920mjwpJGWAKpOHv3k3qHcd1PNivxz4CgzLWwBhC/4BYazd6SexFA zQimbHqj139eyTrlZTM4fJRz7GIfNRXcrsLD0266zH3ZaQeTuXu3uxylKR7pq/EutA8l nY5d6fA3joMtyh5xJ38R3Z5aBwFUMdy7AWTS7S1cNREKfBAC/Joe1scCS/YngiejNzbk aovUX5Es72Q3e3x2xvMnwqbxpZ3RyOkOsNqGU7HiDIInBCMfpmshSsqyHhN2X57IWgBW xTwQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="phvu/T9S"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4536a08f794si20617701cf.397.2024.08.15.07.56.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:56:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="phvu/T9S"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819433 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1199537wrm; Thu, 15 Aug 2024 07:56:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX+VNc3rHUgP0QlkilrYshGyJ+G7p0SIzAXsZWrUhzrFwm1L1FdaUBMtm7XiOTpE9lAAeElJThgXdoDzTgFAK5y X-Google-Smtp-Source: AGHT+IGi855dHCBbEwlCcimFwTDj32tbhUYM2S6FOYZ935TawFg+Tr8/xCCrVcUKzBwz+H65MpRG X-Received: by 2002:a05:622a:1b0b:b0:447:eb43:5d0b with SMTP id d75a77b69052e-4535bb0578cmr70125971cf.28.1723733817135; Thu, 15 Aug 2024 07:56:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733817; cv=none; d=google.com; s=arc-20160816; b=xvpSm6un01Tc8vJhg4ULQ69lgjA/VYtU9P1dIZt4AdhI8UqdXf7a7qocDWMbJkPjoS pdPVgCQ2kWK/us1Fj8dDYgFKluqM6eJunGmleFDXA98YqHgyt41k7J3ZiveZX0rCLMr9 arFeOjypZcbTNSwwx3VqZTEG5EVcVBz8O45UeIWP1CcZyjoe9VKR8wcZTyNC+Ap7hym5 GWO8/3Vn+GXSXiY6uDu0+IHfm4y9RdTtFl5rQIZPDSX9BhOG/58B/3HoJQSTE7wBq7Rl FFKYpJaBXEDodCSwMTIIYw0aO1rhIF8gQrztmSa/nHN0782x4Vb+lpjbprnTDnsd8GSr Nvvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=En32C6zo6LeZ5uTVMpvZgvYVpJHuCehnEf43V3Hg1AQ=; fh=4HhV617Bdd/k9JqI2hPqGFsMNLZ/FBfEFidGR+V1ss0=; b=kGjUrsv7zzoyOGTJq5Ta59q4jcR1Sb7DN6YO0iSiNx1VUqU8K4f1LLttjba43QC+zX LRXg37MpA48HU7rXw4nYaealmhuYoJrcZ4ISVZBv8OMAutZn3BSEEIX+h1x9SYQBx29h Opw2ZlDvSx7dXXB1TquPkr6Fi4krk/rAyGwTZPRQYqe7g/WHHM8EB9vk4NMiCOPB9CcK hHcXFZ5NK/f4tIhOfQiXxznV5M7JYkpwzI5y8AJyUyXtucxjPUQiDeXIVgfjWCD9In2s 61RJ7IR8O7TTwjgjRyHy0jVVadVxBw2l5Uj5QfNfV/T4iLeLHLkZWIs6DaX1L1WQlh/L 6sHQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OwGZ94Iu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4536a06f813si19096561cf.260.2024.08.15.07.56.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:56:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OwGZ94Iu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819428 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1197490wrm; Thu, 15 Aug 2024 07:51:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXcI1SG3rO1CxBV/MmDW6nOKHKbkaBEBv4VjVDNY6drFJ1UkeZ4yTQcAMrYTHRS2DWthdwgTflG+icyYzEvrCf+ X-Google-Smtp-Source: AGHT+IHcwrh9nLbId5pfkBn560RYebzN1NH8R1nNuHHdaelue4Og1Y92B2fYjWhFA1pGpqRFPDBx X-Received: by 2002:a05:620a:371d:b0:79f:78a:f7b4 with SMTP id af79cd13be357-7a4ee3521e1mr718442085a.42.1723733500020; Thu, 15 Aug 2024 07:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733500; cv=none; d=google.com; s=arc-20160816; b=BfAe3yPRtq+ua2B62K+XNhkaZAWERTCyX2jCV9rTWzWT3f8+4XC80JduwhZd8RcUJE 1LDQ/yYcqUvutvWhZBB8PFh/eus8mcCIMmbzQR0IZMinnNqXXfuSfEZkGSz0ART0/7uH kGtTk8sx7uCt49Hn/+hmmX75vOvBJjVdgR68GiGPwigpX5eNm78Djq5YBOHjm/YRRuCU AhbqkIlT0304FgohLBSvRdsVpZ9U9tH1Xpl43j/Wu3P4HDV67mdURTWqo+05C4qU/7SI 8q48/xD5q94b/CgF/NOH29tsN8fuEr0dPjnovd8IBzyRKfJIiwjugNtLkp5ku/d9LEQg /clg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8bup+6NeSiIzm/eSwtgbo7ETG7RN/Czsn26dY1f0S5U=; fh=2ZzAU4SIm7D/imNwAyoIonk7HNbE4SrZFknhrMyp/BM=; b=YmbgCb3UW92OUKM9selL3e/y8JGM3qrYfb8/mWT2B1Rlfw8gjFq2PGRUmKls37QtqN HTvW7ax5A6Vkp6zJB5BWMRKHE9r6u9n83XMNlLs1F7rlZH+WvDZGJwvXngGF0r7aKIqT eB4JB2+pCFJh+yruKTqZhHPgOT5iNmZddGfqAZQ52mcbDUeGWTZh5U+oTMjkeemZKbhG KEtDb1Ow5qKi0Q3swMMwWSGWXIJRy3G8JxwMu5IvajJt50wxbIrH8IZbBJepYgjC7agJ R0PTvJyC3UeKJvjt0dJz3aW0888C7a0nojKzLozrEXxloLLiRlf96LZt+RzjIlA4k3z4 F9xg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mQFjtTyT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a4ff113079si204347085a.651.2024.08.15.07.51.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:51:40 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mQFjtTyT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819434 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1199534wrm; Thu, 15 Aug 2024 07:56:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXm5UuE+aoktjUTraAI/9ElXz29TktZtEWL0mZYP0GXPkTkGVjZKYWrd2HY7orGmFiQRLfRoO49sGKtUCnNO3qG X-Google-Smtp-Source: AGHT+IEY1TjK+lCCgOrmKXqTl7XiGLPC22CAu8SpIkyvBVC5KAu0E6yFGcTaE9fg4FP5G8SJjRh6 X-Received: by 2002:a05:622a:244d:b0:453:6cb2:c8d1 with SMTP id d75a77b69052e-4536cb2c9c3mr24775871cf.37.1723733816935; Thu, 15 Aug 2024 07:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733816; cv=none; d=google.com; s=arc-20160816; b=oDw6Wl/+4ceJVvmKZlMFx7bWZnf3aWamw/8KKHV5UFSgGIF6l9uAh96LNZ7GG2OLgV CP6y7474O2Zcrl0a/9G8D28LBG/0fp4CTJ9FD9T0W6Pf8lbamgsS5IUFnDjQ1J+/TFds BxrcmlhSXmrASJihUpErh8vhcx+EOiIqEB6vy3GniKdSSNd8ibhFpays21ofom7khm9P U089wKNsVyEfXzH+Q5ONV7pjOLYjTJS9UZ4bTJw6owzTG0fGmhgLwy3x7Vw4PcF5fafD ZauADRP26qiGxQhxgT7ws5x3jlY0CGqnM5vm6lX4LiuUlP/575SiSddni3vcNwYW/6dY hO4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VFH+GkIlDVHJtYZuDNv3/msjkfbYLWmbwCbvi/sSR+0=; fh=OGfbxDI277gOrBJL9fMPmkMhMIVNttuTKOdsEC5V+hA=; b=kMyJ2281DfCXv7kknaaaYtSb5SNV/xhXPzrjGXbya6HtVk5YUVZL9f6RJWU9OZ3vDH vOz3OcXFhaoKvHLkb8U9xmNalMWyingWiFaJ1oU/KW/hXslxL1ULRb6c/niVoxVJRIBY XjSVtChF6DTNAtoWpHRV+7x9o1Waqj+iAb9EHUI3e7VUpyD4iHSMeMPUg1u8RbeQSWPS +myZg+/tTA1LgTWtvsjTx0vb2eQ0YIXGbF67aqsJe2AIRk4+0GWS9iXRhzjYtEJxvyGh xSTl6XNSxr3cXgS6KdWsqjXMnNy9Sal8EEiVT1qYxBOUcJMGwRtLazQdwzfnrUh7gCiz lD4Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KrQEufhK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4536a06fc77si18329461cf.316.2024.08.15.07.56.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:56:56 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KrQEufhK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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: 819429 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1198019wrm; Thu, 15 Aug 2024 07:52:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWbQYEXSS17JF2Jyb72R4A/Ul2P1BKzT0PvZ2PySWyUVTbPLYZDE9VvMoHTJBMKBIibN8x4PUOZxOSnZlYZfq7f X-Google-Smtp-Source: AGHT+IHUj/M0agBE8BQDNBpyDKVxz2nQUP/6w4D9XG/hrSU9/mNgU3ugbD9Obmn4/JL6Zi0FUaAY X-Received: by 2002:a0c:be84:0:b0:6bf:5da4:96dc with SMTP id 6a1803df08f44-6bf5da496f5mr59193776d6.45.1723733579456; Thu, 15 Aug 2024 07:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723733579; cv=none; d=google.com; s=arc-20160816; b=LTcqxN1OA1Rztot/YLWC6xiznQsLb7zNu/f6elkmnH+aGJfo0R7Ieo/6XPXIBZlRVP sdDz796AY4lyr3k1BqpRnBI3N53i0dm5rFGChOK44fiMjaIfhoCrrrpCr5GbB6XRpYTL BbEOr3CwKuQPHKF/dPDZBOOpx7SJD1eSyTZV9n6OYz7JZnuFmYVFnkloxucxTYxSh6g+ jpTg4RQyQPPB636SMmmguQ1a+314m9p12tFDMt41pa/QzvZl0SATZTawaoKsEzpuDaRa 0eBOEIHsWZQxmWOQqejItWx/GnXukWYoW2RKPBWd1ubfsNh7KFhi2SMZuPA2lvWH/USV arUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fGNwWa3S5TX7tw+jVxHwopux+SCGaD9vnHCk/doezEQ=; fh=zpmTh0lFY8Y9gScv4m7Dcr2yTbITQ9nqGHuTTiGY4tw=; b=t6qVcsdeMrIstOf9oDGqIf0Drbq9fCaObaS0QSpFXv9k9WDAFPhNdluDg0FmTQCtbd mVV/c7KO/uX+b/on7IfW6Wx0+QWML14fIVXl/KdppsuMfqYneMe2m4aEqHnT6gM/mxly HHXX9DvFhlxoIuXlBJ5QkVL9+iuvS8UhjJmUBGEIBjLrRSlWpsokYrCIHuZ0hC5mkuup RcRIDJ47K/lK0jLSgd1W71dtzAOU+t5XtnTeFvyPCB8XZhScQBhqO0J6gqRARdHFKPQ5 //NIjoE86vTIePevukZXHhQP5HIR4sIfogqs8kRFu0LanFh/1zjP9LZz24r5/vTV90dC 9tkA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TEradAnQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6bf6fef3872si18968536d6.404.2024.08.15.07.52.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:52:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TEradAnQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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(); }