From patchwork Wed Jan 3 17:33: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: 759613 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6610461wrw; Wed, 3 Jan 2024 09:35:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IFLhKxvaL2b424ltK/VIUcwUfllRkHn5+M+eR0oCVMW2LN8PlpZ+U/vMS8/9i0y/E5+aOX5 X-Received: by 2002:a05:6808:e87:b0:3bb:ebb4:76f2 with SMTP id k7-20020a0568080e8700b003bbebb476f2mr7383415oil.82.1704303349328; Wed, 03 Jan 2024 09:35:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303349; cv=none; d=google.com; s=arc-20160816; b=pCtuDW345j4WTkozLwLEazH4HAv6jSVXAoiQyNhXC3jIWEKP70rLaAYIWnKZZ61eqi 9m6OtIqhUmpYtuGYDblRwHxSUZIv2TkP/zhsATn2AbwVmP14lkUBcYggYMopLDgqECzY SktdbO6fx98bhNLKOLYGtLkCy7KNvZlSeVNo4HQ4NJ8PQFZiCXTEN7HrencxhRVJOqOl hc3IJ8bL63oBv266IujrfpI2h6RY/2AheBDdib3VGJWW2INT+QJcNzwwfea7y0jBAEDR +G08tMcllSII8ED88Ym0L4JHPgbABNpREPDl+CHRmu/A2urrr8ZQRGMsv6V8BZ+LAfXh XZNg== 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=RdsiaowAjsV2VhJV7X+uJO6SS3PjKGOvNs318qpxEnc=; fh=5s6F1VpUg/LkqHSyTlr7gneXArwgJkl0qAfGr3eFpAs=; b=gojeAPfE77ZTTATpXWgFySx0U+v9JkQU7WW9utrkmJq6WAGiqfqHYeVJN/x6lPTKR4 +4EAyL33qAO2CYZFq4EqhTu6iFnzfz0p6YZ2ZWl3wNHLUQjBcPxzePYp1QG3EzKHGPay RioNwLSbhTC8NBMtExDsyRzAjUjQ+TXIudHcGWbFrvoEQnUB3xvMUy4IFaUTMl35PEdd eq0HXUy9gQYc4hOoIxMls4HB3nRp3e2diiCeBVDtFn8pVK+obrzLQnX4Q4vJovaqecxf CveeVpREnMo/dhLHprwgYKEpbWaZ7FpbT1VqggSN4aE1eBhBgkUnNU43/mEdUkMY4jRe bcDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=udnsPMjk; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u7-20020a0cb407000000b0067f931f6bfcsi24389806qve.395.2024.01.03.09.35.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:35:49 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=udnsPMjk; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL589-0003aU-5u; Wed, 03 Jan 2024 12:34:13 -0500 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 1rL57v-0003T4-EI for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:00 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL57o-0002Mt-Tx for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:33:59 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40d3c4bfe45so111700315e9.1 for ; Wed, 03 Jan 2024 09:33:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303230; x=1704908030; 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=RdsiaowAjsV2VhJV7X+uJO6SS3PjKGOvNs318qpxEnc=; b=udnsPMjkO0Ppej4CA5oKCwErxZtFwGWNbCDUKiCKcw/Nyd7V2bEj1fKMM2jGwEphR0 9k+mgiYoZPX7IdQgRgu8S/OmUWG/Of/9xZ+X/0VfRD6WcBjHmKUfl0eYOjWdrWHoWU9P xUcE2ip5hcOVQ9OAWpSUzl9SulsTdMKljx/hadQKx5D5Lp7jkg7AYbC/ZrhOjfq/rCsj +J5kxCJ7TunfMNWdqPvIvokAmmamBGsP6XC+wHKeaXI7fAYmtS5tPWAB93r/ft6bs+kw uqMxxAlNsML2tWnyzey16p//YPxmbOrul9xb8F901i+qWYj5umDRz/Ttr0lotXX3AL85 Q18g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303230; x=1704908030; 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=RdsiaowAjsV2VhJV7X+uJO6SS3PjKGOvNs318qpxEnc=; b=LE0JyDVm+9Y4UQ7sIiwd/prFh5dzy31A5r8t3QdDkPq4kyuNu/yg/6FCjX3hcAHPqN /aF4BZqQVQDIYQd0cg7RWQNr1pewezKD7IENvjzurb92+WLWbZHpYkkUP9ckTzh5zIjN vOCDbChcAi+j9fqMFsoXorKhgZTL+XVKGgXgy9fQjb9HWa/a6JrVOgAfWTNrm2wNkkvy cr54SihFhSW3oN1EGbs5nPzCXUuZrFz3N08OenQHXZ40hv265pSWgMGaGOIotN00TT/q xxbt5yMGAXLIdVF1L7HwS+SI0zU1rX2hd/Aj9v/4Ucqdt6G+dlGh3i/bTxKvy0EKQMoR ievA== X-Gm-Message-State: AOJu0YwHrmS0BPJE1monMQDISMJEsx1xOMj1FvXjaefcN2ilZ/h3A5hM erqTNg6ArSLrgoYf0GnuPpS3LpH5ziyxpA== X-Received: by 2002:a05:600c:491e:b0:40d:5c56:5545 with SMTP id f30-20020a05600c491e00b0040d5c565545mr3022779wmp.298.1704303230107; Wed, 03 Jan 2024 09:33:50 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s7-20020a05600c45c700b0040d8d11bf63sm2903966wmo.41.2024.01.03.09.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:33:49 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6A5105F92D; Wed, 3 Jan 2024 17:33:49 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis Subject: [PATCH v2 01/43] tests/avocado: Add a test for a little-endian microblaze machine Date: Wed, 3 Jan 2024 17:33:07 +0000 Message-Id: <20240103173349.398526-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.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=unavailable 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: Thomas Huth We've already got a test for a big endian microblaze machine, but so far we lack one for a little endian machine. Now that the QEMU advent calendar featured such an image, we can test the little endian mode, too. Signed-off-by: Thomas Huth Message-Id: <20231215161851.71508-1-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/avocado/machine_microblaze.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/avocado/machine_microblaze.py b/tests/avocado/machine_microblaze.py index 8d0efff30d2..807709cd11e 100644 --- a/tests/avocado/machine_microblaze.py +++ b/tests/avocado/machine_microblaze.py @@ -5,6 +5,8 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. +import time +from avocado_qemu import exec_command, exec_command_and_wait_for_pattern from avocado_qemu import QemuSystemTest from avocado_qemu import wait_for_console_pattern from avocado.utils import archive @@ -33,3 +35,27 @@ def test_microblaze_s3adsp1800(self): # The kernel sometimes gets stuck after the "This architecture ..." # message, that's why we don't test for a later string here. This # needs some investigation by a microblaze wizard one day... + + def test_microblazeel_s3adsp1800(self): + """ + :avocado: tags=arch:microblazeel + :avocado: tags=machine:petalogix-s3adsp1800 + """ + + self.require_netdev('user') + tar_url = ('http://www.qemu-advent-calendar.org/2023/download/' + 'day13.tar.gz') + tar_hash = '6623d5fff5f84cfa8f34e286f32eff6a26546f44' + file_path = self.fetch_asset(tar_url, asset_hash=tar_hash) + archive.extract(file_path, self.workdir) + self.vm.set_console() + self.vm.add_args('-kernel', self.workdir + '/day13/xmaton.bin') + self.vm.add_args('-nic', 'user,tftp=' + self.workdir + '/day13/') + self.vm.launch() + wait_for_console_pattern(self, 'QEMU Advent Calendar 2023') + time.sleep(0.1) + exec_command(self, 'root') + time.sleep(0.1) + exec_command_and_wait_for_pattern(self, + 'tftp -g -r xmaton.png 10.0.2.2 ; md5sum xmaton.png', + '821cd3cab8efd16ad6ee5acc3642a8ea') From patchwork Wed Jan 3 17:33: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: 759610 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6610205wrw; Wed, 3 Jan 2024 09:35:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IGn2VjQE2+qGpAf3PyW9S+NbZ4u6jNZLCf+g8CnmiGXfdlJVfMLIAbTksqzYSmF4Ojn0rgj X-Received: by 2002:a05:6214:2345:b0:680:9c2a:6ecd with SMTP id hu5-20020a056214234500b006809c2a6ecdmr10143614qvb.99.1704303311061; Wed, 03 Jan 2024 09:35:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303311; cv=none; d=google.com; s=arc-20160816; b=WMmT1cVKq2QVFuvexxqbb7wqscFUgDi3+Ed3Py26eUIMOPDyI4QRZ+buYbsbQ5oYnz ZdIVGuz7ysLOB8Nb5bKBaJS0R92K6gHhLQYiFQeDrm7sQvAr9uCGA7yFQQILnuCZTqku nzBCX98c5XlMftod1hVL06W8Kli3Penb9/sxkQkzuHaOPepYanNBde8mNv4paVz/NOZN CRoZO8uXdrw5zrwrGuEbxAwhT3D74WX2Oc16+s+ua6hVqOKS8JWUKDigYzrCR65u06SP ucrrS8sByQmn9w9IbhYQD2djC3w+dcOTboWnxl+zD0U84E7uyBfXxwymnLImWWp75V3h bNMQ== 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=qzxoAeOdiga+52AiTCmsWe8ywFNoeoZ5ZVuxsnjrTLU=; fh=5s6F1VpUg/LkqHSyTlr7gneXArwgJkl0qAfGr3eFpAs=; b=NAyGjYfn98/bJu1rUvVLMGcsQMmnUAPIvPPi4aRhTPGOXE837fjkrB7h/U8wF/Zq8h vHigio6zHLr64xE8exmZhhsMii32NWnCzIHblW/6qVkbKkmw2oy6M/JY16m0cdU7ypla v0p2gmA940s0PTwC0YzBBkmXT41Oq8PEEI4CB2X0pYEY9mTrAALLBxOUm0ep1d5ui2DT FdpGudX46P0kGLL/ajImrZFhuKpw8HQWSYVz2n9bHrKdzD9mLwHD4nseMVlMKk/U7sQv Ka3rIQecXj4h07VeIqKDg2X1LzYe/k7K31xnS1TYWu9Fm2nFVnbClMivxrcCR+csaXlN K3vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZLps0+nU; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c13-20020a0ca9cd000000b0067f94720d1bsi16604555qvb.235.2024.01.03.09.35.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:35:11 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZLps0+nU; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58D-0003fx-O3; Wed, 03 Jan 2024 12:34:17 -0500 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 1rL584-0003Wy-G6 for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:09 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL57q-0002Oa-HQ for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:07 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40d3c4bfe45so111700695e9.1 for ; Wed, 03 Jan 2024 09:33:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303233; x=1704908033; 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=qzxoAeOdiga+52AiTCmsWe8ywFNoeoZ5ZVuxsnjrTLU=; b=ZLps0+nU4+JNR/NQZZd/MN36RMkw1RydMXgzftF+ZsmXcXuYRV2G1vmqHuR+flMRUz YZxuq4neTtF+FCgSh3AtmknIrUyrmVH36lZmzTi8A9L3dMVe6ukiEZx9G9Xff1wVqenf 67VBAAQ2TuLv5u81Wih0cRgqvvex8hWVEfsFfE62TkndggnanGtevLTecgfxwImSBkOm IJLJG7ekrS52ekogCYbc7bkLEVTACYhxYe0Ac0v5j7XNdFgXvUmhFRldn4+LnTuInl7z 0Y1BHtsx9DIUGN3nJbbxdnIVZLWEObWwDsGIEZh/gQXqH3TZ6XsAQPjQvXZ9pzfTUPVc FCRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303233; x=1704908033; 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=qzxoAeOdiga+52AiTCmsWe8ywFNoeoZ5ZVuxsnjrTLU=; b=jMIjyEKP5H89qjoqWIZsSzzUJh14PgnfkLbcN3umTAn84fZYuoxgaT9Qs5YEHGQme3 xuJgG8jBE9jzoEvF/WcDY5kFyye2Jm3LmP19338G2b05LqI1EFnEKIPbsjapYlPy1jO1 pklDPhlWTU6vj//kkQ33V+NKMj8qQpFZFa0NGt73aAfCQSluEjJ5cJ8QhEepSwSA3PNf K1O5d8KTKoFtNrEp+/OtyDoYQGT5BsHoevZiIVpQC1JWGPxts1oAxwzSjEyVpaG8W9eb co2rYZ9XFPn37iN8tunKBwBmszJnbseEuQXouN4Qn2mIM+55vbdsMXW+heCb4c9cyaVU acSg== X-Gm-Message-State: AOJu0YytLtxK6cLJ1aqbnoLxLyS07cscqauBZrSpXUtY2H+zNgcmw7cB xBcwRqT8AAieBzAPz9Nr5S8SB/afiO/SKw== X-Received: by 2002:a05:600c:a0b:b0:40d:7da9:8662 with SMTP id z11-20020a05600c0a0b00b0040d7da98662mr2292525wmp.338.1704303233122; Wed, 03 Jan 2024 09:33:53 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t12-20020adfe10c000000b00336f43fa654sm18186652wrz.22.2024.01.03.09.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:33:50 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 7EB765F92F; Wed, 3 Jan 2024 17:33:49 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis Subject: [PATCH v2 02/43] tests/avocado: use snapshot=on in kvm_xen_guest Date: Wed, 3 Jan 2024 17:33:08 +0000 Message-Id: <20240103173349.398526-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.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=unavailable 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 This ensures the rootfs is never permanently changed as we don't need persistence between tests anyway. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- tests/avocado/kvm_xen_guest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/avocado/kvm_xen_guest.py b/tests/avocado/kvm_xen_guest.py index 5391283113e..f8cb458d5db 100644 --- a/tests/avocado/kvm_xen_guest.py +++ b/tests/avocado/kvm_xen_guest.py @@ -59,7 +59,7 @@ def common_vm_setup(self): def run_and_check(self): self.vm.add_args('-kernel', self.kernel_path, '-append', self.kernel_params, - '-drive', f"file={self.rootfs},if=none,format=raw,id=drv0", + '-drive', f"file={self.rootfs},if=none,snapshot=on,format=raw,id=drv0", '-device', 'xen-disk,drive=drv0,vdev=xvda', '-device', 'virtio-net-pci,netdev=unet', '-netdev', 'user,id=unet,hostfwd=:127.0.0.1:0-:22') From patchwork Wed Jan 3 17:33: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: 759617 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6610926wrw; Wed, 3 Jan 2024 09:37:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjxHjigBJ7mLERskZxcQT6nqodQgYod+rYqV2PBQzeCLO1zi+HBAVuYHZh951SjgKOWIYe X-Received: by 2002:a05:6870:ac21:b0:203:f926:5b4c with SMTP id kw33-20020a056870ac2100b00203f9265b4cmr25103061oab.20.1704303421766; Wed, 03 Jan 2024 09:37:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303421; cv=none; d=google.com; s=arc-20160816; b=EyNolxUx67LaDPz80OvpIVFIMQ9h8EF56+6Gb0C3So3accxIqhQe9+kfktV+OSmOrC GT/q2HKNMdGBhkLacLWSjth7rTCbUIHSRtlgPrtxLHIXgWhbBSLKPjvuVxFSL4nfA3DB FYxzr/ELS/TBpou0ZVm23c0CR19LWQcMXFjwMXOSunndGf87/Hx/FOxOIFU5qbgsOdtf 5us+IB9tMi5L1DoMNaeoO9gK7MpqPi/Q4jrElQosMKJnoUlgOJSo/FT7bD+zilQM4Wzy AYU+tRVwo/qJzDCHe650sm8HO68EzW9YETwSP7PTxBSRnVfC8Dpgp1/53H19gVfIYgEq PnbA== 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=Aeln3++ASlFUfIwMVf5xyvW2uMLaZ4UxQn5nypBC6DU=; fh=5s6F1VpUg/LkqHSyTlr7gneXArwgJkl0qAfGr3eFpAs=; b=abfOIuWf99nOZf+RwO6OusS9w6VVSkj4+vFPAn4BFrYfJNkbim1wuyncKWN7ElOgBL E5iYiENlIr/lWEXDxnVRht8Rlcy8VAakKtUTRcZIdnh3vRxd1VE67TpT/jLqAQ+rB6gy 6XwlrA3QusRLA1BeHDW9eQ+dHXyR4GB5FJbywD5agxzPAIFORD+myIZrecyCetTTisep X4hyt3EfPw4vud84Gj1lFnNXRZpjdOsgZ99nwKkgIv6ofI6UGqM/GaWOI5pinel9vFZ9 QBe0oD4lt6Kwl2UqaDWoUce7Xv43TDYkZDR08q/dztZg/Nes1VqTaEKJVPrbtUcqItwX X8Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U4drxGlJ; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y15-20020a05620a25cf00b007818c625e2bsi12589818qko.88.2024.01.03.09.37.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:37:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U4drxGlJ; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL588-0003YD-43; Wed, 03 Jan 2024 12:34:12 -0500 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 1rL57w-0003T6-CH for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:00 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL57p-0002No-PA for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:00 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40d3c4bfe45so111700485e9.1 for ; Wed, 03 Jan 2024 09:33:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303231; x=1704908031; 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=Aeln3++ASlFUfIwMVf5xyvW2uMLaZ4UxQn5nypBC6DU=; b=U4drxGlJ/tkZXc9hvZ3os6xuYTZJF5h49z3k8E2J+jUzucL7Sk9MvZv9AAPAyT7R+9 tT2dswG0KJ2kD4qBWjbtVOmeatZY46+0ij9eWc3imoGgPWsArqLR54wxqnUEMAE4urvM tumWUWjG9SN3lQ6Sd3HzO3IYHQ12M1rWOE1r2/PNCuDww8365ae18SgVchmtYpVYd9n4 c0jE5BIiJw9ScQJlRsZB6mIQeXjkyaWKD4maFnj6FrLlgqjP20+uBlL2krhA7awdHB5b cfusSNoaOqDJ+haTpVpXM90oG5KeIsSySZ8Qh85r4K6WQeuzd5lBNQVu9etTBKgZpc0N RVSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303231; x=1704908031; 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=Aeln3++ASlFUfIwMVf5xyvW2uMLaZ4UxQn5nypBC6DU=; b=K344hPBa9iAcdIZP5RtNhJc3ISkz3dGIEtqkF8v+kODzqRWzaTGKzXjoEOa3BNNULp MyPd0/nCckGhBVgdzQ0JqrmQQbjOtqImiVa3PhGY3cex0GvidfCwpoLjDZa7JS9/alcc d2NHSojmrew8PG4Lgct5HSHWN72JffiGB8QRs6VDr02NDR4sSejoA/Xrd19I7UpwD8nv eXUptj1rP5EVx0+UrpRujFyG38hqfWZYBGQ+Xcc4xZZXBj+vyNOAXUh1jlVKtrdfSs+H nSIkMde1jgnpGskDCqpVz4Jei7f3xTEOgJ3O1J4TxJRLiQ2tPmcTpKpBiKuUPofg434E h0fg== X-Gm-Message-State: AOJu0YwddX65vjK3Wg9rv8rr1CUnu7rBTAzUdYvhpRHnVPX+kfL+Vkr9 gyRRhEXYKqpntxHOckfY5R7AxdwQKT7FRg== X-Received: by 2002:a05:600c:68d7:b0:40d:5941:f16a with SMTP id jd23-20020a05600c68d700b0040d5941f16amr3530996wmb.273.1704303231484; Wed, 03 Jan 2024 09:33:51 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id je2-20020a05600c1f8200b0040d934f48d3sm750166wmb.32.2024.01.03.09.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:33:50 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 93F3B5F932; Wed, 3 Jan 2024 17:33:49 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis Subject: [PATCH v2 03/43] gitlab: include microblazeel in testing Date: Wed, 3 Jan 2024 17:33:09 +0000 Message-Id: <20240103173349.398526-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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=unavailable 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 This reverts aeb5f8f248e (gitlab: build the correct microblaze target) now we actually have a little-endian test in avocado thanks to this years advent calendar. Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth --- .gitlab-ci.d/buildtest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 91663946de4..ef71dfe8665 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -41,7 +41,7 @@ build-system-ubuntu: variables: IMAGE: ubuntu2204 CONFIGURE_ARGS: --enable-docs - TARGETS: alpha-softmmu microblaze-softmmu mips64el-softmmu + TARGETS: alpha-softmmu microblazeel-softmmu mips64el-softmmu MAKE_CHECK_ARGS: check-build check-system-ubuntu: @@ -61,7 +61,7 @@ avocado-system-ubuntu: variables: IMAGE: ubuntu2204 MAKE_CHECK_ARGS: check-avocado - AVOCADO_TAGS: arch:alpha arch:microblaze arch:mips64el + AVOCADO_TAGS: arch:alpha arch:microblazeel arch:mips64el build-system-debian: extends: From patchwork Wed Jan 3 17:33: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: 759622 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6611080wrw; Wed, 3 Jan 2024 09:37:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IFbIG8PwTAVBClCzW4b1pCsP1SNqyXHZ8RoPiojynKLuwZ/W7AfD4nF1kyKixqYhQ/xC+gR X-Received: by 2002:ae9:e404:0:b0:781:e3ce:60bc with SMTP id q4-20020ae9e404000000b00781e3ce60bcmr1855922qkc.33.1704303442050; Wed, 03 Jan 2024 09:37:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303442; cv=none; d=google.com; s=arc-20160816; b=IUBbK+FeqkXhlwto3jneFGVwd7Qbyq81NOfyCq/8dNEyUiRdg2Y3y8nKXycxR26+HT oCpAeqdLT9uoxiJpCYvC69d1UvmV6y3w8JaNzkqO9Vktxf5ag6dkMU8JarUMOe83Ich0 RZ7ZxROYdSI679b+PyStw5E7X5FbCRjjPv+XrOymAsZw/wwVor+8k0u0T+B06xAlfVan 0sYEuhxCad+PwPogcT5HWkWZ27y1bLZF0I9rpurslePJDZAne3Ilj/eh3Kf5BZtSCpgA 8kHxfP9geDtkPUXVu0FUUYMJZkVx5y4i9cAa/4Ug6m8QWjsvxPS+Z6yDxqvy8srhgd0g RFXg== 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=rOpjk5Xc89URXPry+uTcPrYjjlL9ZRbEnDqtNUUFVo4=; fh=5s6F1VpUg/LkqHSyTlr7gneXArwgJkl0qAfGr3eFpAs=; b=wPiFqR6ck0rOnUTz78V9jieaDGuzsMHdV2uy4GfFcvtBt4eLMrSqp7nzWuFDhgfazB z/+69gvG/vphJUctecqKaz9c31udDKi8dm/kzeuP0I/2wDcK5ZpdhNQA2x6Ou1f9i/4h 3aehs5uVZhpex7ozV6aNXnBoV3fkWCbb1e9BWMOR+xOLR8kwe08sMI07C4jokpwsVgnm vApaYW28T71nAvIrDf8iDQbmCNMyFVW1xgVuJOqJrKWQrN/76ywOWk2w9pYoPTUdWHfU //3wyGNYO9Oy848/fFT1crrGhcUExQJ8HySY4ZNxHtfmgv5q21uURSGFVlCKnZ7uEunP DCcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j7R+G2pJ; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m21-20020a05620a24d500b0077f60bceed5si32001934qkn.351.2024.01.03.09.37.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:37:22 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j7R+G2pJ; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58A-0003cz-D1; Wed, 03 Jan 2024 12:34:14 -0500 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 1rL580-0003VI-JR for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:06 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL57p-0002Nz-Ub for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:01 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40d5ac76667so55663305e9.1 for ; Wed, 03 Jan 2024 09:33:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303231; x=1704908031; 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=rOpjk5Xc89URXPry+uTcPrYjjlL9ZRbEnDqtNUUFVo4=; b=j7R+G2pJWTMP9nz9N56OlOSgXJYdnt1QbdmbCheotup826UTwL7TO3/sUqhmPQ6eNG fSrZ2lIHg08wRb+613ubQ47Pu4cy743voWDbKgzXahU4ZSqIeQmMMCZcXoycVf7L8O4g ikIFEzJ5PXzlMSqj24sWKAtO/bX3DmaCKwajVfp5DmdBg7hNmaVzBBoRg+mdMOYH/t5l 7dwz4ECfIlCDFJ0qZP0+ydHpaRQYtqWgjEjWWjVeGy5DmEiJIJp7xJjbVK96yZxFK550 f6aWCJy3NJHYphH7mlDBE/wFKyfb7j/MLfW9B5ufYOliv91lTXo/gwP+Mclm+lPbKOry bNjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303231; x=1704908031; 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=rOpjk5Xc89URXPry+uTcPrYjjlL9ZRbEnDqtNUUFVo4=; b=PX6VmDBOq+q/iVeA9WLPBWZfdbIMQT6BQAHKu1ffgd6gBTOT64kHHuVsQzQACQpkaW hDc2yqE2TPcNrfo1WjnLfE/n0m1ntgbkKPuY6OLfTFlegWNn+ldBmKfWVl0Z/gO7If/5 3NyhfhhMY/WA9NSm6OLGU7eHOUn0jDcVmJB4BP9avcbV5jWfE/DECFTzw4sxwsvDswWz S7EB/vYR13I4UIGF2awqbt//Ze/UeF3kOv1bSwLx8puWvPpIbFinBIbJlZBggK6zFbVq 8yT511Bskqe4/O1Im8tNta0k2kYpxzh2lIsqOBqPMhgV2DPnonakqqT0NOsZeyWxnlVe i1qg== X-Gm-Message-State: AOJu0Yzv0pK3EPnjTGR9idUa8ADVd3rHjwhlw1cWaJFiYbJ6ksmJOpc/ rijm3tHD9GHlE80Jxj+P51cKIqmL3v8kMA== X-Received: by 2002:a05:600c:a003:b0:404:4b6f:d70d with SMTP id jg3-20020a05600ca00300b004044b6fd70dmr11754074wmb.17.1704303231383; Wed, 03 Jan 2024 09:33:51 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id fl27-20020a05600c0b9b00b0040d2dfb10e0sm2979265wmb.11.2024.01.03.09.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:33:50 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id AB9515F933; Wed, 3 Jan 2024 17:33:49 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis Subject: [PATCH v2 04/43] chardev: use bool for fe_is_open Date: Wed, 3 Jan 2024 17:33:10 +0000 Message-Id: <20240103173349.398526-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.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=unavailable 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 The function qemu_chr_fe_init already treats be->fe_open as a bool and if it acts like a bool it should be one. While we are at it make the variable name more descriptive and add kdoc decorations. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20231211145959.93759-1-alex.bennee@linaro.org> --- v2 - rename to fe_is_open at f4bug's request --- include/chardev/char-fe.h | 19 ++++++++++++------- chardev/char-fe.c | 16 ++++++++-------- chardev/char.c | 2 +- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/include/chardev/char-fe.h b/include/chardev/char-fe.h index 0ff6f875116..ecef1828355 100644 --- a/include/chardev/char-fe.h +++ b/include/chardev/char-fe.h @@ -7,8 +7,12 @@ typedef void IOEventHandler(void *opaque, QEMUChrEvent event); typedef int BackendChangeHandler(void *opaque); -/* This is the backend as seen by frontend, the actual backend is - * Chardev */ +/** + * struct CharBackend - back end as seen by front end + * @fe_is_open: the front end is ready for IO + * + * The actual backend is Chardev + */ struct CharBackend { Chardev *chr; IOEventHandler *chr_event; @@ -17,7 +21,7 @@ struct CharBackend { BackendChangeHandler *chr_be_change; void *opaque; int tag; - int fe_open; + bool fe_is_open; }; /** @@ -156,12 +160,13 @@ void qemu_chr_fe_set_echo(CharBackend *be, bool echo); /** * qemu_chr_fe_set_open: + * @be: a CharBackend + * @is_open: the front end open status * - * Set character frontend open status. This is an indication that the - * front end is ready (or not) to begin doing I/O. - * Without associated Chardev, do nothing. + * This is an indication that the front end is ready (or not) to begin + * doing I/O. Without associated Chardev, do nothing. */ -void qemu_chr_fe_set_open(CharBackend *be, int fe_open); +void qemu_chr_fe_set_open(CharBackend *be, bool is_open); /** * qemu_chr_fe_printf: diff --git a/chardev/char-fe.c b/chardev/char-fe.c index 7789f7be9c8..20222a4cad5 100644 --- a/chardev/char-fe.c +++ b/chardev/char-fe.c @@ -211,7 +211,7 @@ bool qemu_chr_fe_init(CharBackend *b, Chardev *s, Error **errp) } } - b->fe_open = false; + b->fe_is_open = false; b->tag = tag; b->chr = s; return true; @@ -257,7 +257,7 @@ void qemu_chr_fe_set_handlers_full(CharBackend *b, bool sync_state) { Chardev *s; - int fe_open; + bool fe_open; s = b->chr; if (!s) { @@ -265,10 +265,10 @@ void qemu_chr_fe_set_handlers_full(CharBackend *b, } if (!opaque && !fd_can_read && !fd_read && !fd_event) { - fe_open = 0; + fe_open = false; remove_fd_in_watch(s); } else { - fe_open = 1; + fe_open = true; } b->chr_can_read = fd_can_read; b->chr_read = fd_read; @@ -336,7 +336,7 @@ void qemu_chr_fe_set_echo(CharBackend *be, bool echo) } } -void qemu_chr_fe_set_open(CharBackend *be, int fe_open) +void qemu_chr_fe_set_open(CharBackend *be, bool is_open) { Chardev *chr = be->chr; @@ -344,12 +344,12 @@ void qemu_chr_fe_set_open(CharBackend *be, int fe_open) return; } - if (be->fe_open == fe_open) { + if (be->fe_is_open == is_open) { return; } - be->fe_open = fe_open; + be->fe_is_open = is_open; if (CHARDEV_GET_CLASS(chr)->chr_set_fe_open) { - CHARDEV_GET_CLASS(chr)->chr_set_fe_open(chr, fe_open); + CHARDEV_GET_CLASS(chr)->chr_set_fe_open(chr, is_open); } } diff --git a/chardev/char.c b/chardev/char.c index 996a024c7a2..0653b112e92 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -750,7 +750,7 @@ static int qmp_query_chardev_foreach(Object *obj, void *data) value->label = g_strdup(chr->label); value->filename = g_strdup(chr->filename); - value->frontend_open = chr->be && chr->be->fe_open; + value->frontend_open = chr->be && chr->be->fe_is_open; QAPI_LIST_PREPEND(*list, value); From patchwork Wed Jan 3 17:33: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: 759612 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6610396wrw; Wed, 3 Jan 2024 09:35:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGAKH9Xr6Qf026ykgjp7ZZYlM1vynRyNt5WwF7wlPnpv6bVOS1M5lP5avjX565VhPjvcaPK X-Received: by 2002:a05:6358:2249:b0:175:1df4:c7d with SMTP id i9-20020a056358224900b001751df40c7dmr8998906rwc.24.1704303340479; Wed, 03 Jan 2024 09:35:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303340; cv=none; d=google.com; s=arc-20160816; b=FJh5DZ7wbyHhRVFy2OjqUonljZMdRGSL1kLVQ+5seATcDshDaPb6TwRdXXPqfUPrKW Q5kQc0SHJF3XW6yD6c2s2SfxUSV6CGo7Ze2zxYSEOzmbMOjgRCyOke1mW2JFJC/Z1zg/ FE08RZB428fiOttYPdD+A22OlgXTnumoQc7Y8I7GjtEwLVq2DI6rtUCjc+o3yziiLff/ 5n3Ve4zCTX1zDShkm6sXHIwx+6fFmycnDmvP+sxiwL8SgLIl684TGxD/rHBEUECrGWxJ 2357HzkdcLt41uVtPOg41/BuOze2mtT+YDNZu0OJy1XB2PsI430huvWCMkqA88kS3OIZ DbxA== 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=1cgT7e6lhcwn0WzM/v6sP8+3M2uDQNBjem+V+EXl+Sc=; fh=vgfOyrYvOwgmYzstDn0/HgLmIVrGMIP63mUycC+6pY8=; b=g+8aL/2y8Rfxby3vAM3fiuHnGeInNzz2IVV9AFEh6eJoepoTOtIFdGm918rZOF/xXj y3nb2XYR0bbXueQWuFOfTvQFYnJgmTmB8GQGJH9jV93qdscD2hl3FLVo+yPOITmvrx5Y 1EIYJRWHe6sW3zY/uC1d5OFwX7Fdd1jKl6t/smWszsEmgWMkKPW2y7gI129sAHBMe+Lz 5SAC99oxMNR61wn6BBpyxHXsT9+tAhylCDXZnSasIlMNcIKyAw9cPaGvMo2MVBuVEHCq V0UoEQGjBk9rrrMcy5aFNo3c1qWdMgkoid6r68Z+lbbADVX8wwI1k+j7GIGibQX3/FP9 4aKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t8zTw1ZB; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ge17-20020a05622a5c9100b0042835002434si2734689qtb.310.2024.01.03.09.35.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:35:40 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t8zTw1ZB; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58B-0003eY-IK; Wed, 03 Jan 2024 12:34:15 -0500 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 1rL586-0003Xh-Cn for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:11 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL57s-0002Ph-O5 for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:10 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40d87ecf579so29154995e9.3 for ; Wed, 03 Jan 2024 09:33:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303234; x=1704908034; 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=1cgT7e6lhcwn0WzM/v6sP8+3M2uDQNBjem+V+EXl+Sc=; b=t8zTw1ZBsXS8uWS7GqilvMx62gMAQ+8G+C37YzNdWczxpbjfn1aYmGOfnfN8rDU8// pqlD7V91/i8WmuzyBr/VlJEmPebH/6KcyA/mF1CS1bMwKft8fQ3rirKF9uUEXVPODbYH L0PWzcHlytY5a8sOz6l79Di1lsTUk7XG9cEPY2SH7d/Eh+XGLUqQZ8tsz3HV6ZwmL4qf dacV7Uk8zBtUOCZKga9pBp55+7eNQ88NNUu/D+I2TQ7RbV0zuq3WSlF8oIf4ew0VeBbT LLAt+U/v6ERGEAuo6sA27SDHCSkzPolfp8iD0q3/dK0kYfCQPHMKVNS0T+nzO1oIMULt H0Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303234; x=1704908034; 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=1cgT7e6lhcwn0WzM/v6sP8+3M2uDQNBjem+V+EXl+Sc=; b=v4qfqhsQNoYN/zYKu82a0C4/zpilt0ak26nga/ethI/o09H8DLNkiouGE7yz94c+M8 tVjiP3wht62+aF0Gh8Nn8/FUjB81wdzAbE0fhOyPOpzTy1vqQ6GNf69cUgMyCWB8oOQ4 v6OBwkY2CIOH48Ymo8bjzeSRfVy7qG/Yq4uaC4EBPVvAhHpRNWpBprHiq5l/txb8VuQR +tGrD5yd5tTiHQ5AaXHGwUVwicqPkd2dYQLDs+82EoROg15HLURTTeFjglEC78EUPGWf WLnP/YDfeRJ2XAsj3VspOoAMYuf5U5qpwqAiTjj4mMnnOyJe/omaMyU0Pb2NMP6Lxzl/ iB1Q== X-Gm-Message-State: AOJu0YwOWWDz//KtayeoBiHD6vvasSByOtqH93WafKI7F68F5tpQ/RYB jg00ryid3DOGNpiQwONYvu0H4QGP2hVaLg== X-Received: by 2002:a7b:cb8d:0:b0:40d:8501:276e with SMTP id m13-20020a7bcb8d000000b0040d8501276emr2069593wmi.130.1704303234402; Wed, 03 Jan 2024 09:33:54 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id g18-20020a05600c311200b0040d85a1fad9sm2964211wmo.46.2024.01.03.09.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:33:53 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id C17AE5F936; Wed, 3 Jan 2024 17:33:49 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 05/43] qtest: bump min meson timeout to 60 seconds Date: Wed, 3 Jan 2024 17:33:11 +0000 Message-Id: <20240103173349.398526-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.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=unavailable 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: Daniel P. Berrangé Even some of the relatively fast qtests can sometimes hit the 30 second timeout in GitLab CI under high parallelism/load conditions. Bump the min to 60 seconds to give a higher margin for reliability. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrangé Message-ID: <20230717182859.707658-2-berrange@redhat.com> Signed-off-by: Thomas Huth Message-Id: <20231215070357.10888-2-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/qtest/meson.build | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 47dabf91d04..366872ed57b 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -1,12 +1,7 @@ slow_qtests = { - 'ahci-test' : 60, 'bios-tables-test' : 120, - 'boot-serial-test' : 60, 'migration-test' : 150, 'npcm7xx_pwm-test': 150, - 'prom-env-test' : 60, - 'pxe-test' : 60, - 'qos-test' : 60, 'qom-test' : 300, 'test-hmp' : 120, } @@ -383,8 +378,8 @@ foreach dir : target_dirs env: qtest_env, args: ['--tap', '-k'], protocol: 'tap', - timeout: slow_qtests.get(test, 30), - priority: slow_qtests.get(test, 30), + timeout: slow_qtests.get(test, 60), + priority: slow_qtests.get(test, 60), suite: ['qtest', 'qtest-' + target_base]) endforeach endforeach From patchwork Wed Jan 3 17:33:12 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: 759629 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6611379wrw; Wed, 3 Jan 2024 09:38:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IEncrXcZx7823p6ohWoSMMLwEnybxjjn1u+9XMJUp2L0PKcJUFAS6P8yogf3pCC5C2nE//E X-Received: by 2002:a05:6214:491:b0:680:c083:7cf0 with SMTP id pt17-20020a056214049100b00680c0837cf0mr3727528qvb.121.1704303485445; Wed, 03 Jan 2024 09:38:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303485; cv=none; d=google.com; s=arc-20160816; b=KZJ3lZQufQcYPXfA1d3R49G/TdmK5f/3DVW2q3f3ItcoXtBqiRk9R4gfc+fuo9DbP5 sPbzpvKvufjCGVui8bHNQcGOfoCm0/ZsXgfvWGMKg3g4ig3SkBuzMWo7bxRmXYV9fXok kZiyuDYgVA0S57fP0D9EyneFmFDt6s3FaUced0RUmCFZ2DFdROJaVo7ykbpaJhqWtkRS rvnrkfd2Wa4UUYZVRTn+PY6w5wzrLRzgyzHCGhucH77kJF+oqO+noFYMpTIyLP/kNrpX ZXWbQ3I+iF9Ga2JHrKpYN9L5KYIvYLSy6P+udTdkuK1SmRukYRMpRaoWLujSELa7jcjm FHwg== 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=W+Zw2YkajEPYChe7VczIaT3yCibcEp4TlrDptH8Gvrw=; fh=vgfOyrYvOwgmYzstDn0/HgLmIVrGMIP63mUycC+6pY8=; b=U5HKwjg+rFVVNOE6ZjHjtG6uhTaKbj3t7okflxBKM7ySw23DNBaxkDaJUHeYnDSFgt wX1HV/ltjWVQ+4rfw/uut8WUqcImpuL512r388sr7li1XIBuZgRD/L2zq265itc6rgX0 UP3W2bcL8HXQogvoRytZR7mZHsvJaEMRAXyW3fpoDnAgq2EYY57jEcvL1jaUPA+SWAMF 5RI4T0qWei18FQj+DX0D4jXvsM88bCtAEFOZy2NuKIqza7aLE2K29kbv9cwmsWomp4Yk hennHdPi3Byi5RPDwQQhZWifY4HlnhDtzQoPCe7w+WMwA0NtL4lF0YFGoF7PeSHGhSNK /IqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OFH4IgoA; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m19-20020a05620a291300b007816c8b03a1si15963493qkp.744.2024.01.03.09.38.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:38:05 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OFH4IgoA; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58G-0003j8-C5; Wed, 03 Jan 2024 12:34:20 -0500 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 1rL584-0003XG-Hz for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:09 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL57r-0002PX-Gu for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:07 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40d894764e7so25059375e9.1 for ; Wed, 03 Jan 2024 09:33:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303234; x=1704908034; 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=W+Zw2YkajEPYChe7VczIaT3yCibcEp4TlrDptH8Gvrw=; b=OFH4IgoAjq1Akam95na2SHI3Py5H7YvNiL7C4E+d0vlv+nPiWU6WVjZAli1XkcxW1L IdEHbsvF6VSZRqcukvhoLZUILrfXSJMfFwnJIDHWklrItG6o2TuNxYX+3H97qWDnky5O DjOoKhu2GNbKzObhAcyC2gHf7JCcDohhDGnuPkre/nZyMj2IQd88Oj3kOG33/mICbmIO t0MY6xXRm6Ksj7UIqWv4BTuKna5S9Lo23XIuDR8qn0o6Pj8ibc0JjtfnjRMeYkPdKIUP ifbjOi05F5eArD7UVT7V8YVRLtONVGrYAi/4dluUrbq8dbNzxTjay5SeaTpK6W6NssGc SDsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303234; x=1704908034; 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=W+Zw2YkajEPYChe7VczIaT3yCibcEp4TlrDptH8Gvrw=; b=T7dUmRjoA3IW/PSkJkFithcZbNJ/1V9o05fO4oaCsZI5mtK2j9+zmWUW2OdR96LbR6 f65GdVNaquXPtZBcTsMd0OQnsDDO3WnpNm+/87oYJ1zZXf2kQvvpoWPgmvKfE9g2x1oR J3qhR9C037t6/jQ2y0F745gDG8ZTyBxZ2WQ6irCHXPtbf8af8JN+IC54XlGLe0WEWfXe DUndA4WY0NXCwjyukoJndb/neoyGFc6bZLv+OD+z3xBvShn+6WdewCS83CIjZgWRRCec nFRVLRV5xNk2J+oULWgd//FiEsYRSLUUq0GQ0GCwN8B+cGoZ98UWfWIXs276ozjHKwOU SKbA== X-Gm-Message-State: AOJu0Yx50X4YrATZUjBZTmclwa++cl6YUzXQwyo6tG/GlvJCxnazJrGj wnibeRY75pVW8EfzNa3YAdRTyluRjIQ7bA== X-Received: by 2002:a05:600c:511e:b0:40b:3e23:f0a0 with SMTP id o30-20020a05600c511e00b0040b3e23f0a0mr6942090wms.4.1704303234129; Wed, 03 Jan 2024 09:33:54 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id h15-20020a05600c350f00b0040d8810efc9sm2942787wmq.17.2024.01.03.09.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:33:53 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D8B9B5F93B; Wed, 3 Jan 2024 17:33:49 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 06/43] qtest: bump migration-test timeout to 8 minutes Date: Wed, 3 Jan 2024 17:33:12 +0000 Message-Id: <20240103173349.398526-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.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: Daniel P. Berrangé The migration test should take between 1 min 30 and 2 mins on reasonably modern hardware. The test is not especially compute bound, rather its running time is dominated by the guest RAM size relative to the bandwidth cap, which forces each iteration to take at least 30 seconds. None the less under high load conditions with multiple QEMU processes spawned and competing with other parallel tests, the worst case running time might be somewhat extended. Bumping the timeout to 8 minutes gives us good headroom, while still catching stuck tests relatively quickly. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrangé Message-ID: <20230717182859.707658-3-berrange@redhat.com> [thuth: Bump timeout to 8 minutes to make it work on very loaded systems, too] Signed-off-by: Thomas Huth Message-Id: <20231215070357.10888-3-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/qtest/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 366872ed57b..f184d051cfe 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -1,6 +1,6 @@ slow_qtests = { 'bios-tables-test' : 120, - 'migration-test' : 150, + 'migration-test' : 480, 'npcm7xx_pwm-test': 150, 'qom-test' : 300, 'test-hmp' : 120, From patchwork Wed Jan 3 17:33:13 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: 759623 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6611121wrw; Wed, 3 Jan 2024 09:37:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEpnwX6SHIITqUsgyiskvVtLHgB2fFSQ21Bjm0oA7nBGpbAkFdpTcMnUnCEvHj33503XALW X-Received: by 2002:a05:620a:cca:b0:781:587a:dd79 with SMTP id b10-20020a05620a0cca00b00781587add79mr1803163qkj.30.1704303446565; Wed, 03 Jan 2024 09:37:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303446; cv=none; d=google.com; s=arc-20160816; b=DVJgnBxWgCooSE72Fo8+UwcHyeum+OaO+nZ4sFzwZ/jACnc8JWKiT+ogSEj3qVkMov TSy0Bo5j+4EcApNThrGb4HGbDz5RSIBOVqOXkHNCHhsRtbRutCN/2gmLDCFBomHBVdMF EeLaDaMeszgctk6V2QIlMgr4Hy0O7nMKOFkSWAdaIkTjycGZYeuf9DTAwIyvnd/CD1n1 j9IxN08FYwhHJMLGuRscA5GtZDfYqXwi2CpMIuUL9lJLJ0YQ+h0YdaMmUUdk9JE65Rxg B5MmP0TITjHCbMKZNMdtWfdAwkt7iau+Ob7vjaWJIlppTwzjHNBzsswVcbKiqqX/+JYX zMag== 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=0SGlJ3OP3ZQJqIGzbf9sUE9qzVbTUWx7/uZllqYVPY0=; fh=vgfOyrYvOwgmYzstDn0/HgLmIVrGMIP63mUycC+6pY8=; b=llHOYyY23YVt0pVFvkTSEqEFmxbHhnD9MgneKVHTOZuM5DAi/ZdC3YWX26lB2Wcg13 y73hMtG5A8uaktU3f/pKgidtOr+wvw3vJ+/15VZuIgAMg09jkn5AqXpwrNH+yXaLp5uR sziHMiXqMmmCfTLr1fcPoHXwVyzKbTp0d5w6JfcuVdSEFw3rAdVcBcB16yETXD0rAwsT 3vqyTJvL3bN6MUk6WdB5LsdnEpKUfErJGHtjKpLV6UuVdZQ2jVr7eWT0Y1WGBla3bifd 3pEzMD+8eWwnPRAhlE2Qo9823/bNAWdh3/gzjfTnsa2iHtnJUTcby4cLxXwv7HgvIcWl 9+Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sEzWDJ1D; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m13-20020a05620a214d00b007819b6ce48fsi10851618qkm.516.2024.01.03.09.37.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:37:26 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sEzWDJ1D; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58G-0003iv-8s; Wed, 03 Jan 2024 12:34:20 -0500 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 1rL58C-0003fM-8L for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:16 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL57u-0002Qc-0c for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:15 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40d894764e7so25059675e9.1 for ; Wed, 03 Jan 2024 09:33:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303236; x=1704908036; 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=0SGlJ3OP3ZQJqIGzbf9sUE9qzVbTUWx7/uZllqYVPY0=; b=sEzWDJ1D7AIzGZiiY5WIZ82E/huCLNqr7v042FFviiJ576Y0/aXRjZIapeKMFN3/kZ GV5kUKEyM6MQ3P9mN2uq7RNSe4slOg/gobbobfHf6gd4AZj7qhuD8x7IyT+qUjcX5fYp iLIjIu2lL40DvbbyCncV6G4sH7XPosSQS9je6coL96wuIRksCVxCmFp6VdQ6QZ0DPmDZ qHGppcxKJ3OkmQS8HSQzbE7G5K82FUNWuCdeijVAPTW1DUoGhpth6SHRoW9/741PFLH2 qHi7Hqp8bG6+MKvdFnTRekc2BM343s24S4wcKOKoRw+rQE+Ex5kcOBg9Fat1H6w4MY2v lfIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303236; x=1704908036; 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=0SGlJ3OP3ZQJqIGzbf9sUE9qzVbTUWx7/uZllqYVPY0=; b=BJzsppQ1mqscfThGql+a6AiYPkjysLKoqGoOMjjk9cxNcrLQWD0t0XSD1DW+5pvi2K EwwCQroEHNjuUD1cJOowXa6B8E5RLk4yrcIJBey1yJJEM6IOrJFee8SMhIoE61MpnnGr uC4bZlMazeFO45v7JT/+nJYDHPp8ntCT0QJ5RwDBiAXSvEMvC/aZUSi57HxMm3OJFbSY bf2mbN+RzOh9eP5Z2QjU64iXVASTQvdwSBVQJBQnpT22jJ0pIH4JZ3HKGq91+8JPBEtb fQrL6mFrXa7gel+RGsjcaJi9ZFzSkcNUiuMf794F9eF36t6OZWLU4Ae2RsMSQ7upSrSG qWYQ== X-Gm-Message-State: AOJu0YwyTc2q895OaEyNMdh9QQY4eZj+2w9pSqbliINsLlKqL1Qnz/Y+ XHr1hFf63ENeoOPYG5XZIZgxIld/TE9jpA== X-Received: by 2002:a05:600c:4e94:b0:40d:5f50:1268 with SMTP id f20-20020a05600c4e9400b0040d5f501268mr3399125wmq.230.1704303236202; Wed, 03 Jan 2024 09:33:56 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id r10-20020adfce8a000000b00336781490dcsm31126317wrn.69.2024.01.03.09.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:33:53 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id EF0895F93C; Wed, 3 Jan 2024 17:33:49 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 07/43] qtest: bump qom-test timeout to 15 minutes Date: Wed, 3 Jan 2024 17:33:13 +0000 Message-Id: <20240103173349.398526-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.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=unavailable 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: Daniel P. Berrangé The qom-test is periodically hitting the 5 minute timeout when running on the aarch64 emulator under GitLab CI. With an --enable-debug build it can take over 10 minutes for arm/aarch64 targets. Setting timeout to 15 minutes gives enough headroom to hopefully make it reliable. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrangé Message-ID: <20230717182859.707658-4-berrange@redhat.com> Signed-off-by: Thomas Huth Message-Id: <20231215070357.10888-4-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/qtest/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index f184d051cfe..000ac54b7d6 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -2,7 +2,7 @@ slow_qtests = { 'bios-tables-test' : 120, 'migration-test' : 480, 'npcm7xx_pwm-test': 150, - 'qom-test' : 300, + 'qom-test' : 900, 'test-hmp' : 120, } From patchwork Wed Jan 3 17:33:14 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: 759624 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6611198wrw; Wed, 3 Jan 2024 09:37:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjNokKAB4W8i+a4JwqdkCNngzcPPGUAJQnGqMSoEPqAbIKwSn9Eu54CFhYeBqccMg2I2PE X-Received: by 2002:a05:622a:590:b0:427:9fad:896f with SMTP id c16-20020a05622a059000b004279fad896fmr24720880qtb.54.1704303458080; Wed, 03 Jan 2024 09:37:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303458; cv=none; d=google.com; s=arc-20160816; b=eTKwx4Zz2AbImCzXuGZ+rHJH4RFFqDh6nUJnW6rVe0O8/vtosQ5IkNSX9NuiFrj7On xt29hBwLOauEB6MMoXAsv+7j8vgp/iRCxARbTbQkiYxX+4QkEX0wUuZ/llBZTCYbLEXl 1Y+ptiosBaKBO6RF7gNYfKbGeas5qOz0eIzn53AaO3hGbpRZVnu2weEctFjVNVawPVU/ jHborSypXbU5f1oFBYDIWX72mZzaD1gDKQm9YCwOknEhpbS3MSfdAXcPxFpnX2YTw0ti dPXN8ucpjzBSMkjT/Obs+leaCI2roX5cm/L8yPj6BAtAFadRjGOXi3J2IGfCwhONw5K3 82OA== 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=CaH8a0Z2sktOk6HhcvLcaTrwfzviKqp7ItoU8rNpnow=; fh=vgfOyrYvOwgmYzstDn0/HgLmIVrGMIP63mUycC+6pY8=; b=xh09mluQY5Pyrd4ZDF6GL/4L8vd8n4uQ+KMyH7aAveb21DmdSimShhD3lym/vGebGb RgBeaqXWk5Y3y2XCwA9bQFMLam11v4AthglOiUDnwB0Yf1EQEDfaNwfZKvg5fr3YmVHV l0VJyHTbJgpSQYEFimgZTbMa9sZqarLj0fq5ACOuQWUelo+Rk3xmtFF9deFTg4c+A1N7 pUuYhE3e0Xvh7aNrZKifC/uwD/cykIsxqlrmrhKbiO0/OiaHRvpWbRmgUkKQJER7uXGZ HfTg9A5zXZ6haiMDX6NH2LLaXImdlQT3yH/Szw0zJN4qJt/98gMHQuFX0sB8kjVuagG/ xNAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jA6Y2Tnk; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e8-20020a05622a110800b0042813e82b17si9287954qty.228.2024.01.03.09.37.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:37:38 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jA6Y2Tnk; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58I-0003mO-BD; Wed, 03 Jan 2024 12:34:22 -0500 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 1rL58C-0003gB-Un for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:17 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL57u-0002Qx-0n for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:16 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40d4a222818so4368055e9.0 for ; Wed, 03 Jan 2024 09:33:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303236; x=1704908036; 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=CaH8a0Z2sktOk6HhcvLcaTrwfzviKqp7ItoU8rNpnow=; b=jA6Y2TnkLacMTixdvYD46K8ZXXE4RdI2s1dBOfpWJhP+MxzvKS77b2DCFVllxqJrj1 wYbQU5ZUxJvb8+utuMoPR3zw9He2rcAOcnvzIXO3U9oHOqyFKMu0s1fsZijw5GKYR4BS 3wY/n/3WJTymVL8hQ27Yjyc+elZNKVEBdX2Giyu1eRbI+LqtV9wpS8mkAbhFpwVXgK4F YiwkDNeNgmOjdzl0FBpoTo5TgcGA4Fd2rgmbvbeXHFBBDOUTphhqU+cmFkpy9LFb/Koo 4UZUolD1Niyz3yHgAmlXqjUqgOcP5owoTv2YDb6UdbwwEXDU03/RYwTsCunVEeLl0fSt pNiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303236; x=1704908036; 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=CaH8a0Z2sktOk6HhcvLcaTrwfzviKqp7ItoU8rNpnow=; b=kNnfTzAn7vErHKDV7mFLMPqP1iGMK0WHdyKZxf/ErT+hbVeU5NS115RqUeRuK+CKiO Wt3lNGGZNua7T0yTfI92k/3oRMRx4jS1Oh5n+FAYp6e3S+GvuVAabtnLcE9vPAAB/AJJ Iqz/gC0wJzw8zqUfo1crZcNrDZp++T3b1yPgcNb3/cECfeGcYqWxyR2JVieEb3QjsVwk I9V+e6GscaHDK/X8lh2MbQYN+dyyJdSP4GbkhlrQjJckmsV/id3XABDE+syncIZcIuor IpgwtFiAe3tMhVUDsda5inqvnwk0IuzTPmTYg+ZeVEBNcS6nvE3uhff81TaPPeirjPxv 8K2w== X-Gm-Message-State: AOJu0Ywxb8YPYYjMV6NBgxbhEPTPpikeCWcZlM6h/bXgm65F5EX3V70q c3SIHWCze6cEq1u3+M+U36RDdQTjVT0h9A== X-Received: by 2002:a7b:c406:0:b0:40d:77d3:8db8 with SMTP id k6-20020a7bc406000000b0040d77d38db8mr778947wmi.44.1704303236439; Wed, 03 Jan 2024 09:33:56 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id bg35-20020a05600c3ca300b0040d6ffae526sm2963001wmb.39.2024.01.03.09.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:33:53 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 1199A5F93E; Wed, 3 Jan 2024 17:33:50 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 08/43] qtest: bump npcm7xx_pwn-test timeout to 5 minutes Date: Wed, 3 Jan 2024 17:33:14 +0000 Message-Id: <20240103173349.398526-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.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=unavailable 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: Daniel P. Berrangé The npcm7xx_pwn-test takes 3 & 1/2 minutes in a --enable-debug build. Bumping to 5 minutes will give more headroom. Signed-off-by: Daniel P. Berrangé Reviewed-by: Thomas Huth Message-ID: <20230717182859.707658-5-berrange@redhat.com> Signed-off-by: Thomas Huth Message-Id: <20231215070357.10888-5-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/qtest/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 000ac54b7d6..84cec0a847d 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -1,7 +1,7 @@ slow_qtests = { 'bios-tables-test' : 120, 'migration-test' : 480, - 'npcm7xx_pwm-test': 150, + 'npcm7xx_pwm-test': 300, 'qom-test' : 900, 'test-hmp' : 120, } From patchwork Wed Jan 3 17:33:15 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: 759630 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6611528wrw; Wed, 3 Jan 2024 09:38:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IE9uFhsu7CwfYuZqxHe1RB7hV3SfpCUez+TJouB2mFz7JkzfNTBDwzy7uchko6Y4YT9xWGr X-Received: by 2002:a05:6214:21a8:b0:67f:89c6:27da with SMTP id t8-20020a05621421a800b0067f89c627damr28135518qvc.46.1704303506937; Wed, 03 Jan 2024 09:38:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303506; cv=none; d=google.com; s=arc-20160816; b=gpG0ZwrCXnnq4KASTtmyt3+bWKEtPgEEsZaIceKJ9+cg8l+Ya3C9NIsLXzwTTBnNU8 VlWyOTYoqF8clspXlYMLUa0yy26MVlQz3AO8UroE0GzzIC/a2kr3MkZWn24gSGGy0U83 lQlBRxSr/YMr8eEyvJUzXi36k++e+WuTKx7SOpzuAJW/5N5NoflPIgCZLdZa9+uKDB6U sn66xG1VCAUYpvWKaNAMEjJ458Ni7Mx6JNmT1PYxNO9C8pYFABz4GiR6OXKmSFuG7U3O wGZzzRUjcESlE1AxjF59RC/xO7nJBFw0lkwMF8quJe6MyQ7dKBjjafr+zc1nHMikwx6l 4p9Q== 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=c7IelmqBfCUiQPJ1PO4YXHkz0msSivdOvYJRQon3tbw=; fh=vgfOyrYvOwgmYzstDn0/HgLmIVrGMIP63mUycC+6pY8=; b=sr2aupB96U3srtxeuxqmRyLhjozCMU/KrR/JSVJbHRyUkl3JVvmsF6HBy0QGKSN05i WMfFj8QMoOP6irrjNBpdLPTSRu06GdpCDEXWnjaf3A8elnu2RWYq7jzEVSuNnJmeBVCT 99A0z2ucGuYLANuKXOgl2bGGTn9OvQio7Dn6DzQ21fIe98YYkstWypJAhIBH+R5aZHrm 2+9ieH4+ayAWn4cvnVJKfmky7/94vZCxVso4a4Ky4cM1QvCfEFY6qc4a2hhwRfTXz/U5 0p7PmObDNctoccQuvKiwJWJ4qrKGATeFTyaoXoXk7nxGcBP6E1jhc3/SkRguJvX15jeY pO9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t4Y4nIOG; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id de11-20020a05620a370b00b00775a6554b41si30654667qkb.285.2024.01.03.09.38.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:38:26 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t4Y4nIOG; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58I-0003lw-0t; Wed, 03 Jan 2024 12:34:22 -0500 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 1rL58E-0003h1-8w for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:18 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL57u-0002S8-VG for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:17 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-336c9acec03so6529495f8f.2 for ; Wed, 03 Jan 2024 09:33:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303237; x=1704908037; 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=c7IelmqBfCUiQPJ1PO4YXHkz0msSivdOvYJRQon3tbw=; b=t4Y4nIOG4CT6X5md/eVUBpLUW4iRQq8yZYS3P2LnXVv79rByvLf4Inc4gNPIczvyf7 GwP265SuaTRrB+N5MZ+Fav7H2l+IxbDtcTXJpG4XRjssy/dpWWX/8Lod/6s2BYvy5Z3q 3lYE7mYDjpVTqLbAxNyZtSxYzTBHFttDQ625sndS5LLORMBGedIZxL1KMusV0HEwmnAw elQkZEm8VxBFjXWPEjWAyNouz7NDDPlPWMXeC3CSrkA3yZPySdCOi0B3GmJY6EYNqcJp ZL/4AyoPsjM6/zUQgL4ynrWdUbAbLGXAWTByZkjzf9wg88Q/4eQVEyIsL/tFzJ14iV4u TVgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303237; x=1704908037; 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=c7IelmqBfCUiQPJ1PO4YXHkz0msSivdOvYJRQon3tbw=; b=utDJi9fKarVumNbTCJXRYXhbtbQ1GX3scb1J9mUYJpr+mJIagJqnIAP7udJtvas5Ry WFxN6bGQd/05FwPLxUqakSDYFRrcJyJjSoZclxUQXu0FlsGyPs/e5pri5ZXSr5ZF1pt9 sz3Xy/Td4GXu1mbxVD8GLEG9p4u6r4FEgirE4OibjcTkL6y2XRew+HRw+kf3s7ZsNafO fMtjZ8Gchg3fY6xWJ+ZRXMfza3U/kEMeHNwk5XC7NW54YJ5Og0TMpYprRNF8Jf91ABqZ YF09tBZrnwmuc7ZiqsGDGEK27xN29/6YjmWaUnOE3y/3gBdHpPl2oX2wlV7hqWYrwg/L ZQ0Q== X-Gm-Message-State: AOJu0YzecGJYVggccbrcsG2OcE49ygLBNyBifRoVcqiQb1ii/KsAlzIo ae4yQDHmlok+C2E+8u3z1AK8I4PVTiDF+g== X-Received: by 2002:adf:e8c2:0:b0:337:5131:4d71 with SMTP id k2-20020adfe8c2000000b0033751314d71mr1857wrn.40.1704303237615; Wed, 03 Jan 2024 09:33:57 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t18-20020a5d4612000000b003367bb8898dsm31262714wrq.66.2024.01.03.09.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:33:54 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 26B495F93F; Wed, 3 Jan 2024 17:33:50 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 09/43] qtest: bump test-hmp timeout to 4 minutes Date: Wed, 3 Jan 2024 17:33:15 +0000 Message-Id: <20240103173349.398526-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x432.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=unavailable 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: Daniel P. Berrangé The hmp test takes just under 3 minutes in a --enable-debug build. Bumping to 4 minutes will give more headroom. Signed-off-by: Daniel P. Berrangé Reviewed-by: Thomas Huth Message-ID: <20230717182859.707658-6-berrange@redhat.com> [thuth: fix copy-n-paste error in the description] Signed-off-by: Thomas Huth Message-Id: <20231215070357.10888-6-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/qtest/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 84cec0a847d..7a4160df046 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -3,7 +3,7 @@ slow_qtests = { 'migration-test' : 480, 'npcm7xx_pwm-test': 300, 'qom-test' : 900, - 'test-hmp' : 120, + 'test-hmp' : 240, } qtests_generic = [ From patchwork Wed Jan 3 17:33:16 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: 759631 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6611684wrw; Wed, 3 Jan 2024 09:38:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHiF4ZdVEHQ2CAkDv2hCSvlpKiB4FviG9pLO6ulTLo1POvGEhImcO6FMyYpxYhOvsFZaaYo X-Received: by 2002:a05:6214:2345:b0:680:9c2a:6ecd with SMTP id hu5-20020a056214234500b006809c2a6ecdmr10147912qvb.99.1704303528004; Wed, 03 Jan 2024 09:38:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303527; cv=none; d=google.com; s=arc-20160816; b=tHteaTGVjYhEAb+xlmP2LDZ0kTk+C+Or147yCV6DuWtf9b6YWhxhKw7wFA8rUuCTfO lzVD6W636Glwo9f+MKETas8Os/Y9Dikfdq/TeG9djWKQxzGUA6H/vI057aZlu0/HpzTm r6ugUKq443P+gEPYEGYFO6jxztXCOzSEipE63Ti0jgTfQY+TJZe4GB4yszCEgxZ1CSil um1n+YRmUXzxnh+y5X2gs1RbM/Z8KXWFsosSsXZcDy7Zz0/aCw0iGFjGDxTbowjVrFqG IupdPjbzumNQBLZjB/+tvn1bUvuUoYhH9whjPqc/YVZ+g3gCII/SFnQeF9FoB4IhP5GP sq7A== 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=KQu3dEC4bAAkAiF4vI+JksTKEdmVPQCRZYwFmghpZj8=; fh=vgfOyrYvOwgmYzstDn0/HgLmIVrGMIP63mUycC+6pY8=; b=yTfhMHTU5jAOccqXj1fz7OTOA4CKJ+nRbW+kd3iV9RW8TmXrOO05da8c0rLmKQryZj 34twAPOuF/rqTGuLv21XsMSunTfNjErh0Ll2LPCMU6SLecEJ2Iz0yfWww9Ha9eoIthXi SjKI+9Igzv33Xzy4Bv6nzV8E+Apl2y/NIYwR/Ncchj1y7sVbv6OEKPb0XlbFKzxZh3l4 0MK/RwfB7mdN+nrPuybbatO2B8DVetIcAPmBuwdZghz4z6kS3IbJuuv7RKZY5C8Du0ri KKNt+mXwWvoEfeeftK8JUxNu5JQ4SzKqa72XnBqAzD4w/XuST2Y6uOfmYp/U9o8+FkCV B8KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GKCNt6py; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e11-20020a0cf34b000000b0067ef4df6098si28940636qvm.127.2024.01.03.09.38.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:38:47 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GKCNt6py; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58K-0003qH-Ua; Wed, 03 Jan 2024 12:34:24 -0500 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 1rL58I-0003mT-8s for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:22 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL57z-0002T9-0W for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:21 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3368d1c7b23so9280287f8f.0 for ; Wed, 03 Jan 2024 09:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303239; x=1704908039; 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=KQu3dEC4bAAkAiF4vI+JksTKEdmVPQCRZYwFmghpZj8=; b=GKCNt6pyYd5wN7PxyfxpueM2/VJ0Vu34VBAa3MNKUABjv/ZZtKbZVYcxOcbUT/BdD3 +MjaSeGcFMOXd1bgur4vaUqj8Kn3cSGeFAW+wXzd2Lh2PNjoR6nweXMHkEr0w1+ffBbb wKmAFEw1l16QZ3RQhUu30C0lNx8lg9P8kucZpehoOwqDbJPrhe2Dmdslt2BxVmqacocZ ZQKOJVHX5vKywvdDvo7mqA9Gl+yywytDMfxkEDzcMBS1t/rW+AdHQracy7YNgeAJh9CZ IZkfjhQbxNyXiaizE6EbeYMuFBUO10C/tAOGM7coS4PR4f6KLYs7RYJoPAGaIfTQj/BZ rGkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303239; x=1704908039; 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=KQu3dEC4bAAkAiF4vI+JksTKEdmVPQCRZYwFmghpZj8=; b=AFUd4skiesKs9iQiSfoxrV5QmB2bsL9sARqyOblEi3jyran5d0Ck9xZWvfFKv4M7Le Md7v4G+jE2tN5VsJ6iretMXjBBEDBecTl5qJAUp3HU1xaD5lzPy5+X+qRwRPYCJsvFxS GIqOAlaZxba8Gidkasay5orq107QgdKeupmphU3qJX+vPUVafgke6Ixq6/ZLhr7JqMdF H7HqWmPxxUPe1cjurPKYisNiS0dJIY7LaF5a5pLAZVC5FiwCaW47BgIgq/3kT/ida+gN RFBLpaMKsLS/q9LtuC0dhlZ7HCLWQH5P0Q1mYpueMHrYQhBiGuP6uuFB4IJgXAmsEizl i3Ag== X-Gm-Message-State: AOJu0YyxJHewVp/nzv8jiyrBo/wUmmaKAji++uKjlrivLM+OugJycfbp EfecsTNVKjPNSw5X+2H2kR+FMntIemsa6g== X-Received: by 2002:a05:6000:1369:b0:336:6e22:672e with SMTP id q9-20020a056000136900b003366e22672emr8708289wrz.38.1704303239019; Wed, 03 Jan 2024 09:33:59 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id b7-20020adfe307000000b0033674734a58sm15715029wrj.79.2024.01.03.09.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:33:56 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 3CB4D5F92D; Wed, 3 Jan 2024 17:33:50 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 10/43] qtest: bump pxe-test timeout to 10 minutes Date: Wed, 3 Jan 2024 17:33:16 +0000 Message-Id: <20240103173349.398526-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.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=unavailable 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: Daniel P. Berrangé The pxe-test uses the boot_sector_test() function, and that already uses a timeout of 600 seconds. So adjust the timeout on the meson side accordingly. Signed-off-by: Daniel P. Berrangé [thuth: Bump timeout to 600s and adjust commit description] Signed-off-by: Thomas Huth Message-Id: <20231215070357.10888-7-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/qtest/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 7a4160df046..ec93d5a384f 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -4,6 +4,7 @@ slow_qtests = { 'npcm7xx_pwm-test': 300, 'qom-test' : 900, 'test-hmp' : 240, + 'pxe-test': 600, } qtests_generic = [ From patchwork Wed Jan 3 17:33:17 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: 759626 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6611297wrw; Wed, 3 Jan 2024 09:37:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IE6ZbWQJRZwx71fTJIaOUMw3vwzxt/q6Aae8wY1c/kx9KgqORzvWGDHEAO6Z8iDW8AV0TPX X-Received: by 2002:a05:6214:62a:b0:67f:28d6:7108 with SMTP id a10-20020a056214062a00b0067f28d67108mr29934244qvx.40.1704303473698; Wed, 03 Jan 2024 09:37:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303473; cv=none; d=google.com; s=arc-20160816; b=RNRXfD6ZGmcuPbYJ5yd7I2tAEHQIoHmUJtq0OCKLDEymsKrxMTcIuFYbOjcQfCZQMD 8TwSbfktIj9z6v9IEjSmlsMdBTdGZRJJwOz1l1DDt80cv21qkI6m4RX+/QDGKr99+atv l8gU/v/pHH5eYR422UOydwml3yxpdatDkS9HwuT/0JvOor3vFtpBb9ZxP51f4mQ2lcRp xPDxBGG2NGfqQKEi/Ny9Uz4DmXhK/bEsh5EozsstEwObdoz3MHHrdaQgInyp9J3hDk48 yfHg6EtZw9LGKiGxMMr0esXdwJEdTxdmnfC2Y2hH6DSIU+6mBShzp/bWScwmuLZ/ZRux qKYg== 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=T1rMPXmtlBiD25TB/VWS9sZqi6o6l7wGlXBsxO0xhRU=; fh=vgfOyrYvOwgmYzstDn0/HgLmIVrGMIP63mUycC+6pY8=; b=PFup8NMF6VUZPH9cSYG0jwKRk8sxF3OdnUB+DYS8fLRzd4MQUMBeXDpWXaEbPwOr92 dUyigMf4w7Gv7iiFmi8U/RREhAJEVliQeo2+B+0Vp1lgrLu/M09/9dctCu7us5kdRN24 hWHScFLIw3u3RQloCskEvBASBaM/vJxKr96wolg3MirZ1aa5bH3Qwl49cxn8L9JBvpK+ 1ojXpn68fr2NNOvMeK/9LI5ZvdqRtfHMGaDdD0NcyAEB0nDrO/hoZOwSXcq+gNYducJI vWJ64aLiHU79KjKL8kbtQD68wZJNwSzo0sshPosqknJ3nwToSOe2bZZi1ZBACQuUgQ9M LWCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e6NGi+rj; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d14-20020a0cf0ce000000b0067f0d1677e7si30018486qvl.517.2024.01.03.09.37.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:37:53 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e6NGi+rj; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58L-0003rs-Oq; Wed, 03 Jan 2024 12:34:25 -0500 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 1rL58J-0003oi-Lc for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:23 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL580-0002TU-6I for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:23 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3373a30af67so3024803f8f.0 for ; Wed, 03 Jan 2024 09:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303239; x=1704908039; 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=T1rMPXmtlBiD25TB/VWS9sZqi6o6l7wGlXBsxO0xhRU=; b=e6NGi+rj7izZQG1DHEYoDWi1w3I60i50X4l4z+HYmfnL6J9kWSH89+YYjMkhwdiaQY cb+AWIXk2+K60fhc7OhuXvnQD7usNwkUFEn9EIc33TGLPgQsC8GXTvztfdI6n/uS0abA nqLSNLRBNrBdBMBNgXlDj3ZMW0rmXBnxxYWzJvJgjuxwwq2rB+x1wJXWGmnGALcQoIKl brJgTiGIJqQHPdDSeQqa+5T+1KYF+PrvPn7ib59XUwu+iPqKkmEQYHkOMkRT9vNk1PYe 4mE1Frvquap1T9z1VgkwsaBB+PD6elILUDbYStH+A6H3tn40ft/JiB4SoaW8ZuFluaLN n1Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303239; x=1704908039; 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=T1rMPXmtlBiD25TB/VWS9sZqi6o6l7wGlXBsxO0xhRU=; b=u7Ybs7Oi7pcGW7pGgGuzduL8iIUs897cyT7YtcuFZdrM1ZEgxBN+vt2WhY+f3Z/9At r3FUefU5vSIq8BAZSQv1QVPwvAUHVasP2m/LSJf+XQT13hO/1j7Di5xwdmUIEWVT7ltq B9V2+l1SVKpcZc9YAihOQh56Ws15minH88E2mlcdWHBfkyGtYXusjm/XWgV5Ba2hNG5a lQG/7wrUEBQ6NXJI69dE8zeBOLUEIjba4h/Fkroz5axK9plsKBTnaQifjnTKI6gmV45R cca7womntG/YDnuIwiGeSqzoVeaIGnxmQJORfoudVF47OI9pw1ZnMkark96XfWDPoEjj 9FgA== X-Gm-Message-State: AOJu0YxqLzfqXBFg0iasGCJI+ZVye1WTeDk9P8htZLGxgTQhRm1m1JBu 8ye8q7KiDMQxHO5tUP2o/DNeIyUk5wXTPw== X-Received: by 2002:a05:600c:4f15:b0:40d:8557:9266 with SMTP id l21-20020a05600c4f1500b0040d85579266mr2005442wmq.23.1704303239306; Wed, 03 Jan 2024 09:33:59 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id w13-20020a05600c474d00b0040c46719966sm2952760wmo.25.2024.01.03.09.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:33:56 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 56A705F940; Wed, 3 Jan 2024 17:33:50 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 11/43] qtest: bump prom-env-test timeout to 6 minutes Date: Wed, 3 Jan 2024 17:33:17 +0000 Message-Id: <20240103173349.398526-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.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=unavailable 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: Daniel P. Berrangé The prom-env-test can take more than 5 minutes in a --enable-debug build on a loaded system. Bumping to 6 minutes will give more headroom. Signed-off-by: Daniel P. Berrangé [thuth: Bump timeout to 6 minutes instead of 3] Signed-off-by: Thomas Huth Message-Id: <20231215070357.10888-8-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/qtest/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index ec93d5a384f..c7944e8dbe9 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -5,6 +5,7 @@ slow_qtests = { 'qom-test' : 900, 'test-hmp' : 240, 'pxe-test': 600, + 'prom-env-test': 360, } qtests_generic = [ From patchwork Wed Jan 3 17:33:18 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: 759628 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6611378wrw; Wed, 3 Jan 2024 09:38:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGN+vIKbTz3AmsEvR/IXCVwWcDBuQClJua5SewGE9wzje+b36Qu+NcwcOX3Up1448hEz9bs X-Received: by 2002:a05:620a:260e:b0:781:45db:801f with SMTP id z14-20020a05620a260e00b0078145db801fmr20861518qko.41.1704303485489; Wed, 03 Jan 2024 09:38:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303485; cv=none; d=google.com; s=arc-20160816; b=wapWR4X23oLvUgZm/8m7CvDpiG30WdtZXRpuyjIPJw64i4hjF5tqccZCuGmG7Fu7MD GTBdlMQskiA3Xq3uPipAWs6VRkmcgcA6jwJtaotKAUfL4WbnqdEAlatU/dIr0OGu7sfI Ds/isVy8i0WJ6E78HM81QCdnngSu1DSwsx7aMTjnoH0wm0VjuOjoaU5Z27K4z/DA/X6S R5oq6RJHMPiOboX88aucsYUbUqNGRP8vECH9X+LjENXgwlwKlt+84q4ke4enE0XRW4ZM S2oJ2UR56vT52L8Bd1Dz0rkCoxYctkpgFagmyfw0PXm4FJMD6U51+FGEQP9b+d25ys4+ G1ig== 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=wRw1//+81PB5ZNvZJSTSQFwoG2tqKVRM/U60AtyQst4=; fh=vgfOyrYvOwgmYzstDn0/HgLmIVrGMIP63mUycC+6pY8=; b=0CXVleJ8uHnYnrg1RR6PKPr5cG5VrFjuo+yRFf3PvrSWLidahskSdXoXQLNPqqbDqm LYuOB3Wj6zkhaheumuWyYpFWEx/hTtwK9931ls8KUC3dOAVsjDPCqd1zTKl+hU9DheOI 3l6mRlpcLOp3bRW6yDGSuxOyNQ12QQWM2yH+1bCoVI0P7Cvi/zEFLPiEnFcRpGj2TRS/ KvrdkVIWdyK8Kl84O20pTq+49+Qlr7pYKxmT6Tc6JiajLEVM07nY6INWXkuNzUkzZFi3 /sesyYLstmrQmvFnzjyfuMZke5snx127oxrIjjFAgyhhtpSk2KWS33TfDs05WLSsrPhd sNvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QZ+7Y21x; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id os37-20020a05620a812500b00781c33a864fsi6490096qkn.208.2024.01.03.09.38.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:38:05 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QZ+7Y21x; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58K-0003p6-2D; Wed, 03 Jan 2024 12:34:24 -0500 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 1rL58I-0003mf-BL for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:22 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL580-0002UG-5k for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:22 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40d87ecf579so29155705e9.3 for ; Wed, 03 Jan 2024 09:34:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303240; x=1704908040; 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=wRw1//+81PB5ZNvZJSTSQFwoG2tqKVRM/U60AtyQst4=; b=QZ+7Y21xMfAIht4B7MqplZRfvNXqyfHg+WvYMbuWeFMRLevmNMfKmGrhVVf+j/n+qz crxFZx3nCViKVNWeh+qzeLGagi0zYye6su5KHGI91b+9tzPEqiOR+hoey+T5q43ih8vn KWZOgTh7NlLQ04N7BhxfFx7I6T2tJJ90OXGKGUY93IcH46stEpyq95vKn8SBGUrTZfSF +SZw6ZYWiFgxK20imDxetcA81Bj4MBTYbsl1CW1W668YAz7NTeEVuksLmtHW8Kt64Cp7 owwxDEPG1p1o6AGhFNuAGOGTA8CcoaD2BFXekODKM9aqmYUFe9W7imzePPk7iqhWaQjs M3xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303240; x=1704908040; 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=wRw1//+81PB5ZNvZJSTSQFwoG2tqKVRM/U60AtyQst4=; b=NPFrv733OEk2B+WYKMEcdj8fNfB90IQqm8tfAzWSCp3YjIkIaS4ZW1A1eUqm9RQrN2 nHgD7HTl0IdfQDQjVGCL1wZqm7TOfe37He28naFn+TTjloNERo9V8xb9ONyWvRoIsejo 4Uz2eI1t4hIIU/qXSD7+cxNj3AqzS9HEEO4xPRom3D5XpmYc7m6uo4/MBuPd/B0UipRK PDgUyeW8YPetdnqWEZJlQ3TZANAASIwZxxksOHM5R+4iI6yLjbC+AMc4UExTxaIiVjZe rtFWnNUidTAfDrormnl8HGfsCfHf+M7VCENvsAAJoQ7SJf7Iou8NF3JINjbuekLtltq8 q/PQ== X-Gm-Message-State: AOJu0YxiJQ/iabCcBG7otfvFHmlUFVO8ti5HOdsO/uUJhxGr5Vhh3dkY 0ODeuffdbiDpcPwVp/LCPSfLLcHZVdOFDw== X-Received: by 2002:a05:600c:354e:b0:40d:4d95:f82f with SMTP id i14-20020a05600c354e00b0040d4d95f82fmr6578918wmq.68.1704303240439; Wed, 03 Jan 2024 09:34:00 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c1-20020a05600c0a4100b0040d81c3343bsm2942425wmq.42.2024.01.03.09.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:33:56 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6B1A25F942; Wed, 3 Jan 2024 17:33:50 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 12/43] qtest: bump boot-serial-test timeout to 3 minutes Date: Wed, 3 Jan 2024 17:33:18 +0000 Message-Id: <20240103173349.398526-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x331.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=unavailable 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: Daniel P. Berrangé The boot-serial-test takes about 1 + 1/2 minutes in a --enable-debug build. Bumping to 3 minutes will give more headroom. Signed-off-by: Daniel P. Berrangé Reviewed-by: Thomas Huth Message-ID: <20230717182859.707658-9-berrange@redhat.com> Signed-off-by: Thomas Huth Message-Id: <20231215070357.10888-9-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/qtest/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index c7944e8dbe9..dc1e6da5c7b 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -6,6 +6,7 @@ slow_qtests = { 'test-hmp' : 240, 'pxe-test': 600, 'prom-env-test': 360, + 'boot-serial-test': 180, } qtests_generic = [ From patchwork Wed Jan 3 17:33:19 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: 759621 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6611052wrw; Wed, 3 Jan 2024 09:37:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGc1ltGjXCq9F2xdH1EavOdpP6fIF6YmF2Xx4ux5G8PNOdKeWPdjQ0UbZpPyLdF6tDyv+Wc X-Received: by 2002:a9d:7f01:0:b0:6dc:5e1:3d89 with SMTP id j1-20020a9d7f01000000b006dc05e13d89mr10127672otq.17.1704303436814; Wed, 03 Jan 2024 09:37:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303436; cv=none; d=google.com; s=arc-20160816; b=KY+vfHi74AJH0UTbiVofliDT17IdUJHny0CbkbtYIN1v12Q4g4TMTc4mCQd5YYWD6D wipQy0s97A5tfH3H+Z2lCd8Yc3mT52iyGUVcMIC/1sCyugmfEFUCiG4BKKN7FYwWBweo iJFMhKA85ICaHOiKHLNFh516CCd/bbW/kymM1r6hyHQ/eef0nbWMQAAP9zi1ASw7ou7c 1ntLc7Lv5DskKhuXmgAMlSwzF35GlN/2nA/dwBojY3tBV26BnsfP0R+IY/7F5/zYFrAa A0dV8t0a4/Uns+hRcsSpRy+ZsmpXhFF8sH+Yd0zXr34d+THMap00KHJuwfrLlUHCdbOw 6o5g== 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=G7uxGZGov81O+5jLuoaBr/C5I/uZZh1/zGx1+p9cIt8=; fh=vgfOyrYvOwgmYzstDn0/HgLmIVrGMIP63mUycC+6pY8=; b=cak7oVWuK458t0dmbhxnHi+JvZ1bwbA+mik7HBfGGAm24s3zV/VMcLGr6OGjCgxRO1 tv5h3KHQX3inLnfx+n6Zvn52m9xHyIoxj+cfNjclun4O9UIm9FXQKtXqhjPYjFcJrSEx yHSsOsnkdikr9m2n0nfuz//kKHBWqj72f4j84uJIALfV9NJbEJZbiToDJ6tizXXuMlAH K77fZ5lXVFEd54+Uux0lMQGI2YZddHKGO+ntIMtuRGvI5W2ogcqmTzVTxnT6RQBHrsYp XnzIrEugiAD+R56yyuzmxCg8WRSLMMRijwFRonCQR4QvuorccPB1DuZiigiFskpWC7ZP 2aIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Auu0NJM0; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jd27-20020a05622a719b00b00427e7c7090csi17956428qtb.322.2024.01.03.09.37.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:37:16 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Auu0NJM0; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58m-0004MP-4R; Wed, 03 Jan 2024 12:34:52 -0500 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 1rL58P-0003yu-U2 for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:30 -0500 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL584-0002Ve-1t for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:29 -0500 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2ccec119587so48543231fa.0 for ; Wed, 03 Jan 2024 09:34:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303243; x=1704908043; 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=G7uxGZGov81O+5jLuoaBr/C5I/uZZh1/zGx1+p9cIt8=; b=Auu0NJM0w0lP+xQ2nDVJjbOs9Rh9fBl6lkEe1wrdgaCbZIHVUNzirOuVa6rwdMzi4N j6/wcgTf1iitxO9BX7U53zwkWy1g0IWvsCygTrnG4W8h1Kfd62eSPkx/a3YnVfFjWIWC HC9nRuz+pRcOHzs+H+Tr7+WJe49Pk4yZt/5AEqAvjYdgjb5wC+Rkk+P3b4WvRBiwgvQB dZu+PczlBaOH/H68UyN5PqtcwhVCJCmM++IDvbWRhlyljzM2ivRMLraxfR6UL7nGWoeO E3GJO1bxYMzStvkODb0/8LlZE+HddafIjHTzzCRMF48oB50MVsDVaqzeDbnw53mQqSSm KSlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303243; x=1704908043; 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=G7uxGZGov81O+5jLuoaBr/C5I/uZZh1/zGx1+p9cIt8=; b=rJaAKBmL5uFQA2RrpSj+im5DJL3ktC21z414va37yfdqxtact9I7TsS2AWDo90NxGH VuFK70s/PhDE7e/T+YrvskY/S3nQ8pzJ1jwaHxFqz+BfSD8oRBrn/83FoudmJvlVlrYM 4MoPIFrBH4Tx+s4y4Fu+wBOMderQgLTXAykgOgK2hvNTiTwsUs3cqGQlBr9pa6co8d29 XPoXiBofH7+YQP//RZrSFyFMHGeLaNuhhiCZ6L5DnBU27EFH4TcDfkRZicQ0sHd6QfdZ id6Li84vWfDgEJ2x2bFwaCMC821EQl7xv8kuM4VZ8WAQ/x3w4uozHOC3oyGXX01KYsIB Z5Iw== X-Gm-Message-State: AOJu0YzrD9AttMGKBijXg7XBubILT29Rtg15FoBuzanytuL9wbjlC9jL a9ZJFLEtQJOZz/dPjK34fBNuUHQ+9jXWPg== X-Received: by 2002:a05:651c:686:b0:2cc:d555:bc66 with SMTP id x6-20020a05651c068600b002ccd555bc66mr4899025ljb.76.1704303242728; Wed, 03 Jan 2024 09:34:02 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q28-20020adfab1c000000b0033690139ea5sm28923405wrc.44.2024.01.03.09.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:33:56 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 817AB5F944; Wed, 3 Jan 2024 17:33:50 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 13/43] qtest: bump qos-test timeout to 2 minutes Date: Wed, 3 Jan 2024 17:33:19 +0000 Message-Id: <20240103173349.398526-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=alex.bennee@linaro.org; helo=mail-lj1-x234.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=unavailable 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: Daniel P. Berrangé The qos-test takes just under 1 minute in a --enable-debug build. Bumping to 2 minutes will give more headroom. Signed-off-by: Daniel P. Berrangé Reviewed-by: Thomas Huth Message-ID: <20230717182859.707658-10-berrange@redhat.com> Signed-off-by: Thomas Huth Message-Id: <20231215070357.10888-10-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/qtest/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index dc1e6da5c7b..b02ca540cff 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -7,6 +7,7 @@ slow_qtests = { 'pxe-test': 600, 'prom-env-test': 360, 'boot-serial-test': 180, + 'qos-test': 120, } qtests_generic = [ From patchwork Wed Jan 3 17:33:20 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: 759632 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6611966wrw; Wed, 3 Jan 2024 09:39:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFaBg8QreVoYCdb3bixNTzWZOFVg2ALqdwEn7yeW5Xa7ejtkg4j3a8ViTh96+SvcNDarDxv X-Received: by 2002:a05:620a:a83:b0:781:3a2d:5a75 with SMTP id v3-20020a05620a0a8300b007813a2d5a75mr19303500qkg.12.1704303574901; Wed, 03 Jan 2024 09:39:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303574; cv=none; d=google.com; s=arc-20160816; b=Odb6S7COf4OcM6XSZCkLNUQMo6A3tGlNz0IhYTeklFBdkF+5+mH22UDZmFgk7mQE8w 0FmvuJ4mfi8I1xaOvWKcPzEWpD1j21aJF0mVNng9sFbeEyBoDYubheT4EtP1DnWHVq0i YgqpQ1QOUGq4oIJHSKe7EKKpOWItMdF5/gkPnSYRb9e2kxLw2jDrpI/BjvFsJXcLyWmL R/zU0YGral2bq8rkJ+rlDzzkLl8IsPHB/fpncT7NeH9zohzPRl3maV0eLpYn1TY1BGMg yTH4MajrHVfqcGCix4O+pitYxQCB/1XbAlIIr/xfKYrZluGmaxIh1ZrpJegSbOZwsF/B jBRA== 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=vqrDXpkh9FjMlfAgHrjndIlqPg75eovfRGnZr9OF3KY=; fh=vgfOyrYvOwgmYzstDn0/HgLmIVrGMIP63mUycC+6pY8=; b=RkzrZOE7K6mDAZPqtoWn0W5BxGTQVegNIDXhCxWHzR9CZ4TLY/PjYycFa09EjSyYEB obcR+Rt55jZngTFshKyZ+IU2/Ibz25CQDoCHDrMd3sRZr3fDeZ1lcvEkwjwf8Er8kAv2 hLtnHaIl5XSKj2i2sEsnwgmLp6arOW5JrpAHwJ6Zujks3jqv834svI3YTZMOTNtgAUyF act/o8QrEY1UpwEYgP+zH+KWsML8533ugli7WGhWlggPlvth33vWxZucGEvwSKyBK/YZ 33Hvt2s+uf9WTV87jXjaE/3Khk9ity6TKj+4cqv9K2YyZgY5W8mI50d1l/k77+gJhfge ssmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="px/1BEMA"; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k7-20020a05620a0b8700b007815767172esi17437543qkh.36.2024.01.03.09.39.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:39:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="px/1BEMA"; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58M-0003sR-2Q; Wed, 03 Jan 2024 12:34:26 -0500 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 1rL58K-0003qD-RB for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:24 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL580-0002UV-6g for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:24 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3367632ce7bso9138318f8f.2 for ; Wed, 03 Jan 2024 09:34:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303240; x=1704908040; 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=vqrDXpkh9FjMlfAgHrjndIlqPg75eovfRGnZr9OF3KY=; b=px/1BEMAA58Anby4kBk1fpNqIQu/skQnoxsX1HHLsckmUbsUm+ENf8i/dT9np1uNv/ yAfUdVe+XfbYuV+bKsXOrbXEVnuNCPFbkq/JrgMVsTebKo7JhdBo//tjyQwU3letusBd PgEdyBqU/Ug5MORXkCwvXCzxVkrjMR4y5lIQDWxUX1u7hrYTE/5VriOqd2j8Op4LC3yC PAzV7uKa2Y+mMWKJ2ug3TU0NbIqnnakSTX9yaA5TDaD5U11yqPOB+CK4lg2gYwhYsbSL nUpkK9Ovo32R1nb8pL0tfp+fPgQPOnh1f/qXVEZR5t6TJO0mszIhkUv/BVMM9ld1rDln ZMLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303240; x=1704908040; 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=vqrDXpkh9FjMlfAgHrjndIlqPg75eovfRGnZr9OF3KY=; b=KNeaOh+Kpa7eJB+IQs1HdHSxoEjUSdMkE3RvYQsMz2il0GdrgGQKxYru4kyTDD0Q2r edfn0B900MMI9M4UM0V7Il+Jw2o7g3MPjg49T7WnO4qQ3U5yrbFKIVp+sH/Gqr8r5tlh mkc7BQfRR6mDpYBrVfZoCbwd1etfEQEglokVl/bNh1Qbjqm6Q8cE2rOC9n4v42SZwsef KR7iMBW/s6oBhmTtB0SO08uNnKS0cJpwYcmwyJTfHhwBgfkbr90Fk/IkztTACKbTZP1f yJgvZ/yMSSAsQkpH9UeBjqYN6MhRn4svJtpzOkIf88xkGbBQri33hP07tJaIe34ogeOw 349A== X-Gm-Message-State: AOJu0Yzv/auAN6BCFACQbsMQlGWTYaiLkozm+Iy8K9hykC79MbHQLcSA z5fjj5AfOf5lL0D3JTd61ZIoKRYJWh8vag== X-Received: by 2002:a5d:684a:0:b0:336:1182:6475 with SMTP id o10-20020a5d684a000000b0033611826475mr10980107wrw.34.1704303240708; Wed, 03 Jan 2024 09:34:00 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a18-20020a5d53d2000000b0033671314440sm31256414wrw.3.2024.01.03.09.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:33:56 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 95FEB5F926; Wed, 3 Jan 2024 17:33:50 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 14/43] qtest: bump aspeed_smc-test timeout to 6 minutes Date: Wed, 3 Jan 2024 17:33:20 +0000 Message-Id: <20240103173349.398526-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.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=unavailable 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: Daniel P. Berrangé On a loaded system with --enable-debug, this test can take longer than 5 minutes. Raising the timeout to 6 minutes gives greater headroom for such situations. Signed-off-by: Daniel P. Berrangé [thuth: Increase the timeout to 6 minutes for very loaded systems] Signed-off-by: Thomas Huth Message-Id: <20231215070357.10888-11-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/qtest/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index b02ca540cff..da53dd66c97 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -1,4 +1,5 @@ slow_qtests = { + 'aspeed_smc-test': 360, 'bios-tables-test' : 120, 'migration-test' : 480, 'npcm7xx_pwm-test': 300, From patchwork Wed Jan 3 17:33:21 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: 759611 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6610267wrw; Wed, 3 Jan 2024 09:35:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjBS6xozi2XNmKOcPuX+WDeyODMme54hEj0OtfY6nOThXpuXIsBSFMBBQKkopxn0UTblJa X-Received: by 2002:a54:4699:0:b0:3bc:ef:121f with SMTP id k25-20020a544699000000b003bc00ef121fmr4549567oic.114.1704303320178; Wed, 03 Jan 2024 09:35:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303320; cv=none; d=google.com; s=arc-20160816; b=QSVW6IgkbwnT/LLo7WhDtEHwxuy+e2KFGCZnK3+MEUyIKuqU5cwAY2XVIeBmYNArDx 2yQ70mRtAboszZMRuHRU5rLezamYXLU359H8v4HjMXLfllcN5p47UczcEuPLfbpz5Lt8 PM4de5tkFC7YiJXurC3bUazItVTTLxbyvo1PMYaFomKklMeo+GWYHHCDnpn7n5AADtNI Mqi3zBo2lsK5X0c5Y8KCvdRtqAAb/454wjGhtq1edLImpciRszFsyPrgd1e/HUrrTxN2 EV5YIXnhzUg+Arb7zF/pEXUrYg0Fery6bpEZtCdu82BIzNijBdvAyywxBS6LLIAoDniu x7Jg== 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=NG0GNTBkS5OA4bLgzcXFuNl7bQt30v5WL9SIW527gOo=; fh=vgfOyrYvOwgmYzstDn0/HgLmIVrGMIP63mUycC+6pY8=; b=MMHhFxvULxsFtMPx+QuP2ZutoD3IcBZwceMJiIj7XYO5v2zJw/pkO5Muw9vSanCqLR l3Sz3ej3svHsbnyhVHrbBxUOmryBic8YBpZjbFX/3pvBeSwTPJHS4N9/uPsxHLXiq/Tw MHp56BoEho4Vd58on8BWxydTv6ede5Zzwg58BDxFstKpMlv+foRm7LN4+1MX9XzLu9nK iXue7R3n7tOdQPZDdVEoET6LxCpuAQGiWbgkVNWUHgxuVlcu2Q8P9Z1nP+TdjJrD0h0E pHoz3jEPfe80X1btK6yeUQbtHRpqNeI51/i/wXDCMUkXW2CLshRFFznOo0c2ZkPh5xQb 5HTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h28a7erC; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q12-20020a05620a0d8c00b00781e3ce9a0bsi2664822qkl.519.2024.01.03.09.35.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:35:20 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h28a7erC; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58S-00040t-2O; Wed, 03 Jan 2024 12:34:32 -0500 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 1rL58M-0003sz-Fu for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:26 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL584-0002Vp-0B for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:26 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40d2376db79so95777665e9.0 for ; Wed, 03 Jan 2024 09:34:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303242; x=1704908042; 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=NG0GNTBkS5OA4bLgzcXFuNl7bQt30v5WL9SIW527gOo=; b=h28a7erC+ZXWKMeh+DWy4ovBR4jL4Fki7KsJLkaHVfqV/8Qv4NnEQ/F9c3tS7b6xh5 gNIJrbhUW9xt2MT+ZRTkolY8m5VnRBe+a9dEuz9U+CI77/kNzuFa3d8QPezvUJzqfdZv gi90o+d//I+t9y5yA5iz5yxAS0ggvVZJQUuxf/PJWdXxoSyv56+NnQo1j+2CWcYURz3b 0Mc6Vrji5I8XOjY/m9V8CYbWZj3d1mHQl+c7IXAZj8TCF7ki3o5M2+w41DBXIA3/hSCA whMQ38YpXyLjBjguUPsd6+5GIS4HjmJf24So/lG+8vlMJPJGi41wdg7zdpIjhjZZjkq+ hz0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303242; x=1704908042; 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=NG0GNTBkS5OA4bLgzcXFuNl7bQt30v5WL9SIW527gOo=; b=sXwR1i0PBJyEm27Pqacmm/b+HLX44nY3FXUy3M7boufUS2iOfG9jeQ1U6w5WnZFOkh YYjrPpg4XWJ18cwLqzFAd2b3LlcWVgmtDbkr6jAAqOF8vUG9rhg687btB7ZXwnfzQWZJ JhSV4fRccbnMb5nKOq1zY1mTUCDuritYl6RNUmQOi1qzWmV2U79+8zfKfle1k5TbSRc3 8nWYSVIITm/mlVMaO6bOQMQQoXmrF92AHkIsPhxyJHMbmo1sL16buN5+80U1cMzmotZG 4Pzq5zDPPhk5cUW/9FpSR9SyI0CfrEzWzTgLiUyXVL5oMam5fji20gNp44lQ6PFW5g3/ f5JQ== X-Gm-Message-State: AOJu0YyY/5OkUFgflgrZoDGUqLFSc7WjZ8GvEwhjLQs1WoQKVqql5jLp tkkNBPy15uisBwuEEk1QQHPQZ48U0Hzafg== X-Received: by 2002:a05:600c:524c:b0:40d:42de:46f with SMTP id fc12-20020a05600c524c00b0040d42de046fmr11584360wmb.1.1704303242245; Wed, 03 Jan 2024 09:34:02 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v10-20020a05600c470a00b0040d839e7bb3sm2954439wmo.19.2024.01.03.09.33.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:33:57 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id ACA435F946; Wed, 3 Jan 2024 17:33:50 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 15/43] qtest: bump bios-table-test timeout to 9 minutes Date: Wed, 3 Jan 2024 17:33:21 +0000 Message-Id: <20240103173349.398526-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.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=unavailable 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: Daniel P. Berrangé This is reliably hitting the current 2 minute timeout in GitLab CI, and for the TCI job, it even hits a 6 minute timeout. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrangé Message-ID: <20230717182859.707658-12-berrange@redhat.com> Signed-off-by: Thomas Huth Message-Id: <20231215070357.10888-12-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/qtest/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index da53dd66c97..6e8d00d53cb 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -1,6 +1,6 @@ slow_qtests = { 'aspeed_smc-test': 360, - 'bios-tables-test' : 120, + 'bios-tables-test' : 540, 'migration-test' : 480, 'npcm7xx_pwm-test': 300, 'qom-test' : 900, From patchwork Wed Jan 3 17:33:22 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: 759614 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6610519wrw; Wed, 3 Jan 2024 09:35:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkH5XzfpS5jwOdxs1DUL/pQJgjug+GaCPUHKqXkPHR+GEPC1XQS7DLB06um7koDxDRdw9F X-Received: by 2002:a05:622a:4ca:b0:427:fa9e:971e with SMTP id q10-20020a05622a04ca00b00427fa9e971emr14224229qtx.116.1704303357680; Wed, 03 Jan 2024 09:35:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303357; cv=none; d=google.com; s=arc-20160816; b=Z2VBnZnkc4NjeLmRQ58RvWO5D4jhim9MxVcfWFbsSdIplzNtAx0kFKD5U1NT4UbVwz O+UZt8k5BOJKWYbdkMzXi+jLrTdoYZvagyW4rLRzO/GBCp2ncbcZo+03BgXrsSs7Kf4y z4sNr1fiDplQOQH/QNJbTy1XS3BypJOioux5ajkPQIRFu3eKONbCsMNbmiak1sqaB/ml 7ZEfO/rxi0eq0M7zY6W6O1QzJK3TDkYIyeqqGp/zNbTQGxVmd3lumb6CAdPpAbw0InI9 3B80+TMMbNfL4pTwawgLGLixGG5QBcbqUHWA+DNMAhuznPhhdwSJVSCNrPBuRH1kT6T9 0keg== 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=b7XkKmTa2rk3nK9lrhGULgV33LxXcjUpugmHNR7vUhY=; fh=5s6F1VpUg/LkqHSyTlr7gneXArwgJkl0qAfGr3eFpAs=; b=g6pU3+vgs0Wt/NAKTqdUJSM4NNZ1B0eB9CJzwliDapq5AIqpMBxbavPJmCPTdb+9QR zGtYtM8t1LeQUGepjoAZF96Z54Bgng+iFJj62SUbfLYKGkm+6I0ULneE4tiiJq5qZaCO eQ9wRJubkcxtlPj3z94aWZydMPDDaYMArlgif7MjH03TNFsOOeO+8XsnFZBr85AQgPor wq3MnnQ2f/iDyPWcUFrDFd2kcHSGioeXpVGCfVErcPho/MuyFV/rL1hRuBgR5TKFaxlY K0zWEhRJnyKaNpHiWgIdTSp97WWW1eFCG3/rdRdkk9BT0m5hOpbgjLluPX8PXUQz1dZg XDcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yQmaCTOx; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v13-20020a05622a014d00b004283193bfe4si3410514qtw.639.2024.01.03.09.35.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:35:57 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yQmaCTOx; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58O-0003w1-6o; Wed, 03 Jan 2024 12:34:28 -0500 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 1rL58M-0003u4-Ut for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:26 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL584-0002VP-2o for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:26 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40d76fefd6bso43399935e9.2 for ; Wed, 03 Jan 2024 09:34:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303242; x=1704908042; 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=b7XkKmTa2rk3nK9lrhGULgV33LxXcjUpugmHNR7vUhY=; b=yQmaCTOxAA97+kToksODq+xb0wCXfjKjCPEdeBxbtMN9nNfaEoWIRb7uAKHqyXGltn PiyKbQYsNklSQPr/2cE7rKk80csblUVmfsJhptagho71CgsoChpOz5P+i8fRaTWgN5ia AUkJfSQfN4Poq/YJjku5/LbB8MCdPC/vByfCcjeV5TkxYRrHSvohJj5WaPSxz3z3dBt+ Kc48QltoegTshq78iGpeNDui5YE93ldbJdjhgoM41XEWKzm2T+AVwgj9WH/9gvAl7MjU Cywvj/K8778C0mODFxJtQogUS3kNlnzApP9MM2BRcT0AzOL168iePdiQioMD+ePbvF3b GAkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303242; x=1704908042; 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=b7XkKmTa2rk3nK9lrhGULgV33LxXcjUpugmHNR7vUhY=; b=jWk8x8567/NDokpN0t9H//BNT64mlD2R/P+IOmYNfE1IsT/gtGy/9ai5VeyUR+dGMY TDg3+QhtnW/ol0dV7VjylV0gvpbAM/87xwsO9QVNW8e0g6WvLv9J7R2gsQmaiZovR0g5 H31IKWcEepYDQPLobZYABdgxlwzYjLami8XM267cCOyKJFOh0mOvtLPFrKI4DkYySpc5 zTwyqCYSW7Wr3kmj/zPhPLG/B10hXZKKwz4SDxvlRhB8lRFLWqSYkRiV3+0Hp1OyqTUp AH9HSVSydgvYBGmQGySNMHT+G3XKEJ1RIsWJwOgQ9n9y7qbO/fGDmj65/ZfdaXP+2oR1 LXRQ== X-Gm-Message-State: AOJu0Yw09D7BkLhLQtNUhhpBAgozROaefmy4ue5Wm0qq5wexucqhH7w1 2ppPW/pc5zmLiPhVg4d7qRxxcoFjC9B6Dg== X-Received: by 2002:a05:600c:154f:b0:40d:5f55:663 with SMTP id f15-20020a05600c154f00b0040d5f550663mr3068051wmg.94.1704303242496; Wed, 03 Jan 2024 09:34:02 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q17-20020adff951000000b0033718210dd3sm14497665wrr.103.2024.01.03.09.33.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:33:57 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id C30C35F948; Wed, 3 Jan 2024 17:33:50 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis Subject: [PATCH v2 16/43] tests/qtest: Bump the device-introspect-test timeout to 12 minutes Date: Wed, 3 Jan 2024 17:33:22 +0000 Message-Id: <20240103173349.398526-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.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: Thomas Huth When running the test in slow mode on a very loaded system with the arm/aarch64 target and with --enable-debug, it can take longer than 10 minutes to finish the introspection test. Bump the timeout to twelve minutes to make sure that it also finishes in such situations. Signed-off-by: Thomas Huth Message-Id: <20231215070357.10888-13-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/qtest/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 6e8d00d53cb..16916ae857b 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -1,6 +1,7 @@ slow_qtests = { 'aspeed_smc-test': 360, 'bios-tables-test' : 540, + 'device-introspect-test' : 720, 'migration-test' : 480, 'npcm7xx_pwm-test': 300, 'qom-test' : 900, From patchwork Wed Jan 3 17:33:23 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: 759651 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6615824wrw; Wed, 3 Jan 2024 09:50:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGUZrjo5yZOdubGvaVo6mh5VziSF9z1lIWcoFgTmh6a4kruAgoenVbJfREHbcn4lAFYT6rs X-Received: by 2002:a05:622a:60f:b0:419:6391:6bef with SMTP id z15-20020a05622a060f00b0041963916befmr29116055qta.0.1704304214383; Wed, 03 Jan 2024 09:50:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704304214; cv=none; d=google.com; s=arc-20160816; b=Gub4dzzBwyiuM82iBZyhQgrRm08usCi5t6QR7aGl6NBryydjWo92LH08ghBegYRMcB t2iufW5q/x/82iXJrakHMYP1UvXL2ELI031l7+ZWv/PYaUOypf21tfgKMyDq3PAgp6gG KMFbFfLcKcAPbSlxnrx/iP7uxUN2aJyfwCpNm274zrzz3wO43G9R0GAW0H8Y4gAf+1o7 W2oDLwxrZkQmltdPhQsKnm1ro/pV65jErR9qL/zF/n/E4tCjvqrb7cdLpWWT5SYjczGX 6biwoLW4dW5IPMEMu8HLnlxBz0jobLWNhHoiMXvibUSfVmLblzeh9NA97XAw7YDcb2/w wnSQ== 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=G1gJobfuOXArDzvCmnHLIGQ5mswWRXVhuXYUXNww838=; fh=5s6F1VpUg/LkqHSyTlr7gneXArwgJkl0qAfGr3eFpAs=; b=FUnNu9Vqo8ungJ8NmvIGXUelSb6fcetPihDTMMmjRADBCEn6zmb1GR847yfNqbLcFD +4fHi/UWw/a+o1rF2li9JnhrkyBJFlOAfviiCLh79SSWhG9R2KR8U7Y3qkUEC5DKee4Q cpSix/ag3JGaembq++DC968z0WCwEiAr0LI0G9J9QAhX2tXomF2fgrsq0Q6+JAYhS9Qq y8DTa+2KIsTMaooOqYwiFlricxzoKCBfRnzxOnxmToyoRgQtIxphvpBOIhJv+x+kGiWs J4XUcBgAKxfXFAnYKtWeNMyy5SzZzPFwfFu44E+Uv1yZIdZFTMDfVGNJJ5RpFSbTwsWJ GQ6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SaCp47Lb; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y13-20020a05622a164d00b00427759a44a8si29659463qtj.452.2024.01.03.09.50.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:50:14 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SaCp47Lb; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5Mm-00018F-IP; Wed, 03 Jan 2024 12:49:20 -0500 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 1rL5Mh-0000cs-6J for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:49:15 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5Ma-0000Jn-JD for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:49:14 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3374eb61cbcso674714f8f.0 for ; Wed, 03 Jan 2024 09:49:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704304146; x=1704908946; 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=G1gJobfuOXArDzvCmnHLIGQ5mswWRXVhuXYUXNww838=; b=SaCp47LbCwAVkTak62+mpkkEGyubiX6BGsENvQdKc8JjBElw8RHDfkb6MGHo7td/Q4 RKs9uoiA/ANQynfbnX5QaJOURSR00k6UusgOaPrzZ/q70/2uQImFpqzkD5PGhjHjy4mA L0UdAorTwjjOQGtQvT5p1EcnLgT4NlCvAZXMfMwmVM5ujl2zEy0++q0o4SuUiAOVA5p2 bRcpx9qVV00CnwHeIvof2Vmz3I9htkIS/WS8v0P8YyiaEAELee+DDvKflMULZr06tFUl CVNC3iQm89UElHdvQYntWItp3340lwL98wBuF4WT9Qy24hjgfT6uEaXQTL5+oRQGbCPK fY9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704304146; x=1704908946; 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=G1gJobfuOXArDzvCmnHLIGQ5mswWRXVhuXYUXNww838=; b=EC8HVdPDepX4e6Oowr+w4Os0N+wu1etvAI/F6I59gFBexogjKYRMxrq02NE3Wc/EJp k76/+Ci4v/3M8D7LBthf1g0StqKt14Lw69H2kAwzKqZK9q38T9B9hr+It17TVSJkjtzk kpnFTuVnCupF+nR4xMfh2qKgEgaeKAbTx/QvHKspNHT6tE7OfKJUDk/kF8E/kQskIxHu wKZgeE/6BC1vvRcDRshA5accD4H17LJYHy2B68egJYoNefrReyxTsXyTzFttZYNJ+dHU xjJYXtKT4htIpqptvHRkfPfaaqP2AbSfRyfarccPP2B4EMevY/rh/HkkWLfU4l6ZTlg0 r1Tw== X-Gm-Message-State: AOJu0Yym2zSnUsLjGRR4cdrFcUZwM7263ew0SBW+DUHrYMzLcHQyX5a3 HauPOIqmQndcvwzXPMfWI9pyBq9EqUnn5g== X-Received: by 2002:a05:600c:538c:b0:40d:7b73:68bb with SMTP id hg12-20020a05600c538c00b0040d7b7368bbmr4470553wmb.131.1704304146689; Wed, 03 Jan 2024 09:49:06 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c18-20020a5d4152000000b0033609b71825sm31007316wrq.35.2024.01.03.09.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:49:05 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D9EC15F949; Wed, 3 Jan 2024 17:33:50 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis Subject: [PATCH v2 17/43] tests/unit: Bump test-aio-multithread test timeout to 2 minutes Date: Wed, 3 Jan 2024 17:33:23 +0000 Message-Id: <20240103173349.398526-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.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=unavailable 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: Thomas Huth When running the tests in slow mode on a very loaded system and with --enable-debug, the test-aio-multithread can take longer than 1 minute. Bump the timeout to two minutes to make sure that it also passes in such situations. Signed-off-by: Thomas Huth Message-Id: <20231215070357.10888-14-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/unit/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/meson.build b/tests/unit/meson.build index a05d4710904..0b0c7c14115 100644 --- a/tests/unit/meson.build +++ b/tests/unit/meson.build @@ -172,6 +172,7 @@ test_env.set('G_TEST_SRCDIR', meson.current_source_dir()) test_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) slow_tests = { + 'test-aio-multithread' : 120, 'test-crypto-tlscredsx509': 45, 'test-crypto-tlssession': 45 } From patchwork Wed Jan 3 17:33:24 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: 759642 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6613048wrw; Wed, 3 Jan 2024 09:42:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IFhFODPfVmWUUAgH19F4LZyQoIfZcINP2CxMy6LrcKKvh0CE/Tigij+Y+EaOfO5tTVQjz0Y X-Received: by 2002:a05:6214:402:b0:680:bf47:632d with SMTP id z2-20020a056214040200b00680bf47632dmr3758135qvx.59.1704303738655; Wed, 03 Jan 2024 09:42:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303738; cv=none; d=google.com; s=arc-20160816; b=Bih2F5VKIYCN/0zqb/gaCBr3m3k6pxqDvoCa00aZjzvfuzBLA9grlGQzfSogE+MjzP jjAINWQEvvOpvy8+6YmP4FkVnO2IAAnARxNTjA0VrkNYOwHgXpAS6iSDUjeSaDqWkRF6 ZBil4Wr9IwETG8vEP+gGL/9mXkTdZi8IjhfKKa1cqBEJkVAJp0sV3882vaSSvOvje+1b xlHfVEW3+k51uzWwzTXkAraEvrWT7iKBrk3+guWSLJqxVRo8JzA21mJaZuHZnuw8HFVo pmpNlzpflRDSg4+pvC6ZywAGpMgRwTbs+99DK8srp1+g9EjBby/dGdd9csTL+ciu27z9 OBoQ== 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=bAHZvQIZNHRqbyqy5ojwPgGxK/S007kBQEH3xZgSzNs=; fh=5s6F1VpUg/LkqHSyTlr7gneXArwgJkl0qAfGr3eFpAs=; b=fGydxQ2hhyHvuc+AHS5bJvxJRX9YWNFlVOQdUa402i257Gm8MTrbEL1xvrAD2uCWmy zl7x2pWFhdxDJ6UZWlNshNnSHUzW9jGRspw+3AfTfwVljNvY+hzOEaWbeOYjjdgQQM6t ax/zry5dMiG7eir4weK2GUGFIzYkAff+6FEh/nzN9Y+f18P3UUWELEsjkht82U1aj1W1 E/NOr5SYrLig+NSd8AyW5HRrbr+hWlWZfIB2SlxTht51/Vm7R/JNWq9d30ELzAD+Fdqq CKP1ekGQtG6NcVqmt4R8dxpSltDHl//KqTzW0AqsJI6r+02gA+zJpEpnI2fL/ThLFS/p R9aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TDFCMMZT; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j15-20020a0ce00f000000b0067f8d43804dsi28480811qvk.453.2024.01.03.09.42.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:42:18 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TDFCMMZT; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5DT-0007p7-JC; Wed, 03 Jan 2024 12:39:43 -0500 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 1rL5DJ-0007Ca-Ef for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:33 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5Cw-0000ds-B3 for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:33 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40d5aefcc2fso65609555e9.0 for ; Wed, 03 Jan 2024 09:39:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303548; x=1704908348; 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=bAHZvQIZNHRqbyqy5ojwPgGxK/S007kBQEH3xZgSzNs=; b=TDFCMMZTrSMtw1Ixt3J3XH9U3jQ1qft9BHp9UsT4G3pUHYjFxudIC8xK8NQEJydraY zNFg5QtOGt9ulUMo1BqET7wBf94mqXFyzR/Wyp2PCy3xmW1RPWF7P5t/apIe8uVIZgHT Ih66NnnkwUMZuxr1Px4QvWwOGHYsmvo1F4oXx5fj6athtJTgHWZ1FNs3q8/al+h5uOiW zL72ctkzX/3iEl+IItt9RUl6PJ8dQCD4ozZDlzH1Jz1thhQ7zi3DTDMITiUY3pZ3a31X jEEcUNFP017TvzdULLasaDBRw97ga0KY+vcKPjVJxvB55ADAKTXhMgDmnu6YwGILbfd6 Pnxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303548; x=1704908348; 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=bAHZvQIZNHRqbyqy5ojwPgGxK/S007kBQEH3xZgSzNs=; b=VbyohOmyEmmXsDTzqes0y6FgxqfPKzX3Xj8fG4pLvbktWC/dzEYWEYpRPuIBC7ptoZ 26vNMRxF3V078km4fkDLqvluKJSU+ubVTpgX0TboDKG+7fWMtvsByqFZbbVF/gzDviHb Q9KVvEe0ZTBTALS+3Wk05/rVfTxU4ncNoZoG1PnAqS4ZbQUuTflKjcfhCvVV5InwvNhY TR3VWOTbBa9TWxpJSRChfTGJ5X7PWJ1QHguhSShdbfsz7z0MJMyB6Qt68zytekRnndj6 WCl/PRCyzo1Ts/iFSus94Gpemk6bsgFnRB+SjivZagqpUjTrPRLg+1TPjE+rZR1Pkok+ rY2w== X-Gm-Message-State: AOJu0YwEfZ4uOUgVLZ3G7f4KSgtKKref9mb1Ra5cMau9kRFcVCZE+wJq NQ9XwroJdO+ELuUwuCe486oxjfofGniRtA== X-Received: by 2002:a05:600c:3d8c:b0:40d:83c4:ff2a with SMTP id bi12-20020a05600c3d8c00b0040d83c4ff2amr3311366wmb.55.1704303548649; Wed, 03 Jan 2024 09:39:08 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id b13-20020a056000054d00b0033739c1da1dsm9906876wrf.67.2024.01.03.09.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:39:06 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id F1D055F94A; Wed, 3 Jan 2024 17:33:50 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis Subject: [PATCH v2 18/43] tests/unit: Bump test-crypto-block test timeout to 5 minutes Date: Wed, 3 Jan 2024 17:33:24 +0000 Message-Id: <20240103173349.398526-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.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=unavailable 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: Thomas Huth When running the tests in slow mode on a very loaded system and with --enable-debug, the test-crypto-block can take longer than 4 minutes. Bump the timeout to 5 minutes to make sure that it also passes in such situations. Signed-off-by: Thomas Huth Message-Id: <20231215070357.10888-15-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/unit/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/meson.build b/tests/unit/meson.build index 0b0c7c14115..a99dec43120 100644 --- a/tests/unit/meson.build +++ b/tests/unit/meson.build @@ -173,6 +173,7 @@ test_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) slow_tests = { 'test-aio-multithread' : 120, + 'test-crypto-block' : 300, 'test-crypto-tlscredsx509': 45, 'test-crypto-tlssession': 45 } From patchwork Wed Jan 3 17:33:25 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: 759638 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6612553wrw; Wed, 3 Jan 2024 09:41:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+1t5pKrhhodsv2uQjMAm5115RMFKf8sPKnGe+0rprMHj6mEZ2u7OFn/w1SpZ29xFRIe8V X-Received: by 2002:a05:6830:b90:b0:6dc:3882:959f with SMTP id a16-20020a0568300b9000b006dc3882959fmr3517650otv.32.1704303666896; Wed, 03 Jan 2024 09:41:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303666; cv=none; d=google.com; s=arc-20160816; b=D7wcnCEb/RCdD+lmNhvZEu6SiQafDE5XiLZp0dDRqMjt/PiFO1CK/BTQW5eq6rYCDu a/MOQ01XvYVPtxusl8CCHD7kNogYeGxF6J3X5katS3BgE+ZmTbDhnDmtu4075xuDf6ZQ SdE1VKmcXf3Gzf5cytWcRIRn/phdECzVkHzb/nITiV3TdgyvbhRd43WV7X2Ry/Mj5uzi 1j7rGv+VzImDTFfoDCAwZLZEkEthg4A9SSO34IouAmjXObCprTD39/6nHk6PVolMI76i ExLIBOZTu+9WP3l8UUmVBWK8jUl4BTwJuL47VKdqn0SnD6E7v/nZ2xDeey1KsDXgZ7Yd +IUA== 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=oeKurO18PT1xLzL5iQamunNBev09YXep7NV+pG6wspo=; fh=5s6F1VpUg/LkqHSyTlr7gneXArwgJkl0qAfGr3eFpAs=; b=XdrhANHaU2UIjpj53aP/QybTngcIzd95ZezhBBIZKMmysa0ER90ZCPJvRXbFZ6aSGE vo+aw8BicEWBmneHzH4ilEo4R5Hjrh9tEaV5SXRqHFmK5nhkPryHrLZbcko3nmCOnAnk hYxLvLtBNt5PpbQvLJ6yUU6sse924uF9gwJQV9ugwf5FbLFXPsEqRmO6weeR18rOIs9l 3PKr4ioapWTzjY6zGa7JAl74WmQFjpjIDHIdMRPW2qMT5SXUqV95BS8pBbRD29/cmZhP Zt5BJ3Q6NN5IjaqSJvrA26LzHIip7doBW0BT0QF3VAIM6iZLAwYZFnYQy880zboTCjxv y0Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C6JglGkC; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q1-20020a05622a030100b0042771241179si30019454qtw.75.2024.01.03.09.41.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:41:06 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C6JglGkC; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5DK-0007Gb-Iw; Wed, 03 Jan 2024 12:39:34 -0500 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 1rL5D8-0006Tb-Vf for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:23 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5Cx-0000f0-CZ for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:21 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40d60c49ee7so57992805e9.0 for ; Wed, 03 Jan 2024 09:39:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303550; x=1704908350; 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=oeKurO18PT1xLzL5iQamunNBev09YXep7NV+pG6wspo=; b=C6JglGkCfX5HMVbUd92dEc9h7gVgTTIXiWqLZf9uHQDhQX65PkspIQWlqn+UcKbpWB J3vIbYNIACZdhsiRyJq+5okNIGvvWb4A1/s4btvl4XXaVt1rP34TGoEqWGkzSrdoR/LZ j43NBusKVQi3jgQMH5q1lGeMUdefFHxvDL1VguqkLiv0Kv/YkWOSPxhPwX2x4fKUhIZH xpsTBiouO6kv6sVnVhjQLyly9P1SF+4M4Ag7WCmBqZ6l7GCDtq+khkGbnKCmFzt8HNBN HBAY1xvyqZC/GMUtZVbHrKsbKgsQPKBiOpJTouhz1M6OksEcl2mSEOHqhiVd2Njlamse KujQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303550; x=1704908350; 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=oeKurO18PT1xLzL5iQamunNBev09YXep7NV+pG6wspo=; b=t2o8t3IcsdXo+JEMd07DJGCMXrI5tQotOKoxuLNgKGOzlzyPFoxjReZr0xkVFzOr4v illiiDlQyNkSyzFci6F4pudS+z/lSNwGYSZggnoLTqUngAmFK+fYdZ7taJFbOXo9P+d6 i6e3m4Jhy/lHoDsqwdbmsoSJj6PbCFos8wYsBs5GJQ27SKjNlcrdQnYSOjF7QmzFaVfc dxpGu5G7aJdEO4a7cZUufcUa3nyb1q+JxZBSW+s4t2bnSlvLJ8wALBmcFaGJ8o/uYxha wTXQ0jvtyRzzO4pG69N7d0SPsCTJohvwwmW1N38j+L7P0SDBWLXDUNZhM7qVWoc9pkIV HWzg== X-Gm-Message-State: AOJu0Yy2ER7lK7t5cf5w3lZA2AbQlaBehGoDKNK/yYulluO9Uxk5vswA gobLTaFpdP+N1xLW2FyznE1qeuIKG4cFwQ== X-Received: by 2002:a05:600c:44d6:b0:40c:78c:f864 with SMTP id f22-20020a05600c44d600b0040c078cf864mr10710339wmo.16.1704303549769; Wed, 03 Jan 2024 09:39:09 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id fj7-20020a05600c0c8700b0040d77ebd55csm2974477wmb.13.2024.01.03.09.39.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:39:08 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 12EF95F94E; Wed, 3 Jan 2024 17:33:51 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis Subject: [PATCH v2 19/43] tests/fp: Bump fp-test-mulAdd test timeout to 3 minutes Date: Wed, 3 Jan 2024 17:33:25 +0000 Message-Id: <20240103173349.398526-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.google.com X-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=unavailable 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: Thomas Huth When running the tests in slow mode with --enable-debug on a very loaded system, the fp-test-mulAdd test can take longer than 2 minutes. Bump the timeout to three minutes to make sure it passes in such situations, too. Signed-off-by: Thomas Huth Message-Id: <20231215070357.10888-16-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/fp/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fp/meson.build b/tests/fp/meson.build index cbc17392d67..3b7fc637499 100644 --- a/tests/fp/meson.build +++ b/tests/fp/meson.build @@ -124,7 +124,7 @@ test('fp-test-mulAdd', fptest, # no fptest_rounding_args args: fptest_args + ['f16_mulAdd', 'f32_mulAdd', 'f64_mulAdd', 'f128_mulAdd'], - suite: ['softfloat-slow', 'softfloat-ops-slow', 'slow'], timeout: 90) + suite: ['softfloat-slow', 'softfloat-ops-slow', 'slow'], timeout: 180) executable( 'fp-bench', From patchwork Wed Jan 3 17:33:26 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: 759636 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6612434wrw; Wed, 3 Jan 2024 09:40:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IH4N1mKPyPw6vZzNTGWtvCkvQF2nBSD/Hx/n+h5tGxUeJQje2Zgh4OzR+C6A2nQTVPV+Xeh X-Received: by 2002:a05:6808:2388:b0:3bc:26c4:fc99 with SMTP id bp8-20020a056808238800b003bc26c4fc99mr1324100oib.54.1704303646301; Wed, 03 Jan 2024 09:40:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303646; cv=none; d=google.com; s=arc-20160816; b=WUyG93v3IxWdnou5tJDWxBJWQcrv9984tVzM+3EyydPXFPnzQJJ8TG7zxe6KS+6q9m npD6JccGEw4it93P/rl6WQMtF0YoIBl7waeU7IFMYROg7e1sztru0z+gwryVoVqK3+z5 oAK8RvLK8oe4UgJWokd4rgSt486B+10JWaBF2R5OeJJ5es9iGSdk8zuH0lq02F/dgoRE OJcdJDp+EIAJZyV5sxLbBn/BYJV/WU31MnE8AqUoNvWgJBCUWpIyipU+zq2AJiNgz4ST Ui+mJFHIorqqojt5xU8cpaKwZ/OkQSfwJPeMc+cDYSpv3/qt25RgFm9USZWkJJuT27me KNOQ== 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=0sLk9Y6V09YT5mxoKGySQqDe7AUl7PrL/RJQ+Y1wnbw=; fh=vgfOyrYvOwgmYzstDn0/HgLmIVrGMIP63mUycC+6pY8=; b=DbYaZh2m53N0Iq5y1TS69bxD6LrNWIopbqGQrLh7yulAkWL2qH+CaUFVmGvSKnDt9t CuqNCrYTyaPKGo1XQwe/SdcE5xtFMunHIiq9G8E9bbWdVIPpnCf/jBmlhk3A5xTEhka7 rZNrmoYZtgyPcquqO2elHtOsTgXyCxVfRiUzn+p8w+/svKUT3IMtov8XiEiGAM6owZ4c xShIfHv6Z99O8E/t+azgm9aK94pb83Qqx7bHWGpWw+hLnAf7TFudrKeVp8hWErEJEBVi 77nDwBSToXZVPkrS8KUOFNHc8p8lweA0eOT3UwNxkdHpQqOaYKYkIRgNSaEScU1n3aSD 8tvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gxIsOFzW; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b13-20020a0cc98d000000b0067f3089e006si31093123qvk.546.2024.01.03.09.40.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:40:46 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gxIsOFzW; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5DG-0006v9-LY; Wed, 03 Jan 2024 12:39:30 -0500 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 1rL5D1-00068q-Vo for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:15 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5Cu-0000c2-Oq for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:15 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40d604b4b30so4368485e9.1 for ; Wed, 03 Jan 2024 09:39:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303546; x=1704908346; 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=0sLk9Y6V09YT5mxoKGySQqDe7AUl7PrL/RJQ+Y1wnbw=; b=gxIsOFzWh6zn0hez+uEbsJ5bUiUqIo6ErnyzmnBKsBWFd4K9p1Azi4Lr2Qru3tc7C5 u5RvlrXh3WukJLnbTTUORACUx4ZsZ9zKjiB4BBT6AEVLmb4g7bOz8+COgSmLAMO0ZhYg 7zrpCmH75KpJlyU0rbKP9s15GXsPJmCVlrEXjO1f6d6YXc0nxTlrmIeFnjDkNWOUgTQD ybkNmgu9LvLFEjHTub642lxMvOREptjiC0wkDBSalCaDSQxxnSdS99Ui8AUi9uwkQ3kD eH1HB/n4sapgFGrgNXItj6By6ZyLsY8rgnwYvNRap+Nciq8PRbD/INszUj2ejGsGnVYf /6yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303546; x=1704908346; 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=0sLk9Y6V09YT5mxoKGySQqDe7AUl7PrL/RJQ+Y1wnbw=; b=ZefWpLhGzVbOylYWidl1NUDavT8PSfybdafHznQCp3jTR+fx+hKR4fJhm30GK2a2q3 QvVLzmp7aRW98I6zHoT2NcjvyJs1wlMVMEBIdbQZl7BH1PQbnFbspVe5JgV0eR7NTk83 MT2iKbOgJ6rcsRGv0b5zqwie5XU/z/dZp5JMTWhgFgVhtq1w5Fzd99NeZcVCS1u/Ul4c JDNxEVg28TMFFXH9KiMZIjypXNeYJmdJnP57mCuk2DuxIZ67xbKBdSt5tHBpVzgXjjVX SJpeLBpRbUO5K8WUpjl9+6av1hCR+3O66wZDZAo+/dVKls4yJP6XS2soKLsWshPkKeOZ T3IQ== X-Gm-Message-State: AOJu0YxihnlolCQZwGmWcHusmwQowDXy6Du9u0aI2NUOsgndSRRu1G+c +f42+BtJvBkEUhlJYYJH5MaXzhcKL8kbiA== X-Received: by 2002:a05:600c:4fc7:b0:40d:3f30:a09e with SMTP id o7-20020a05600c4fc700b0040d3f30a09emr804540wmq.84.1704303546006; Wed, 03 Jan 2024 09:39:06 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id dr16-20020a5d5f90000000b003373ef060d5sm8567186wrb.113.2024.01.03.09.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:39:05 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 298A25F950; Wed, 3 Jan 2024 17:33:51 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 20/43] mtest2make: stop disabling meson test timeouts Date: Wed, 3 Jan 2024 17:33:26 +0000 Message-Id: <20240103173349.398526-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.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=unavailable 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: Daniel P. Berrangé The mtest2make.py script passes the arg '-t 0' to 'meson test' which disables all test timeouts. This is a major source of pain when running in GitLab CI and a test gets stuck. It will stall until GitLab kills the CI job. This leaves us with little easily consumable information about the stalled test. The TAP format doesn't show the test name until it is completed, and TAP output from multiple tests it interleaved. So we have to analyse the log to figure out what tests had un-finished TAP output present and thus infer which test case caused the hang. This is very time consuming and error prone. By allowing meson to kill stalled tests, we get a direct display of what test program got stuck, which lets us more directly focus in on what specific test case within the test program hung. The other issue with disabling meson test timeouts by default is that it makes it more likely that maintainers inadvertantly introduce slowdowns. For example the recent-ish change that accidentally made migrate-test take 15-20 minutes instead of around 1 minute. The main risk of this change is that the individual test timeouts might be too short to allow completion in high load scenarios. Thus, there is likely to be some short term pain where we have to bump the timeouts for certain tests to make them reliable enough. The preceeding few patches raised the timeouts for all failures that were immediately apparent in GitLab CI. Even with the possible short term instability, this should still be a net win for debuggability of failed CI pipelines over the long term. Signed-off-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20230717182859.707658-13-berrange@redhat.com> Signed-off-by: Thomas Huth Message-Id: <20231215070357.10888-17-thuth@redhat.com> Signed-off-by: Alex Bennée --- scripts/mtest2make.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py index 179dd548718..eb01a05ddbd 100644 --- a/scripts/mtest2make.py +++ b/scripts/mtest2make.py @@ -27,7 +27,8 @@ def names(self, base): .speed.slow = $(foreach s,$(sort $(filter-out %-thorough, $1)), --suite $s) .speed.thorough = $(foreach s,$(sort $1), --suite $s) -.mtestargs = --no-rebuild -t 0 +TIMEOUT_MULTIPLIER = 1 +.mtestargs = --no-rebuild -t $(TIMEOUT_MULTIPLIER) ifneq ($(SPEED), quick) .mtestargs += --setup $(SPEED) endif From patchwork Wed Jan 3 17:33:27 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: 759635 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6612331wrw; Wed, 3 Jan 2024 09:40:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtm/HUTfc0bztpjSWSAfRVVOy83PY39Y8m4vriIzSMLPurphOJOU6a0cm4GkdN/5H0fSna X-Received: by 2002:a05:6214:124a:b0:67f:44b0:b997 with SMTP id r10-20020a056214124a00b0067f44b0b997mr2001286qvv.52.1704303631838; Wed, 03 Jan 2024 09:40:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303631; cv=none; d=google.com; s=arc-20160816; b=IAukzjX+9R3atmlH77hXAV6KfSPlEDd88bDEwgYGtqVieh0mKynNvRA2pMxrwCd2um qQCkvmdk1g/MXgpv1VoiMh4yIUutNRsmEPzyeJev6BkhjRh3VFTRnQRr83jwYBmTcVbQ GPswiDzSD/Un9DJTYoerJyndY515xqzVJEYjKxI5ubA9Cy4ERFekLAJ2mgKwpN02nAZI O+FcfDjezE4v9uY7QUsZZ/9wzdLTSFmA925l8JGkrzhqYcH7twjP7FBdxFeqAonWus27 CQt4aHnAP2O3NxuEc0LjTwoOdw11syOgF90ppnsN0ePsO5qu845i8L0l7cPjvMsZI2iN sLiA== 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=ciRl9sFGERSf23eviyCL0uKOJ2+yOOkqWUqo8JImKW0=; fh=SUNLeLMef8sbmM+c26ZLaZMzyLf2pipT3nlCP45Ny7c=; b=g0mea1kAUcRyKo+k5w+X2z6/wtBBPW5BtQ2vLGfMSV1f4nq+BYXsfSmrKjliwBbPrg o2dEyuxeos67t2/DpBbPPsKk9xAkEb/EYTbFwNvKlZPODoWLBX2Lh1nzWKgbiLZXl+WO TuTouCUdOMeAUB6878m+oDGMupeShQ9v71mg0BAgymW36XwkC/k1O/IkMlEpfq8FTJRH DTABfZRv/nMcHqztgRhsU3zJCTgjUfqTNM3PluMAaBQmOsy5sL3ZOQ6ruXHlxUKEuMdy h81QpcD2IpwHcwW4rDxoZi0vnoSvlP1dgehE1Hn0semXwmC/nOb9ALqsbbknscAXt3ph /wew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KPOJ1yQC; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id gw8-20020a0562140f0800b00680286f1075si21524805qvb.308.2024.01.03.09.40.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:40:31 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KPOJ1yQC; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5DW-0007xA-OB; Wed, 03 Jan 2024 12:39:46 -0500 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 1rL5DP-0007gN-SV for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:39 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5D2-0000ld-5q for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:39 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-33677fb38a3so10735509f8f.0 for ; Wed, 03 Jan 2024 09:39:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303554; x=1704908354; 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=ciRl9sFGERSf23eviyCL0uKOJ2+yOOkqWUqo8JImKW0=; b=KPOJ1yQC10ewHPKxj0B56GN6UZ1LRUX0woBBGNOU953v1Aybbebr0PjThiMdEa5Bz1 mtD1OM0DV/x15Jf43KsENEvXzDn7SmIrmcWItPe1M1kjv3KKPt2r5QKzNU/NmnhlzpNX xnOJFpnCw9VdZrd860OtvfGFA7V38QR4oN/+JM84/vV5PBsgtQgJtCPQMyhS33e0fkIt 1AwJZLyhYVExi7DrEPwdAkw2xEd3HaIaNN1/7O2B1FiSgMzil+LQ8RLgLOrSxi49eMsk qS/wWrCOdDvNjFL5clIGjR4JKvrXMsSHSy8IqjZMO1gL8lDJfkfit5KPuKSzRYNr+xz8 bqQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303554; x=1704908354; 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=ciRl9sFGERSf23eviyCL0uKOJ2+yOOkqWUqo8JImKW0=; b=QYp4cLcCNq2qQ5ToKUJh4Cb1CL7lYpw31wr4V0AnImqZKRSVD95RVfDxT4aCL5YByn qTSUDteS5HtPclIS9TrXTRm/bTQE5HfTcandgr8eOh4M43oXfanGwOMBpLGtilRmtj3x kfoht8zmOZucpTKhLrg4MvVF5QxS0XowKm1ekW6FuB8mC/mWKFewClTFfzfexjPtLmgC OAc5If7z6jz3TyVNndvqSpfJ2i75C5wtWqNscdjRzvNQQ+1ETg6bXEXphsjAueBRWfEo +NvGO7h6YtCdHFPmZdr2zNNfBHSjXwJlBXDyTnGxvNR0JPvqMymGuYAe4hKfrMEW/t7S iiVg== X-Gm-Message-State: AOJu0YycTOI8EQFlv5Df/XkEMagOwtuQZocdLi/QA13ggPDq5F11wiXl YiZSnOg3MkX1f0BoB/KN2DLpIvpRdljw5A== X-Received: by 2002:a5d:4849:0:b0:336:8f9f:c69c with SMTP id n9-20020a5d4849000000b003368f9fc69cmr10597659wrs.40.1704303554593; Wed, 03 Jan 2024 09:39:14 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id x18-20020adff0d2000000b003365aa39d30sm30989513wro.11.2024.01.03.09.39.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:39:13 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 3FDAA5F951; Wed, 3 Jan 2024 17:33:51 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , qemu-stable@nongnu.org Subject: [PATCH v2 21/43] readthodocs: fully specify a build environment Date: Wed, 3 Jan 2024 17:33:27 +0000 Message-Id: <20240103173349.398526-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.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 This is now expected by rtd so I've expanded using their example as 22.04 is one of our supported platforms. I tried to work out if there was an easy way to re-generate a requirements.txt from our pythondeps.toml but in the end went for the easier solution. Cc: Signed-off-by: Alex Bennée Message-Id: <20231221174200.2693694-1-alex.bennee@linaro.org> --- docs/requirements.txt | 2 ++ .readthedocs.yml | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 docs/requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000000..691e5218ec7 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,2 @@ +sphinx==5.3.0 +sphinx_rtd_theme==1.1.1 diff --git a/.readthedocs.yml b/.readthedocs.yml index 7fb7b8dd61a..0b262469ce6 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -5,16 +5,21 @@ # Required version: 2 +# Set the version of Python and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.11" + # Build documentation in the docs/ directory with Sphinx sphinx: configuration: docs/conf.py +# We recommend specifying your dependencies to enable reproducible builds: +# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - requirements: docs/requirements.txt + # We want all the document formats formats: all - -# For consistency, we require that QEMU's Sphinx extensions -# run with at least the same minimum version of Python that -# we require for other Python in our codebase (our conf.py -# enforces this, and some code needs it.) -python: - version: 3.6 From patchwork Wed Jan 3 17:33:28 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: 759634 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6612167wrw; Wed, 3 Jan 2024 09:40:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDn8sJQbJ4KTPlIGc5vpJb6r6m4+OwXydSilO08Ps44xDhCLDfbKfHVASm4KsDSSA7Rgyf X-Received: by 2002:a5b:c44:0:b0:dbe:a490:abf3 with SMTP id d4-20020a5b0c44000000b00dbea490abf3mr790358ybr.90.1704303608225; Wed, 03 Jan 2024 09:40:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303608; cv=none; d=google.com; s=arc-20160816; b=OrD4uQl6bWxHhIy+LN01/3iPZvPo5p6TD7ObhyGdglJDBo/KjOcZXJb2XLmS2xwTvC GU6fsBoV7QRAuwq0EovC83FGD29O6fdEWc30RSCG2eT7z5tZJ1Fy/uWGtQJQWXX3epa5 YyEi8P4WG6mDpkkBxMEo+50sffG/VOuvrokphvgH6ImZorbX+/iYo1QrMXfrRTnrXxVJ wiS35+BzpgKx65+9S58gXdlYEsIBUCOrORGzJ3MswG9jWVewiPCNENxz/68j4HJv5w1t MN0kCBkJw1fEBTV+M9pXa88NSK9Zr4viaGIl7NFNdzmwMv4y4tWZG+1hzZOSBoFgqZ4t F+jA== 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=UUTepCaXuSvQff7RpqKHmtGuMDeLUnEdp+0FVQ8ed3M=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=XL47vpCnSUoiUEuY7uJK9lsqbWN0begr/dDNkpjBRx2uxulZxfHbLqRXSEd+uYa0JG fIlXoc2efUqQ2Poo46sH+lTqipWNml8IyG53+ydZQYVJXtO/0T/OEaoAzjT0hNv9RWhI P32dA6mRkt2qf1jKOmrAmavzS1LSTWD1oo3M8bY0GvtOkIr3/xnpyKW9TgB3KFJZ3T8T tQZrCCJHl9m2ghdC5ff4KQqYGLO1XYs813r/7VgCbDTm1KKIytbX0kxWiecdhjKd6Kub j3PAO6s685BZyMzSU0hZnILXPg2AIr1mma+8n2OyB8oqiJ/SZNRbvzK0YZehn5ZSu2RU zJHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e0kOxQ9t; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bb39-20020a05622a1b2700b004283b90c8e4si1046262qtb.517.2024.01.03.09.40.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:40:08 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e0kOxQ9t; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5Cz-00064V-34; Wed, 03 Jan 2024 12:39:13 -0500 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 1rL5Cx-0005wX-Eb for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:11 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5Ct-0000c6-PU for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:11 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40d4a7f0c4dso100136865e9.1 for ; Wed, 03 Jan 2024 09:39:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303546; x=1704908346; 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=UUTepCaXuSvQff7RpqKHmtGuMDeLUnEdp+0FVQ8ed3M=; b=e0kOxQ9tX/ZuiLXXv6bq2N7gALaUO6jr/J1yPe+niPz+NVDoTa+tUVSMHQFeRNWMXx /2/vzefj06458WvLokbA77IZ04qFKGf67As8yadr1gRnqQg5tM7gD4x/Z4uaeXKmgAdP WomrVVbL8Zy4m2gk2jAScojfvovsuF/GIiLAP1g2fDm418pkqVy4S/Zs1MjHqMHSaSiq Iqjf6Tml9MWo9aNAUwEIDQVCo+hlq7oelxZBIRbxO/Y+u17WEgwyI+wSj+wfP7N5PByB /1O3HyqXuNl6SZ9xJBxShOpGVpLaXZ7cYiU/yd9xnOL4Pq/AqGafk6ib6m69OdHErBD7 lS1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303546; x=1704908346; 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=UUTepCaXuSvQff7RpqKHmtGuMDeLUnEdp+0FVQ8ed3M=; b=jHnHmoHgtl2baan1biz7OS1TE8hzmMGZgfum80N6NN3kGKoc8ppmtPLAKYY4nxL1jX TLLl2YEctLVuOoDiBiFjWscVtDHKIbh2i8Yqe5zDk9MqZiAYUiWXPJEoTfZnEkktHPqi CROyTMgn3aQsEi2F+92z51LnXSXuOlYj9BK+P+BuBYGLZgGUr6JGuKfU+w24OiEnC+7X c++ceMTTq1XlMomdQ1SSQ1+pA9gh/Ik9zye+HJeP6BzLDei4/qTx+DRBeARy4+Uq/jrs C1xCYyZvwSAP19r68pAR60VYBKcjK6n9U08pDp4NJMg1ALc/ZSxAbRALigOgBBZUrK4A k2iw== X-Gm-Message-State: AOJu0Yx68UODrc1boo92pZQR+fs5g1LxW65AJASW7Jl75KD0eX/PinoV nknKzGx1OXfgdP+bN7oQW9NvYNke3xgfDA== X-Received: by 2002:adf:e7c7:0:b0:336:619f:4647 with SMTP id e7-20020adfe7c7000000b00336619f4647mr8666036wrn.108.1704303546236; Wed, 03 Jan 2024 09:39:06 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id k4-20020a5d5244000000b003368c8d120fsm29995262wrc.7.2024.01.03.09.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:39:05 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 57CC25F954; Wed, 3 Jan 2024 17:33:51 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 22/43] hw/riscv: Use misa_mxl instead of misa_mxl_max Date: Wed, 3 Jan 2024 17:33:28 +0000 Message-Id: <20240103173349.398526-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.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: Akihiko Odaki The effective MXL value matters when booting. Signed-off-by: Akihiko Odaki Message-Id: <20231213-riscv-v7-1-a760156a337f@daynix.com> Signed-off-by: Alex Bennée --- hw/riscv/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c index 0ffca05189f..bc67c0bd189 100644 --- a/hw/riscv/boot.c +++ b/hw/riscv/boot.c @@ -36,7 +36,7 @@ bool riscv_is_32bit(RISCVHartArrayState *harts) { - return harts->harts[0].env.misa_mxl_max == MXL_RV32; + return harts->harts[0].env.misa_mxl == MXL_RV32; } /* From patchwork Wed Jan 3 17:33:29 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: 759627 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6611347wrw; Wed, 3 Jan 2024 09:38:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IFXoMhD5P26LfYbSqhY3vPU44FCHAKaSZdm2r4krq17xYlnYHGHnOd9eX+S1vVmX6Fcl8tJ X-Received: by 2002:a05:6214:40e:b0:680:b352:a2c6 with SMTP id z14-20020a056214040e00b00680b352a2c6mr7641295qvx.73.1704303480587; Wed, 03 Jan 2024 09:38:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303480; cv=none; d=google.com; s=arc-20160816; b=ll961GiKXyiOrcfeBPLkF1xhfCYk03fBrDsZHMJzMzoPdOQUCaI3hwbOFGfndgLy1q VZn2654D8Dp7yekK8dmW3FRuW4HQm4R5zfPZTQ+bIJHgVf2oRzoeGc3Iv3FYdyGpHi2K Wg6QzDX9xgfmzfjJbMAUKjcqXv4UVfV0lupr3XmxU0BBQfYbz9QmRAMIdZitHB/i0sIp bl133XBc3Sr0zYT+tpp2luVUUQ7OONsfUnBErkNaTk+Enr5pD3DnAHtBswnpBhfzcEwM m7ya8Qlyp9syiCNSvc8Uu375QQfvl9B1yVtnp39TG4sIJt0OMRBp6LIg+lFSQq8ilh79 5LUA== 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=KAYNxNN/VIwn3brnYwBM4da3zygXAIotsdaTZu8xJew=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=0iZ/QWKEoDP3BG+/V1rck6X/HbmcaiENCI5nHFe4vgJxCO/HNDtgS95E1B4gyzIyh6 1m7cqE8N4P3D3yOOnahhS30P6UZhADlm2+W5mxea5f3b9TF4y414Ad/O6ZGiykKEKn0S FGkKFFFBrR57Ez+sR+hTBvkKiRefOdn2/Kyl4Z9s0/7GMIB9YT34dE85KCbHl8VvjwEG QxOPQuqUDFbqmyT7xmVjt+bkD96zkkw4Cned8jEIxER2sx4Red3lF1z1aygIbFoi4B5G C4MDiOeE9FaGKpCp8MijUtoAtE7HrsKnVZIWI9KkDusOuKAG89i3QNttZDFSoXon/rmP L9QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wCnmPOkE; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m5-20020a0cdb85000000b00680c838d0fdsi2654671qvk.169.2024.01.03.09.38.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:38:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wCnmPOkE; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58o-0004RY-1U; Wed, 03 Jan 2024 12:34:54 -0500 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 1rL58Y-00047h-UL for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:42 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL585-0002Yr-Rj for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:38 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40d5d898162so51172705e9.3 for ; Wed, 03 Jan 2024 09:34:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303247; x=1704908047; 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=KAYNxNN/VIwn3brnYwBM4da3zygXAIotsdaTZu8xJew=; b=wCnmPOkEij82oE867mhfPAatD41ENl0pBqdBOX8u+4Uq+iuTOI05ZOv2zaGkm1rnbm AYNMOlZZo+gJdTJE3p5xzw3SNHKmGuqgGi+PskUf8uYAnB6Qv1Vdrky03Xoy+LPGPlfK Op4lKZoWyt6ffEvhqqV5uf773bNYVTWc5HGeAUiQ3s81dkz0ZT0hesICvJsu35GQma2K 2O36bXJl5WdYqYmBGjEniFh367yX68aIGkVjEF+17aXcjgChOn61lbo1ioR1FwuPnCGe FHcD+I+0YjgY8kZPHcXEZw+JgxuekA5+8sbrXy+xHsVyAKRH0wKa1ICJlvvnoc2L58/u gPzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303247; x=1704908047; 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=KAYNxNN/VIwn3brnYwBM4da3zygXAIotsdaTZu8xJew=; b=oU9OVK1Aj3q6QPc/+jxmkpw9lwywetf9/VZvf/19dSXmwNzdnmR7d145jBYY3+QWlU +2mXN6nFxMFyTAYjXtNpJXX//ZeHWOUKe8pGVcPMeSbDLAGjWUU/+JTyXTh0z69SgDdl 0cD1Evjjvr/QdkNCu1mrZAkz+0SiqQ8dIBDsCCHHNw7W1FgDsFnjzGyE4EWhMmLLXSqM Tq1T3Bj+ycXupCHWbT3fXBBsP3d7Mn0EZvynZYrx3VFaDH0pyw5sOmr1KIX0QL96rtg3 k95e2EoZY3Rxl+VrEKP1UQdr88nWFlC+qw/iwIimJdoCvbsIbz2A4WqwbzGTKFNs0zZg wGQw== X-Gm-Message-State: AOJu0Ywb+rGjDfwBwBGq3U6WKDvMHGHj9PZJqeci02dyUYhKPYz7xwpd Y7PerremX+E3CFDcMuDunzBUa0HQJfGRFA== X-Received: by 2002:a05:600c:3c88:b0:40d:6582:e552 with SMTP id bg8-20020a05600c3c8800b0040d6582e552mr6943624wmb.9.1704303247501; Wed, 03 Jan 2024 09:34:07 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o21-20020a05600c511500b0040d86e89abfsm2917164wms.43.2024.01.03.09.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:34:02 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6E5185F955; Wed, 3 Jan 2024 17:33:51 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 23/43] target/riscv: Remove misa_mxl validation Date: Wed, 3 Jan 2024 17:33:29 +0000 Message-Id: <20240103173349.398526-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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=unavailable 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: Akihiko Odaki It is initialized with a simple assignment and there is little room for error. In fact, the validation is even more complex. Signed-off-by: Akihiko Odaki Acked-by: LIU Zhiwei Reviewed-by: Daniel Henrique Barboza Acked-by: Alistair Francis Message-Id: <20231213-riscv-v7-2-a760156a337f@daynix.com> Signed-off-by: Alex Bennée --- target/riscv/tcg/tcg-cpu.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index 8a35683a345..ee17f65afb6 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -148,7 +148,7 @@ static void riscv_cpu_validate_misa_priv(CPURISCVState *env, Error **errp) } } -static void riscv_cpu_validate_misa_mxl(RISCVCPU *cpu, Error **errp) +static void riscv_cpu_validate_misa_mxl(RISCVCPU *cpu) { RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cpu); CPUClass *cc = CPU_CLASS(mcc); @@ -168,11 +168,6 @@ static void riscv_cpu_validate_misa_mxl(RISCVCPU *cpu, Error **errp) default: g_assert_not_reached(); } - - if (env->misa_mxl_max != env->misa_mxl) { - error_setg(errp, "misa_mxl_max must be equal to misa_mxl"); - return; - } } static void riscv_cpu_validate_priv_spec(RISCVCPU *cpu, Error **errp) @@ -673,7 +668,6 @@ static bool riscv_cpu_is_generic(Object *cpu_obj) static bool tcg_cpu_realize(CPUState *cs, Error **errp) { RISCVCPU *cpu = RISCV_CPU(cs); - Error *local_err = NULL; if (!riscv_cpu_tcg_compatible(cpu)) { g_autofree char *name = riscv_cpu_get_name(cpu); @@ -682,14 +676,11 @@ static bool tcg_cpu_realize(CPUState *cs, Error **errp) return false; } - riscv_cpu_validate_misa_mxl(cpu, &local_err); - if (local_err != NULL) { - error_propagate(errp, local_err); - return false; - } + riscv_cpu_validate_misa_mxl(cpu); #ifndef CONFIG_USER_ONLY CPURISCVState *env = &cpu->env; + Error *local_err = NULL; CPU(cs)->tcg_cflags |= CF_PCREL; From patchwork Wed Jan 3 17:33:30 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: 759644 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6614268wrw; Wed, 3 Jan 2024 09:45:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHt6qhlPBYX987Dxcd0OhO1vLl7FdG4O8TJ1SfypyymlnSpLyBbk5nupMQdLWUMFFua7SEe X-Received: by 2002:a05:620a:22e7:b0:77f:702:f5ad with SMTP id p7-20020a05620a22e700b0077f0702f5admr21904275qki.66.1704303939858; Wed, 03 Jan 2024 09:45:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303939; cv=none; d=google.com; s=arc-20160816; b=UMGMhzyunqnFy3AppEf4yHthbPSuh7kvXiUkyrW/S2tWbLF+ycfpVg41IvEdiK06iH cHBpYRLdJC6zGjeGuajHo3nRybx0SViukH1IddQ8YLqaUPIQL/7qGEoLu+AqwnMmy3qN NBMo8DmDatITHCshB41Hrc/A6DdD/YEtAxVzjgljZRdDBgrlGKJYRYL0FLUE29hlUk9q CBzR5npAEgUtMR0+hIAciEXDVKyPYQ7cKHW1Usur79eVNWszdSxf/eGDxCfrEw+n8cSB 1jAjR5w0a3dscETo3zQWKbTHifBUtpUI9D0E0yvsFlNSZO9eQ+4+Owpk9R7NArfyo+AT ojsg== 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=0ZlBlDseJiU+Vt7ccbZJnZPKE9F5SWGJIPha2vy8A+4=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=XfCrBZmvVPZU3D/B3rVZG5MHWDdCVbj1gNsLRsvOxdPazcg7UzwlhptdFN495NUXVn cA8jCWAdR656/B4NpwVdWNm5m9uir13cSUlf3T5rC16kEFFOMKPfP+TvDUgM9eiEsBiN sH0mY6ylCk39NhrD6hUMjQgYPFv1C91dB9re6aQHFJiv3sQgYxMbltL31dnCAlyEtQMM 78lKyPkIU5bIOZ/TMPchuvEYU4TocubPje5gaOTwaHP2K5Rk/lo/nE790TqB66ZL9DSp WDS0V8S8Gvj3p2hw2ulr6yw0Ig1U6Wj/H7HnW974PkKDPOLgWd/zfYKCkw9AOA/Nf/ST fsVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P+h5jLcd; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a17-20020a05620a439100b00781db5c5a84si4388337qkp.191.2024.01.03.09.45.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:45:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P+h5jLcd; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5DQ-0007hV-H6; Wed, 03 Jan 2024 12:39:40 -0500 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 1rL5DE-0006cA-LV for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:28 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5Cz-0000hM-QC for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:26 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3373a30af67so3029830f8f.0 for ; Wed, 03 Jan 2024 09:39:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303552; x=1704908352; 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=0ZlBlDseJiU+Vt7ccbZJnZPKE9F5SWGJIPha2vy8A+4=; b=P+h5jLcdUkIlD+0e/WR4T13uM4DFP5M1SCZh73M/ByTyzKYUCNchuGn6RAidSYTfmS DzJohsJpZlD68IThyHiavGlHSeMMnyVDQGU4XTqTNsGokMhYfJpqlskbT0aGd46b0QMW EyY4o85e1N8JFKe7ryyR5y6jYQ2hwlMLM4IlcUI0iKnsjBSgIV5/5K+buPwPM2du4TLD YySLMvpZm4oku7wh1PJVZ7+AR1343wYGAZDIa0I+jJm/jYExQ87XNscvO6ew2TrpIQqO v+LXRz0Ds1JMc2EoE0DkL6R3GxbW5g+7xp7J/2fg1Nc5lA7qKwERYxQaZyLZ90KSbx2J 0XFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303552; x=1704908352; 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=0ZlBlDseJiU+Vt7ccbZJnZPKE9F5SWGJIPha2vy8A+4=; b=ivgYtOmYQnKyaEc8K7iN8FYofHIij4O95USBPjkhOHoCm4q7V6w6HXU+IOwqqAP11Z D6maNJwznWHGDRjVV1mQvA2cppXVCg8CRMaDMm6bILrw2FajCeNDRDbO+szuV1GK+vqu 0iQKjcjvcWBKkNvH8sO2IWAxy2Hq0anRbdD76OW81dp6ZUl5crfG3crOEsM/kDOO6nAb FFv6yOkhQOzUnWMOaw9b81ZYwmBvNzBeiF+KoaOimjqRabtmMlCZ2LyrGYkiXIHsPFg2 NlAR/K6+rdi6ui1aAxPfjyk9G4s/+9b15+3CdVqH5S1t3RFNRtZ2dwXewpXz5l+jiEm2 hTDQ== X-Gm-Message-State: AOJu0Yx0JgXfAfcKl5ibaucgb1v8EapALZFnXdVP+1qS7yyU1HgcOER2 uSlDbTypSOoHuY0sMpV7U3xHOGL5IOhasg== X-Received: by 2002:adf:e849:0:b0:336:8178:c269 with SMTP id d9-20020adfe849000000b003368178c269mr5842837wrn.89.1704303551846; Wed, 03 Jan 2024 09:39:11 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id u12-20020a5d434c000000b00336ee9edbb3sm18617127wrr.94.2024.01.03.09.39.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:39:08 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 8A9695F933; Wed, 3 Jan 2024 17:33:51 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 24/43] target/riscv: Move misa_mxl_max to class Date: Wed, 3 Jan 2024 17:33:30 +0000 Message-Id: <20240103173349.398526-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.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: Akihiko Odaki misa_mxl_max is common for all instances of a RISC-V CPU class so they are better put into class. Signed-off-by: Akihiko Odaki Message-Id: <20231213-riscv-v7-3-a760156a337f@daynix.com> Signed-off-by: Alex Bennée Acked-by: Alistair Francis --- target/riscv/cpu.h | 4 +- target/riscv/cpu.c | 118 +++++++++++++++++++------------------ target/riscv/gdbstub.c | 12 ++-- target/riscv/kvm/kvm-cpu.c | 10 ++-- target/riscv/machine.c | 7 +-- target/riscv/tcg/tcg-cpu.c | 12 ++-- target/riscv/translate.c | 3 +- 7 files changed, 87 insertions(+), 79 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index d74b361be64..060b7f69a74 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -169,7 +169,6 @@ struct CPUArchState { /* RISCVMXL, but uint32_t for vmstate migration */ uint32_t misa_mxl; /* current mxl */ - uint32_t misa_mxl_max; /* max mxl for this cpu */ uint32_t misa_ext; /* current extensions */ uint32_t misa_ext_mask; /* max ext for this cpu */ uint32_t xl; /* current xlen */ @@ -450,6 +449,7 @@ struct RISCVCPUClass { DeviceRealize parent_realize; ResettablePhases parent_phases; + uint32_t misa_mxl_max; /* max mxl for this cpu */ }; static inline int riscv_has_ext(CPURISCVState *env, target_ulong ext) @@ -756,7 +756,7 @@ enum riscv_pmu_event_idx { /* used by tcg/tcg-cpu.c*/ void isa_ext_update_enabled(RISCVCPU *cpu, uint32_t ext_offset, bool en); bool isa_ext_is_enabled(RISCVCPU *cpu, uint32_t ext_offset); -void riscv_cpu_set_misa(CPURISCVState *env, RISCVMXL mxl, uint32_t ext); +void riscv_cpu_set_misa_ext(CPURISCVState *env, uint32_t ext); typedef struct RISCVCPUMultiExtConfig { const char *name; diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 83c7c0cf07b..2ab61df2217 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -274,9 +274,8 @@ const char *riscv_cpu_get_trap_name(target_ulong cause, bool async) } } -void riscv_cpu_set_misa(CPURISCVState *env, RISCVMXL mxl, uint32_t ext) +void riscv_cpu_set_misa_ext(CPURISCVState *env, uint32_t ext) { - env->misa_mxl_max = env->misa_mxl = mxl; env->misa_ext_mask = env->misa_ext = ext; } @@ -378,11 +377,7 @@ static void riscv_any_cpu_init(Object *obj) { RISCVCPU *cpu = RISCV_CPU(obj); CPURISCVState *env = &cpu->env; -#if defined(TARGET_RISCV32) - riscv_cpu_set_misa(env, MXL_RV32, RVI | RVM | RVA | RVF | RVD | RVC | RVU); -#elif defined(TARGET_RISCV64) - riscv_cpu_set_misa(env, MXL_RV64, RVI | RVM | RVA | RVF | RVD | RVC | RVU); -#endif + riscv_cpu_set_misa_ext(env, RVI | RVM | RVA | RVF | RVD | RVC | RVU); #ifndef CONFIG_USER_ONLY set_satp_mode_max_supported(RISCV_CPU(obj), @@ -403,16 +398,14 @@ static void riscv_max_cpu_init(Object *obj) { RISCVCPU *cpu = RISCV_CPU(obj); CPURISCVState *env = &cpu->env; - RISCVMXL mlx = MXL_RV64; -#ifdef TARGET_RISCV32 - mlx = MXL_RV32; -#endif - riscv_cpu_set_misa(env, mlx, 0); env->priv_ver = PRIV_VERSION_LATEST; #ifndef CONFIG_USER_ONLY - set_satp_mode_max_supported(RISCV_CPU(obj), mlx == MXL_RV32 ? - VM_1_10_SV32 : VM_1_10_SV57); +#ifdef TARGET_RISCV32 + set_satp_mode_max_supported(cpu, VM_1_10_SV32); +#else + set_satp_mode_max_supported(cpu, VM_1_10_SV57); +#endif #endif } @@ -420,8 +413,6 @@ static void riscv_max_cpu_init(Object *obj) static void rv64_base_cpu_init(Object *obj) { CPURISCVState *env = &RISCV_CPU(obj)->env; - /* We set this in the realise function */ - riscv_cpu_set_misa(env, MXL_RV64, 0); /* Set latest version of privileged specification */ env->priv_ver = PRIV_VERSION_LATEST; #ifndef CONFIG_USER_ONLY @@ -433,8 +424,7 @@ static void rv64_sifive_u_cpu_init(Object *obj) { RISCVCPU *cpu = RISCV_CPU(obj); CPURISCVState *env = &cpu->env; - riscv_cpu_set_misa(env, MXL_RV64, - RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU); + riscv_cpu_set_misa_ext(env, RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU); env->priv_ver = PRIV_VERSION_1_10_0; #ifndef CONFIG_USER_ONLY set_satp_mode_max_supported(RISCV_CPU(obj), VM_1_10_SV39); @@ -452,7 +442,7 @@ static void rv64_sifive_e_cpu_init(Object *obj) CPURISCVState *env = &RISCV_CPU(obj)->env; RISCVCPU *cpu = RISCV_CPU(obj); - riscv_cpu_set_misa(env, MXL_RV64, RVI | RVM | RVA | RVC | RVU); + riscv_cpu_set_misa_ext(env, RVI | RVM | RVA | RVC | RVU); env->priv_ver = PRIV_VERSION_1_10_0; #ifndef CONFIG_USER_ONLY set_satp_mode_max_supported(cpu, VM_1_10_MBARE); @@ -469,7 +459,7 @@ static void rv64_thead_c906_cpu_init(Object *obj) CPURISCVState *env = &RISCV_CPU(obj)->env; RISCVCPU *cpu = RISCV_CPU(obj); - riscv_cpu_set_misa(env, MXL_RV64, RVG | RVC | RVS | RVU); + riscv_cpu_set_misa_ext(env, RVG | RVC | RVS | RVU); env->priv_ver = PRIV_VERSION_1_11_0; cpu->cfg.ext_zfa = true; @@ -500,7 +490,7 @@ static void rv64_veyron_v1_cpu_init(Object *obj) CPURISCVState *env = &RISCV_CPU(obj)->env; RISCVCPU *cpu = RISCV_CPU(obj); - riscv_cpu_set_misa(env, MXL_RV64, RVG | RVC | RVS | RVU | RVH); + riscv_cpu_set_misa_ext(env, RVG | RVC | RVS | RVU | RVH); env->priv_ver = PRIV_VERSION_1_12_0; /* Enable ISA extensions */ @@ -544,8 +534,6 @@ static void rv128_base_cpu_init(Object *obj) exit(EXIT_FAILURE); } CPURISCVState *env = &RISCV_CPU(obj)->env; - /* We set this in the realise function */ - riscv_cpu_set_misa(env, MXL_RV128, 0); /* Set latest version of privileged specification */ env->priv_ver = PRIV_VERSION_LATEST; #ifndef CONFIG_USER_ONLY @@ -556,8 +544,6 @@ static void rv128_base_cpu_init(Object *obj) static void rv32_base_cpu_init(Object *obj) { CPURISCVState *env = &RISCV_CPU(obj)->env; - /* We set this in the realise function */ - riscv_cpu_set_misa(env, MXL_RV32, 0); /* Set latest version of privileged specification */ env->priv_ver = PRIV_VERSION_LATEST; #ifndef CONFIG_USER_ONLY @@ -569,8 +555,7 @@ static void rv32_sifive_u_cpu_init(Object *obj) { RISCVCPU *cpu = RISCV_CPU(obj); CPURISCVState *env = &cpu->env; - riscv_cpu_set_misa(env, MXL_RV32, - RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU); + riscv_cpu_set_misa_ext(env, RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU); env->priv_ver = PRIV_VERSION_1_10_0; #ifndef CONFIG_USER_ONLY set_satp_mode_max_supported(RISCV_CPU(obj), VM_1_10_SV32); @@ -588,7 +573,7 @@ static void rv32_sifive_e_cpu_init(Object *obj) CPURISCVState *env = &RISCV_CPU(obj)->env; RISCVCPU *cpu = RISCV_CPU(obj); - riscv_cpu_set_misa(env, MXL_RV32, RVI | RVM | RVA | RVC | RVU); + riscv_cpu_set_misa_ext(env, RVI | RVM | RVA | RVC | RVU); env->priv_ver = PRIV_VERSION_1_10_0; #ifndef CONFIG_USER_ONLY set_satp_mode_max_supported(cpu, VM_1_10_MBARE); @@ -605,7 +590,7 @@ static void rv32_ibex_cpu_init(Object *obj) CPURISCVState *env = &RISCV_CPU(obj)->env; RISCVCPU *cpu = RISCV_CPU(obj); - riscv_cpu_set_misa(env, MXL_RV32, RVI | RVM | RVC | RVU); + riscv_cpu_set_misa_ext(env, RVI | RVM | RVC | RVU); env->priv_ver = PRIV_VERSION_1_12_0; #ifndef CONFIG_USER_ONLY set_satp_mode_max_supported(cpu, VM_1_10_MBARE); @@ -622,7 +607,7 @@ static void rv32_imafcu_nommu_cpu_init(Object *obj) CPURISCVState *env = &RISCV_CPU(obj)->env; RISCVCPU *cpu = RISCV_CPU(obj); - riscv_cpu_set_misa(env, MXL_RV32, RVI | RVM | RVA | RVF | RVC | RVU); + riscv_cpu_set_misa_ext(env, RVI | RVM | RVA | RVF | RVC | RVU); env->priv_ver = PRIV_VERSION_1_10_0; #ifndef CONFIG_USER_ONLY set_satp_mode_max_supported(cpu, VM_1_10_MBARE); @@ -845,7 +830,7 @@ static void riscv_cpu_reset_hold(Object *obj) mcc->parent_phases.hold(obj); } #ifndef CONFIG_USER_ONLY - env->misa_mxl = env->misa_mxl_max; + env->misa_mxl = mcc->misa_mxl_max; env->priv = PRV_M; env->mstatus &= ~(MSTATUS_MIE | MSTATUS_MPRV); if (env->misa_mxl > MXL_RV32) { @@ -1213,6 +1198,12 @@ static void riscv_cpu_post_init(Object *obj) static void riscv_cpu_init(Object *obj) { + RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(obj); + RISCVCPU *cpu = RISCV_CPU(obj); + CPURISCVState *env = &cpu->env; + + env->misa_mxl = mcc->misa_mxl_max; + #ifndef CONFIG_USER_ONLY qdev_init_gpio_in(DEVICE(obj), riscv_cpu_set_irq, IRQ_LOCAL_MAX + IRQ_LOCAL_GUEST_MAX); @@ -1657,7 +1648,7 @@ static void cpu_get_marchid(Object *obj, Visitor *v, const char *name, visit_type_bool(v, name, &value, errp); } -static void riscv_cpu_class_init(ObjectClass *c, void *data) +static void riscv_cpu_common_class_init(ObjectClass *c, void *data) { RISCVCPUClass *mcc = RISCV_CPU_CLASS(c); CPUClass *cc = CPU_CLASS(c); @@ -1699,6 +1690,13 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) device_class_set_props(dc, riscv_cpu_properties); } +static void riscv_cpu_class_init(ObjectClass *c, void *data) +{ + RISCVCPUClass *mcc = RISCV_CPU_CLASS(c); + + mcc->misa_mxl_max = (uint32_t)(uintptr_t)data; +} + static void riscv_isa_string_ext(RISCVCPU *cpu, char **isa_str, int max_str_len) { @@ -1764,18 +1762,22 @@ void riscv_cpu_list(void) g_slist_free(list); } -#define DEFINE_CPU(type_name, initfn) \ - { \ - .name = type_name, \ - .parent = TYPE_RISCV_CPU, \ - .instance_init = initfn \ +#define DEFINE_CPU(type_name, misa_mxl_max, initfn) \ + { \ + .name = (type_name), \ + .parent = TYPE_RISCV_CPU, \ + .instance_init = (initfn), \ + .class_init = riscv_cpu_class_init, \ + .class_data = (void *)(misa_mxl_max) \ } -#define DEFINE_DYNAMIC_CPU(type_name, initfn) \ - { \ - .name = type_name, \ - .parent = TYPE_RISCV_DYNAMIC_CPU, \ - .instance_init = initfn \ +#define DEFINE_DYNAMIC_CPU(type_name, misa_mxl_max, initfn) \ + { \ + .name = (type_name), \ + .parent = TYPE_RISCV_DYNAMIC_CPU, \ + .instance_init = (initfn), \ + .class_init = riscv_cpu_class_init, \ + .class_data = (void *)(misa_mxl_max) \ } static const TypeInfo riscv_cpu_type_infos[] = { @@ -1788,29 +1790,31 @@ static const TypeInfo riscv_cpu_type_infos[] = { .instance_post_init = riscv_cpu_post_init, .abstract = true, .class_size = sizeof(RISCVCPUClass), - .class_init = riscv_cpu_class_init, + .class_init = riscv_cpu_common_class_init, }, { .name = TYPE_RISCV_DYNAMIC_CPU, .parent = TYPE_RISCV_CPU, .abstract = true, }, - DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_ANY, riscv_any_cpu_init), - DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_MAX, riscv_max_cpu_init), #if defined(TARGET_RISCV32) - DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_BASE32, rv32_base_cpu_init), - DEFINE_CPU(TYPE_RISCV_CPU_IBEX, rv32_ibex_cpu_init), - DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E31, rv32_sifive_e_cpu_init), - DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E34, rv32_imafcu_nommu_cpu_init), - DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U34, rv32_sifive_u_cpu_init), + DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_ANY, MXL_RV32, riscv_any_cpu_init), + DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_MAX, MXL_RV32, riscv_max_cpu_init), + DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_BASE32, MXL_RV32, rv32_base_cpu_init), + DEFINE_CPU(TYPE_RISCV_CPU_IBEX, MXL_RV32, rv32_ibex_cpu_init), + DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E31, MXL_RV32, rv32_sifive_e_cpu_init), + DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E34, MXL_RV32, rv32_imafcu_nommu_cpu_init), + DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U34, MXL_RV32, rv32_sifive_u_cpu_init), #elif defined(TARGET_RISCV64) - DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_BASE64, rv64_base_cpu_init), - DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E51, rv64_sifive_e_cpu_init), - DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U54, rv64_sifive_u_cpu_init), - DEFINE_CPU(TYPE_RISCV_CPU_SHAKTI_C, rv64_sifive_u_cpu_init), - DEFINE_CPU(TYPE_RISCV_CPU_THEAD_C906, rv64_thead_c906_cpu_init), - DEFINE_CPU(TYPE_RISCV_CPU_VEYRON_V1, rv64_veyron_v1_cpu_init), - DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_BASE128, rv128_base_cpu_init), + DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_ANY, MXL_RV64, riscv_any_cpu_init), + DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_MAX, MXL_RV64, riscv_max_cpu_init), + DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_BASE64, MXL_RV64, rv64_base_cpu_init), + DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_E51, MXL_RV64, rv64_sifive_e_cpu_init), + DEFINE_CPU(TYPE_RISCV_CPU_SIFIVE_U54, MXL_RV64, rv64_sifive_u_cpu_init), + DEFINE_CPU(TYPE_RISCV_CPU_SHAKTI_C, MXL_RV64, rv64_sifive_u_cpu_init), + DEFINE_CPU(TYPE_RISCV_CPU_THEAD_C906, MXL_RV64, rv64_thead_c906_cpu_init), + DEFINE_CPU(TYPE_RISCV_CPU_VEYRON_V1, MXL_RV64, rv64_veyron_v1_cpu_init), + DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_BASE128, MXL_RV128, rv128_base_cpu_init), #endif }; diff --git a/target/riscv/gdbstub.c b/target/riscv/gdbstub.c index 58b3ace0fe9..365040228a1 100644 --- a/target/riscv/gdbstub.c +++ b/target/riscv/gdbstub.c @@ -49,6 +49,7 @@ static const struct TypeSize vec_lanes[] = { int riscv_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) { + RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cs); RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; target_ulong tmp; @@ -61,7 +62,7 @@ int riscv_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) return 0; } - switch (env->misa_mxl_max) { + switch (mcc->misa_mxl_max) { case MXL_RV32: return gdb_get_reg32(mem_buf, tmp); case MXL_RV64: @@ -75,12 +76,13 @@ int riscv_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) int riscv_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) { + RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cs); RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; int length = 0; target_ulong tmp; - switch (env->misa_mxl_max) { + switch (mcc->misa_mxl_max) { case MXL_RV32: tmp = (int32_t)ldl_p(mem_buf); length = 4; @@ -214,11 +216,12 @@ static int riscv_gdb_set_virtual(CPURISCVState *cs, uint8_t *mem_buf, int n) static int riscv_gen_dynamic_csr_xml(CPUState *cs, int base_reg) { + RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cs); RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; GString *s = g_string_new(NULL); riscv_csr_predicate_fn predicate; - int bitsize = 16 << env->misa_mxl_max; + int bitsize = 16 << mcc->misa_mxl_max; int i; #if !defined(CONFIG_USER_ONLY) @@ -310,6 +313,7 @@ static int ricsv_gen_dynamic_vector_xml(CPUState *cs, int base_reg) void riscv_cpu_register_gdb_regs_for_features(CPUState *cs) { + RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cs); RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; if (env->misa_ext & RVD) { @@ -326,7 +330,7 @@ void riscv_cpu_register_gdb_regs_for_features(CPUState *cs) ricsv_gen_dynamic_vector_xml(cs, base_reg), "riscv-vector.xml", 0); } - switch (env->misa_mxl_max) { + switch (mcc->misa_mxl_max) { case MXL_RV32: gdb_register_coprocessor(cs, riscv_gdb_get_virtual, riscv_gdb_set_virtual, diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c index 117e33cf90f..ed86f21b8f2 100644 --- a/target/riscv/kvm/kvm-cpu.c +++ b/target/riscv/kvm/kvm-cpu.c @@ -1499,14 +1499,14 @@ static void kvm_cpu_accel_register_types(void) } type_init(kvm_cpu_accel_register_types); -static void riscv_host_cpu_init(Object *obj) +static void riscv_host_cpu_class_init(ObjectClass *c, void *data) { - CPURISCVState *env = &RISCV_CPU(obj)->env; + RISCVCPUClass *mcc = RISCV_CPU_CLASS(c); #if defined(TARGET_RISCV32) - env->misa_mxl_max = env->misa_mxl = MXL_RV32; + mcc->misa_mxl_max = MXL_RV32; #elif defined(TARGET_RISCV64) - env->misa_mxl_max = env->misa_mxl = MXL_RV64; + mcc->misa_mxl_max = MXL_RV64; #endif } @@ -1514,7 +1514,7 @@ static const TypeInfo riscv_kvm_cpu_type_infos[] = { { .name = TYPE_RISCV_CPU_HOST, .parent = TYPE_RISCV_CPU, - .instance_init = riscv_host_cpu_init, + .class_init = riscv_host_cpu_class_init, } }; diff --git a/target/riscv/machine.c b/target/riscv/machine.c index fdde243e040..4c8d9a66595 100644 --- a/target/riscv/machine.c +++ b/target/riscv/machine.c @@ -178,10 +178,9 @@ static const VMStateDescription vmstate_pointermasking = { static bool rv128_needed(void *opaque) { - RISCVCPU *cpu = opaque; - CPURISCVState *env = &cpu->env; + RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(opaque); - return env->misa_mxl_max == MXL_RV128; + return mcc->misa_mxl_max == MXL_RV128; } static const VMStateDescription vmstate_rv128 = { @@ -372,7 +371,7 @@ const VMStateDescription vmstate_riscv_cpu = { VMSTATE_UINTTL(env.vext_ver, RISCVCPU), VMSTATE_UINT32(env.misa_mxl, RISCVCPU), VMSTATE_UINT32(env.misa_ext, RISCVCPU), - VMSTATE_UINT32(env.misa_mxl_max, RISCVCPU), + VMSTATE_UNUSED(4), VMSTATE_UINT32(env.misa_ext_mask, RISCVCPU), VMSTATE_UINTTL(env.priv, RISCVCPU), VMSTATE_BOOL(env.virt_enabled, RISCVCPU), diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index ee17f65afb6..7f6712c81a4 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -152,10 +152,9 @@ static void riscv_cpu_validate_misa_mxl(RISCVCPU *cpu) { RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cpu); CPUClass *cc = CPU_CLASS(mcc); - CPURISCVState *env = &cpu->env; /* Validate that MISA_MXL is set properly. */ - switch (env->misa_mxl_max) { + switch (mcc->misa_mxl_max) { #ifdef TARGET_RISCV64 case MXL_RV64: case MXL_RV128: @@ -274,6 +273,7 @@ static void riscv_cpu_disable_priv_spec_isa_exts(RISCVCPU *cpu) */ void riscv_cpu_validate_set_extensions(RISCVCPU *cpu, Error **errp) { + RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cpu); CPURISCVState *env = &cpu->env; Error *local_err = NULL; @@ -454,7 +454,7 @@ void riscv_cpu_validate_set_extensions(RISCVCPU *cpu, Error **errp) cpu_cfg_ext_auto_update(cpu, CPU_CFG_OFFSET(ext_zcb), true); cpu_cfg_ext_auto_update(cpu, CPU_CFG_OFFSET(ext_zcmp), true); cpu_cfg_ext_auto_update(cpu, CPU_CFG_OFFSET(ext_zcmt), true); - if (riscv_has_ext(env, RVF) && env->misa_mxl_max == MXL_RV32) { + if (riscv_has_ext(env, RVF) && mcc->misa_mxl_max == MXL_RV32) { cpu_cfg_ext_auto_update(cpu, CPU_CFG_OFFSET(ext_zcf), true); } } @@ -462,7 +462,7 @@ void riscv_cpu_validate_set_extensions(RISCVCPU *cpu, Error **errp) /* zca, zcd and zcf has a PRIV 1.12.0 restriction */ if (riscv_has_ext(env, RVC) && env->priv_ver >= PRIV_VERSION_1_12_0) { cpu_cfg_ext_auto_update(cpu, CPU_CFG_OFFSET(ext_zca), true); - if (riscv_has_ext(env, RVF) && env->misa_mxl_max == MXL_RV32) { + if (riscv_has_ext(env, RVF) && mcc->misa_mxl_max == MXL_RV32) { cpu_cfg_ext_auto_update(cpu, CPU_CFG_OFFSET(ext_zcf), true); } if (riscv_has_ext(env, RVD)) { @@ -470,7 +470,7 @@ void riscv_cpu_validate_set_extensions(RISCVCPU *cpu, Error **errp) } } - if (env->misa_mxl_max != MXL_RV32 && cpu->cfg.ext_zcf) { + if (mcc->misa_mxl_max != MXL_RV32 && cpu->cfg.ext_zcf) { error_setg(errp, "Zcf extension is only relevant to RV32"); return; } @@ -956,7 +956,7 @@ static void riscv_init_max_cpu_extensions(Object *obj) const RISCVCPUMultiExtConfig *prop; /* Enable RVG, RVJ and RVV that are disabled by default */ - riscv_cpu_set_misa(env, env->misa_mxl, env->misa_ext | RVG | RVJ | RVV); + riscv_cpu_set_misa_ext(env, env->misa_ext | RVG | RVJ | RVV); for (prop = riscv_cpu_extensions; prop && prop->name; prop++) { isa_ext_update_enabled(cpu, prop->offset, true); diff --git a/target/riscv/translate.c b/target/riscv/translate.c index f0be79bb160..7e383c5eebf 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -1167,6 +1167,7 @@ static void riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) { DisasContext *ctx = container_of(dcbase, DisasContext, base); CPURISCVState *env = cpu_env(cs); + RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cs); RISCVCPU *cpu = RISCV_CPU(cs); uint32_t tb_flags = ctx->base.tb->flags; @@ -1188,7 +1189,7 @@ static void riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) ctx->cfg_vta_all_1s = cpu->cfg.rvv_ta_all_1s; ctx->vstart_eq_zero = FIELD_EX32(tb_flags, TB_FLAGS, VSTART_EQ_ZERO); ctx->vl_eq_vlmax = FIELD_EX32(tb_flags, TB_FLAGS, VL_EQ_VLMAX); - ctx->misa_mxl_max = env->misa_mxl_max; + ctx->misa_mxl_max = mcc->misa_mxl_max; ctx->xl = FIELD_EX32(tb_flags, TB_FLAGS, XL); ctx->address_xl = FIELD_EX32(tb_flags, TB_FLAGS, AXL); ctx->cs = cs; From patchwork Wed Jan 3 17:33:31 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: 759653 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6615982wrw; Wed, 3 Jan 2024 09:50:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3HQfCCtIuc8ehXokZFajrU4qBh8taCKQhP/TcpqjfUm01tTfUfVMXNLk/4MUH/v+d0D6c X-Received: by 2002:a05:6830:349e:b0:6dc:3c65:2a7f with SMTP id c30-20020a056830349e00b006dc3c652a7fmr5990791otu.63.1704304243187; Wed, 03 Jan 2024 09:50:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704304243; cv=none; d=google.com; s=arc-20160816; b=oPy4p8zYh2GI1PW+Rg849BAXdtTUBJdTI4tIuqu+f70wPVuPQVESmJXhvhIsv9HxcZ Zr0qbKU3RHf1yNKn+2QqilAzE6jM9RQXzHl47fd4Nu8X0TJ33Or6cOJ4eUuA/XDnsRef fcS4I/RbdI0TUqK2DePgu28rcQDQZGWy6SS6zhThHIhwV7bNZ2xIedQC4l+HWYuSVQKK bf13fcuKKDWnL+ruOqz4Vuj6DFf1VcuB6xYzSOOI/SMB5fi9FjCAOyqpcKh1cJv1cYmO mZzMgZaaiiFRnDoQbvKf3y0B6O24cEdu1LeUOFuEQj1LqXOOjuw8y2foT4dt1gqANFTF KTQQ== 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=Fv8i/ZD80zCUMWCrsFxA5ec1+Ry+9mZct9W/s18lf+Y=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=0GUTQ79OPUM25yM58YcMm7+Obwl7D9h9lsibtAOcsjDY2tWJLmQ2vRru8Sdr7oTIWf ZOMDgPDI7pR5o/TTE1iJGaJO1W/F942IXlEBXYkiSOlR71mDIfv1Vfe1HK6reb3H6KpI S+U98FTfXpyfGD2eBCNMyw/iFtw3qJi8mH8TbAKyoO/RU/ajJIBg+Yd7WA0xM9u0AbLP aKNDK/+GbErG4B5tGEr0xRUvUX5rE4TRefVOaXFoArMg3W8IRF+QJMGZALVwvdKI+xFq tgW4N4ARl0E2vRi3HAIC2+BLi+PtMIPYVNXBEVK8aD3CWf9p1GIXm9xnv5txfFvau686 p02Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G78EPmVk; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q18-20020a05622a031200b004236d74e060si29799185qtw.416.2024.01.03.09.50.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:50:43 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G78EPmVk; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5Mq-0001ef-OD; Wed, 03 Jan 2024 12:49:24 -0500 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 1rL5Mi-0000kM-Ns for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:49:16 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5Mb-0000Np-Eb for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:49:16 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40d4f5d902dso94638525e9.2 for ; Wed, 03 Jan 2024 09:49:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704304148; x=1704908948; 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=Fv8i/ZD80zCUMWCrsFxA5ec1+Ry+9mZct9W/s18lf+Y=; b=G78EPmVktKbIv9aRfMYWcGuncKKUdxZasPSjFpTgqrb+DrFgX9g2dcN/aM0RClDe+A 8hThxFFvrXbxtZjQ59YVjJcaL4d99Qec9oMBzNc5VsC4ANAu9sy4mGGHtHnHGOcd52FT xC7z4n1erfL2CRRhSkd4ymCn9KDeL655Z6Ow6RccrK2GPlt1GCgfTroWXcO3Uql13oAy HGhD7PA6g6s3przpW6aBmmoFQs08JdxN1QfRGDcDPEumPJHK+iCXkOjHhxrjsb5981U9 Kh3+DjpEoBCItbI8+sYhh9zxNuXIK69KFmyC0fX8kcP6/62GZhAjAR/scHBIQYu0+bf5 jdOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704304148; x=1704908948; 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=Fv8i/ZD80zCUMWCrsFxA5ec1+Ry+9mZct9W/s18lf+Y=; b=tYZrCo+JTZiU6wHvPm4+Q4lpwxzFemTFGAFP7nzeYt9bOT2tAj5m7EPHP4LpmmRYEN ovMWCT4Uzldv9ofWbC2lbD+FO9uGiWhwfE93kFRGgWBNzdVL81iUA5ql0cXUoTM6v4kR Nv+va3LoqhyYaBFgi7hWZBNA5OtHJrSpR1I66c9JdNv0fcVjq8+gqttfFK0cRZVogyHl s/dXm3NMR7dGZ6AS16D7tISDmoJicdPYk1iiYfYAuRKgm7QxQ99niZl9Hl8BPtMhm9SS 5x80eKeCGrdbEx2hGaoO3CP0kScIGCfL6Y7G0Cry9QXfXqc6kdzq7lVZKoK4SbGaZjI0 8cHQ== X-Gm-Message-State: AOJu0Yy7E/c9bWNMCCOBRMM1ryonlpnli4hG+vwv7cqX2JBoeK8huqfr p+p3tC72Wr5HFcjs3ybXb7zT+hd/tW3uuw== X-Received: by 2002:a1c:7718:0:b0:40d:5bf5:c8ce with SMTP id t24-20020a1c7718000000b0040d5bf5c8cemr6378521wmi.126.1704304147711; Wed, 03 Jan 2024 09:49:07 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id i15-20020a05600c354f00b0040d604dea3bsm2997934wmq.4.2024.01.03.09.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:49:05 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id A20015F932; Wed, 3 Jan 2024 17:33:51 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 25/43] target/riscv: Validate misa_mxl_max only once Date: Wed, 3 Jan 2024 17:33:31 +0000 Message-Id: <20240103173349.398526-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.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=unavailable 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: Akihiko Odaki misa_mxl_max is now a class member and initialized only once for each class. This also moves the initialization of gdb_core_xml_file which will be referenced before realization in the future. Signed-off-by: Akihiko Odaki Message-Id: <20231213-riscv-v7-4-a760156a337f@daynix.com> Signed-off-by: Alex Bennée Acked-by: Alistair Francis --- target/riscv/cpu.c | 21 +++++++++++++++++++++ target/riscv/tcg/tcg-cpu.c | 23 ----------------------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 2ab61df2217..b799f133604 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1247,6 +1247,26 @@ static const MISAExtInfo misa_ext_info_arr[] = { MISA_EXT_INFO(RVG, "g", "General purpose (IMAFD_Zicsr_Zifencei)"), }; +static void riscv_cpu_validate_misa_mxl(RISCVCPUClass *mcc) +{ + CPUClass *cc = CPU_CLASS(mcc); + + /* Validate that MISA_MXL is set properly. */ + switch (mcc->misa_mxl_max) { +#ifdef TARGET_RISCV64 + case MXL_RV64: + case MXL_RV128: + cc->gdb_core_xml_file = "riscv-64bit-cpu.xml"; + break; +#endif + case MXL_RV32: + cc->gdb_core_xml_file = "riscv-32bit-cpu.xml"; + break; + default: + g_assert_not_reached(); + } +} + static int riscv_validate_misa_info_idx(uint32_t bit) { int idx; @@ -1695,6 +1715,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) RISCVCPUClass *mcc = RISCV_CPU_CLASS(c); mcc->misa_mxl_max = (uint32_t)(uintptr_t)data; + riscv_cpu_validate_misa_mxl(mcc); } static void riscv_isa_string_ext(RISCVCPU *cpu, char **isa_str, diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index 7f6712c81a4..eb243e011ca 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -148,27 +148,6 @@ static void riscv_cpu_validate_misa_priv(CPURISCVState *env, Error **errp) } } -static void riscv_cpu_validate_misa_mxl(RISCVCPU *cpu) -{ - RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cpu); - CPUClass *cc = CPU_CLASS(mcc); - - /* Validate that MISA_MXL is set properly. */ - switch (mcc->misa_mxl_max) { -#ifdef TARGET_RISCV64 - case MXL_RV64: - case MXL_RV128: - cc->gdb_core_xml_file = "riscv-64bit-cpu.xml"; - break; -#endif - case MXL_RV32: - cc->gdb_core_xml_file = "riscv-32bit-cpu.xml"; - break; - default: - g_assert_not_reached(); - } -} - static void riscv_cpu_validate_priv_spec(RISCVCPU *cpu, Error **errp) { CPURISCVState *env = &cpu->env; @@ -676,8 +655,6 @@ static bool tcg_cpu_realize(CPUState *cs, Error **errp) return false; } - riscv_cpu_validate_misa_mxl(cpu); - #ifndef CONFIG_USER_ONLY CPURISCVState *env = &cpu->env; Error *local_err = NULL; From patchwork Wed Jan 3 17:33:32 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: 759639 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6612920wrw; Wed, 3 Jan 2024 09:41:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3CSHnFaRAsrU9mG6K3A1//WHLdlk0YGE/DEzXAqlbMG44WTFsYcQvh4TqSRksxMKM2TdZ X-Received: by 2002:a05:620a:cca:b0:781:5a44:eb20 with SMTP id b10-20020a05620a0cca00b007815a44eb20mr15219529qkj.4.1704303719720; Wed, 03 Jan 2024 09:41:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303719; cv=none; d=google.com; s=arc-20160816; b=IpbOwiCxUJoBOIJkNLkk0EOkkfFNys7adK0fwtIBLQjULT9eFFRr1hpd50oG8Nfgda JCRJh3nf00ZLpD+Yq2IV7MwdlTUbTGwrqhY0f76W/UjUfpQnDPSd9w1Uxl5rdXsAU1/e 3OS/r+Tr3m69gD7SbF5TG+8scHp65r45Zrij+77ezbtnFux0B3ii5DhZGAn5xQLrhQEQ xceBEcauNsmM4NGuEgTa0lLIyATmCoPq2mlsqPRjNE+VzD1Tn/dXAr9NgNfdYo+31aMJ cbLvltpsEpKJyJmFM7OkVu8wQMfs5cN5Yqi5EbOc2sM8ge1jZbw2OnFfc1fRJAX8WApY V7Vw== 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=grOrzf0gka3mo/fbHIYxQJeoAC26OCvqAQbocJu2LO0=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=ovuOQ6ayxfiJqSfi2RL3ggi7rwwo8+wZI0tfwlCRT8j2pD8fIFRgVUWr3ixTf39zs4 7Zoml6bim4OpCCtf2UcVjkWaV1s0fAuJ06X8JgLGw/okMZ82PK5HJIg++A6BZjxZJpiS 6JBIgeXMnGyPFcElgdA+Wg8GWzxH23hrjRJ+5TkZtM6WYYy30RZf8GH7ie0gsxGpX7Yd kg0Um/a70hfLBda68ERiZT4+XehmaE146KfNhMcSd2VRS/3Ek739Arm5hp5uvnEfrH8P n9ZI4ikGfQIPHpqcJnOaSsks2pH53BdsFwAWZ/XfNKBoBBOSOJ0XNfjv5ZT99NHqomG4 TdqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O2usBBJJ; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z3-20020a05620a08c300b00781711c066csi14054019qkz.514.2024.01.03.09.41.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:41:59 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O2usBBJJ; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5DR-0007jl-Rn; Wed, 03 Jan 2024 12:39:41 -0500 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 1rL5DQ-0007gY-04 for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:40 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5D1-0000lS-Qp for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:39 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-33687627ad0so9907591f8f.2 for ; Wed, 03 Jan 2024 09:39:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303554; x=1704908354; 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=grOrzf0gka3mo/fbHIYxQJeoAC26OCvqAQbocJu2LO0=; b=O2usBBJJySoueLdSJlLZmKyG6hUbm1+zt4exkk6wRZ7gw2OnWUgeG2R7MuglzppyGC E8jJH//qGJSy07g9fO6Vuonp2AIO+afoZ6gmv2x39mr0mOKkqcAjuEXKW3u8v5yYAK/k jyVdCD/RVCYZGtbR0OcGZPC+Kjlm/zNrkN+hquxpKDABRbLgNSekhOmUKdbduUEr3rBC 8ECX++FtsFHWI7dGzFy+SmynwJnXBB1n19yHZIswFxxWBWMjsaiskpl+CPjucXZae4um Cq30VZIMujFSg5Bn6FqRJAXzEUN3GO+XU0rvrtV02RqIReWxtlvQN9hnjcrAoofbEreN pTDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303554; x=1704908354; 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=grOrzf0gka3mo/fbHIYxQJeoAC26OCvqAQbocJu2LO0=; b=wlfqL7qMPvU8Gh9yJ8y8OMLqDEQgLQHyZhpqpILPMgSx2z3sk5dtXUaPzJc96CV3rI MpUuyCAthpisC+iqqwXn+rsCMVEjeuM6URTbp5DsiuRcdvSA3hdcO4cxR39/MyJO/2sq UwBUHS0PImnIkPs0aDh2W3LRtixU4gFNDGUgbspQnY/aDQOAptsh2s0x2N+70u/QHOp0 98Wl3zRTOWDf0cc7x/Yfsjxvkif/05WSHodTZuGjPveZTlG4ieXDD2cI5zERhNrepSe/ 3hroOIWigRx/6sylGTXiM5EI9PMjqvP2gTWZ8X94uhOvbLUVuiIH8/vbHVCAvkTFuChD 6sQw== X-Gm-Message-State: AOJu0Yy+FgWxJNLFZ53cXyJWpd4TdP0ptCISm7FSn/5xVEBzGL9PLykM AIiiiD1RbsYLYPWNAagCHSGejSw9Di7YmA== X-Received: by 2002:adf:edc2:0:b0:337:4a10:b80e with SMTP id v2-20020adfedc2000000b003374a10b80emr1087288wro.8.1704303554327; Wed, 03 Jan 2024 09:39:14 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id h15-20020a5d430f000000b0033740e109adsm7402522wrq.75.2024.01.03.09.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:39:13 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id BF7F05F957; Wed, 3 Jan 2024 17:33:51 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 26/43] target/arm: Use GDBFeature for dynamic XML Date: Wed, 3 Jan 2024 17:33:32 +0000 Message-Id: <20240103173349.398526-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.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=unavailable 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: Akihiko Odaki In preparation for a change to use GDBFeature as a parameter of gdb_register_coprocessor(), convert the internal representation of dynamic feature from plain XML to GDBFeature. Signed-off-by: Akihiko Odaki Acked-by: Richard Henderson Message-Id: <20231213-gdb-v17-1-777047380591@daynix.com> Signed-off-by: Alex Bennée --- target/arm/cpu.h | 21 +++--- target/arm/internals.h | 2 +- target/arm/gdbstub.c | 142 ++++++++++++++++++++--------------------- target/arm/gdbstub64.c | 95 +++++++++++++-------------- 4 files changed, 123 insertions(+), 137 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index a0282e0d281..b2f8ac81f06 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -25,6 +25,7 @@ #include "hw/registerfields.h" #include "cpu-qom.h" #include "exec/cpu-defs.h" +#include "exec/gdbstub.h" #include "qapi/qapi-types-common.h" /* ARM processors have a weak memory model */ @@ -136,23 +137,21 @@ enum { */ /** - * DynamicGDBXMLInfo: - * @desc: Contains the XML descriptions. - * @num: Number of the registers in this XML seen by GDB. + * DynamicGDBFeatureInfo: + * @desc: Contains the feature descriptions. * @data: A union with data specific to the set of registers * @cpregs_keys: Array that contains the corresponding Key of * a given cpreg with the same order of the cpreg * in the XML description. */ -typedef struct DynamicGDBXMLInfo { - char *desc; - int num; +typedef struct DynamicGDBFeatureInfo { + GDBFeature desc; union { struct { uint32_t *keys; } cpregs; } data; -} DynamicGDBXMLInfo; +} DynamicGDBFeatureInfo; /* CPU state for each instance of a generic timer (in cp15 c14) */ typedef struct ARMGenericTimer { @@ -878,10 +877,10 @@ struct ArchCPU { uint64_t *cpreg_vmstate_values; int32_t cpreg_vmstate_array_len; - DynamicGDBXMLInfo dyn_sysreg_xml; - DynamicGDBXMLInfo dyn_svereg_xml; - DynamicGDBXMLInfo dyn_m_systemreg_xml; - DynamicGDBXMLInfo dyn_m_secextreg_xml; + DynamicGDBFeatureInfo dyn_sysreg_feature; + DynamicGDBFeatureInfo dyn_svereg_feature; + DynamicGDBFeatureInfo dyn_m_systemreg_feature; + DynamicGDBFeatureInfo dyn_m_secextreg_feature; /* Timers used by the generic (architected) timer */ QEMUTimer *gt_timer[NUM_GTIMERS]; diff --git a/target/arm/internals.h b/target/arm/internals.h index 143d57c0fe4..1136710741f 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1446,7 +1446,7 @@ static inline uint64_t pmu_counter_mask(CPUARMState *env) } #ifdef TARGET_AARCH64 -int arm_gen_dynamic_svereg_xml(CPUState *cpu, int base_reg); +GDBFeature *arm_gen_dynamic_svereg_feature(CPUState *cpu, int base_reg); int aarch64_gdb_get_sve_reg(CPUARMState *env, GByteArray *buf, int reg); int aarch64_gdb_set_sve_reg(CPUARMState *env, uint8_t *buf, int reg); int aarch64_gdb_get_fpu_reg(CPUARMState *env, GByteArray *buf, int reg); diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c index 28f546a5ff9..5949adfb31a 100644 --- a/target/arm/gdbstub.c +++ b/target/arm/gdbstub.c @@ -26,11 +26,11 @@ #include "cpu-features.h" #include "cpregs.h" -typedef struct RegisterSysregXmlParam { +typedef struct RegisterSysregFeatureParam { CPUState *cs; - GString *s; + GDBFeatureBuilder builder; int n; -} RegisterSysregXmlParam; +} RegisterSysregFeatureParam; /* Old gdb always expect FPA registers. Newer (xml-aware) gdb only expect whatever the target description contains. Due to a historical mishap @@ -216,7 +216,7 @@ static int arm_gdb_get_sysreg(CPUARMState *env, GByteArray *buf, int reg) const ARMCPRegInfo *ri; uint32_t key; - key = cpu->dyn_sysreg_xml.data.cpregs.keys[reg]; + key = cpu->dyn_sysreg_feature.data.cpregs.keys[reg]; ri = get_arm_cp_reginfo(cpu->cp_regs, key); if (ri) { if (cpreg_field_is_64bit(ri)) { @@ -233,34 +233,32 @@ static int arm_gdb_set_sysreg(CPUARMState *env, uint8_t *buf, int reg) return 0; } -static void arm_gen_one_xml_sysreg_tag(GString *s, DynamicGDBXMLInfo *dyn_xml, +static void arm_gen_one_feature_sysreg(GDBFeatureBuilder *builder, + DynamicGDBFeatureInfo *dyn_feature, ARMCPRegInfo *ri, uint32_t ri_key, - int bitsize, int regnum) + int bitsize, int n) { - g_string_append_printf(s, "name); - g_string_append_printf(s, " bitsize=\"%d\"", bitsize); - g_string_append_printf(s, " regnum=\"%d\"", regnum); - g_string_append_printf(s, " group=\"cp_regs\"/>"); - dyn_xml->data.cpregs.keys[dyn_xml->num] = ri_key; - dyn_xml->num++; + gdb_feature_builder_append_reg(builder, ri->name, bitsize, n, + "int", "cp_regs"); + + dyn_feature->data.cpregs.keys[n] = ri_key; } -static void arm_register_sysreg_for_xml(gpointer key, gpointer value, - gpointer p) +static void arm_register_sysreg_for_feature(gpointer key, gpointer value, + gpointer p) { uint32_t ri_key = (uintptr_t)key; ARMCPRegInfo *ri = value; - RegisterSysregXmlParam *param = (RegisterSysregXmlParam *)p; - GString *s = param->s; + RegisterSysregFeatureParam *param = p; ARMCPU *cpu = ARM_CPU(param->cs); CPUARMState *env = &cpu->env; - DynamicGDBXMLInfo *dyn_xml = &cpu->dyn_sysreg_xml; + DynamicGDBFeatureInfo *dyn_feature = &cpu->dyn_sysreg_feature; if (!(ri->type & (ARM_CP_NO_RAW | ARM_CP_NO_GDB))) { if (arm_feature(env, ARM_FEATURE_AARCH64)) { if (ri->state == ARM_CP_STATE_AA64) { - arm_gen_one_xml_sysreg_tag(s , dyn_xml, ri, ri_key, 64, - param->n++); + arm_gen_one_feature_sysreg(¶m->builder, dyn_feature, + ri, ri_key, 64, param->n++); } } else { if (ri->state == ARM_CP_STATE_AA32) { @@ -269,32 +267,32 @@ static void arm_register_sysreg_for_xml(gpointer key, gpointer value, return; } if (ri->type & ARM_CP_64BIT) { - arm_gen_one_xml_sysreg_tag(s , dyn_xml, ri, ri_key, 64, - param->n++); + arm_gen_one_feature_sysreg(¶m->builder, dyn_feature, + ri, ri_key, 64, param->n++); } else { - arm_gen_one_xml_sysreg_tag(s , dyn_xml, ri, ri_key, 32, - param->n++); + arm_gen_one_feature_sysreg(¶m->builder, dyn_feature, + ri, ri_key, 32, param->n++); } } } } } -static int arm_gen_dynamic_sysreg_xml(CPUState *cs, int base_reg) +static GDBFeature *arm_gen_dynamic_sysreg_feature(CPUState *cs, int base_reg) { ARMCPU *cpu = ARM_CPU(cs); - GString *s = g_string_new(NULL); - RegisterSysregXmlParam param = {cs, s, base_reg}; - - cpu->dyn_sysreg_xml.num = 0; - cpu->dyn_sysreg_xml.data.cpregs.keys = g_new(uint32_t, g_hash_table_size(cpu->cp_regs)); - g_string_printf(s, ""); - g_string_append_printf(s, ""); - g_string_append_printf(s, ""); - g_hash_table_foreach(cpu->cp_regs, arm_register_sysreg_for_xml, ¶m); - g_string_append_printf(s, ""); - cpu->dyn_sysreg_xml.desc = g_string_free(s, false); - return cpu->dyn_sysreg_xml.num; + RegisterSysregFeatureParam param = {cs}; + gsize num_regs = g_hash_table_size(cpu->cp_regs); + + gdb_feature_builder_init(¶m.builder, + &cpu->dyn_sysreg_feature.desc, + "org.qemu.gdb.arm.sys.regs", + "system-registers.xml", + base_reg); + cpu->dyn_sysreg_feature.data.cpregs.keys = g_new(uint32_t, num_regs); + g_hash_table_foreach(cpu->cp_regs, arm_register_sysreg_for_feature, ¶m); + gdb_feature_builder_end(¶m.builder); + return &cpu->dyn_sysreg_feature.desc; } #ifdef CONFIG_TCG @@ -386,31 +384,29 @@ static int arm_gdb_set_m_systemreg(CPUARMState *env, uint8_t *buf, int reg) return 0; /* TODO */ } -static int arm_gen_dynamic_m_systemreg_xml(CPUState *cs, int orig_base_reg) +static GDBFeature *arm_gen_dynamic_m_systemreg_feature(CPUState *cs, + int base_reg) { ARMCPU *cpu = ARM_CPU(cs); CPUARMState *env = &cpu->env; - GString *s = g_string_new(NULL); - int base_reg = orig_base_reg; + GDBFeatureBuilder builder; + int reg = 0; int i; - g_string_printf(s, ""); - g_string_append_printf(s, ""); - g_string_append_printf(s, "\n"); + gdb_feature_builder_init(&builder, &cpu->dyn_m_systemreg_feature.desc, + "org.gnu.gdb.arm.m-system", "arm-m-system.xml", + base_reg); for (i = 0; i < ARRAY_SIZE(m_sysreg_def); i++) { if (arm_feature(env, m_sysreg_def[i].feature)) { - g_string_append_printf(s, - "\n", - m_sysreg_def[i].name, base_reg++); + gdb_feature_builder_append_reg(&builder, m_sysreg_def[i].name, 32, + reg++, "int", NULL); } } - g_string_append_printf(s, ""); - cpu->dyn_m_systemreg_xml.desc = g_string_free(s, false); - cpu->dyn_m_systemreg_xml.num = base_reg - orig_base_reg; + gdb_feature_builder_end(&builder); - return cpu->dyn_m_systemreg_xml.num; + return &cpu->dyn_m_systemreg_feature.desc; } #ifndef CONFIG_USER_ONLY @@ -428,31 +424,31 @@ static int arm_gdb_set_m_secextreg(CPUARMState *env, uint8_t *buf, int reg) return 0; /* TODO */ } -static int arm_gen_dynamic_m_secextreg_xml(CPUState *cs, int orig_base_reg) +static GDBFeature *arm_gen_dynamic_m_secextreg_feature(CPUState *cs, + int base_reg) { ARMCPU *cpu = ARM_CPU(cs); - GString *s = g_string_new(NULL); - int base_reg = orig_base_reg; + GDBFeatureBuilder builder; + char *name; + int reg = 0; int i; - g_string_printf(s, ""); - g_string_append_printf(s, ""); - g_string_append_printf(s, "\n"); + gdb_feature_builder_init(&builder, &cpu->dyn_m_secextreg_feature.desc, + "org.gnu.gdb.arm.secext", "arm-m-secext.xml", + base_reg); for (i = 0; i < ARRAY_SIZE(m_sysreg_def); i++) { - g_string_append_printf(s, - "\n", - m_sysreg_def[i].name, base_reg++); - g_string_append_printf(s, - "\n", - m_sysreg_def[i].name, base_reg++); + name = g_strconcat(m_sysreg_def[i].name, "_ns", NULL); + gdb_feature_builder_append_reg(&builder, name, 32, reg++, + "int", NULL); + name = g_strconcat(m_sysreg_def[i].name, "_s", NULL); + gdb_feature_builder_append_reg(&builder, name, 32, reg++, + "int", NULL); } - g_string_append_printf(s, ""); - cpu->dyn_m_secextreg_xml.desc = g_string_free(s, false); - cpu->dyn_m_secextreg_xml.num = base_reg - orig_base_reg; + gdb_feature_builder_end(&builder); - return cpu->dyn_m_secextreg_xml.num; + return &cpu->dyn_m_secextreg_feature.desc; } #endif #endif /* CONFIG_TCG */ @@ -462,14 +458,14 @@ const char *arm_gdb_get_dynamic_xml(CPUState *cs, const char *xmlname) ARMCPU *cpu = ARM_CPU(cs); if (strcmp(xmlname, "system-registers.xml") == 0) { - return cpu->dyn_sysreg_xml.desc; + return cpu->dyn_sysreg_feature.desc.xml; } else if (strcmp(xmlname, "sve-registers.xml") == 0) { - return cpu->dyn_svereg_xml.desc; + return cpu->dyn_svereg_feature.desc.xml; } else if (strcmp(xmlname, "arm-m-system.xml") == 0) { - return cpu->dyn_m_systemreg_xml.desc; + return cpu->dyn_m_systemreg_feature.desc.xml; #ifndef CONFIG_USER_ONLY } else if (strcmp(xmlname, "arm-m-secext.xml") == 0) { - return cpu->dyn_m_secextreg_xml.desc; + return cpu->dyn_m_secextreg_feature.desc.xml; #endif } return NULL; @@ -487,7 +483,7 @@ void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu) */ #ifdef TARGET_AARCH64 if (isar_feature_aa64_sve(&cpu->isar)) { - int nreg = arm_gen_dynamic_svereg_xml(cs, cs->gdb_num_regs); + int nreg = arm_gen_dynamic_svereg_feature(cs, cs->gdb_num_regs)->num_regs; gdb_register_coprocessor(cs, aarch64_gdb_get_sve_reg, aarch64_gdb_set_sve_reg, nreg, "sve-registers.xml", 0); @@ -533,20 +529,20 @@ void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu) 1, "arm-m-profile-mve.xml", 0); } gdb_register_coprocessor(cs, arm_gdb_get_sysreg, arm_gdb_set_sysreg, - arm_gen_dynamic_sysreg_xml(cs, cs->gdb_num_regs), + arm_gen_dynamic_sysreg_feature(cs, cs->gdb_num_regs)->num_regs, "system-registers.xml", 0); #ifdef CONFIG_TCG if (arm_feature(env, ARM_FEATURE_M) && tcg_enabled()) { gdb_register_coprocessor(cs, arm_gdb_get_m_systemreg, arm_gdb_set_m_systemreg, - arm_gen_dynamic_m_systemreg_xml(cs, cs->gdb_num_regs), + arm_gen_dynamic_m_systemreg_feature(cs, cs->gdb_num_regs)->num_regs, "arm-m-system.xml", 0); #ifndef CONFIG_USER_ONLY if (arm_feature(env, ARM_FEATURE_M_SECURITY)) { gdb_register_coprocessor(cs, arm_gdb_get_m_secextreg, arm_gdb_set_m_secextreg, - arm_gen_dynamic_m_secextreg_xml(cs, cs->gdb_num_regs), + arm_gen_dynamic_m_secextreg_feature(cs, cs->gdb_num_regs)->num_regs, "arm-m-secext.xml", 0); } #endif diff --git a/target/arm/gdbstub64.c b/target/arm/gdbstub64.c index d7b79a6589b..5286d5c6043 100644 --- a/target/arm/gdbstub64.c +++ b/target/arm/gdbstub64.c @@ -247,7 +247,7 @@ int aarch64_gdb_set_pauth_reg(CPUARMState *env, uint8_t *buf, int reg) return 0; } -static void output_vector_union_type(GString *s, int reg_width, +static void output_vector_union_type(GDBFeatureBuilder *builder, int reg_width, const char *name) { struct TypeSize { @@ -282,10 +282,10 @@ static void output_vector_union_type(GString *s, int reg_width, /* First define types and totals in a whole VL */ for (i = 0; i < ARRAY_SIZE(vec_lanes); i++) { - g_string_append_printf(s, - "", - name, vec_lanes[i].sz, vec_lanes[i].suffix, - vec_lanes[i].gdb_type, reg_width / vec_lanes[i].size); + gdb_feature_builder_append_tag( + builder, "", + name, vec_lanes[i].sz, vec_lanes[i].suffix, + vec_lanes[i].gdb_type, reg_width / vec_lanes[i].size); } /* @@ -296,86 +296,77 @@ static void output_vector_union_type(GString *s, int reg_width, for (i = 0; i < ARRAY_SIZE(suf); i++) { int bits = 8 << i; - g_string_append_printf(s, "", name, suf[i]); + gdb_feature_builder_append_tag(builder, "", + name, suf[i]); for (j = 0; j < ARRAY_SIZE(vec_lanes); j++) { if (vec_lanes[j].size == bits) { - g_string_append_printf(s, "", - vec_lanes[j].suffix, name, - vec_lanes[j].sz, vec_lanes[j].suffix); + gdb_feature_builder_append_tag( + builder, "", + vec_lanes[j].suffix, name, + vec_lanes[j].sz, vec_lanes[j].suffix); } } - g_string_append(s, ""); + gdb_feature_builder_append_tag(builder, ""); } /* And now the final union of unions */ - g_string_append_printf(s, "", name); + gdb_feature_builder_append_tag(builder, "", name); for (i = ARRAY_SIZE(suf) - 1; i >= 0; i--) { - g_string_append_printf(s, "", - suf[i], name, suf[i]); + gdb_feature_builder_append_tag(builder, + "", + suf[i], name, suf[i]); } - g_string_append(s, ""); + gdb_feature_builder_append_tag(builder, ""); } -int arm_gen_dynamic_svereg_xml(CPUState *cs, int orig_base_reg) +GDBFeature *arm_gen_dynamic_svereg_feature(CPUState *cs, int base_reg) { ARMCPU *cpu = ARM_CPU(cs); - GString *s = g_string_new(NULL); - DynamicGDBXMLInfo *info = &cpu->dyn_svereg_xml; int reg_width = cpu->sve_max_vq * 128; int pred_width = cpu->sve_max_vq * 16; - int base_reg = orig_base_reg; + GDBFeatureBuilder builder; + char *name; + int reg = 0; int i; - g_string_printf(s, ""); - g_string_append_printf(s, ""); - g_string_append_printf(s, ""); + gdb_feature_builder_init(&builder, &cpu->dyn_svereg_feature.desc, + "org.gnu.gdb.aarch64.sve", "sve-registers.xml", + base_reg); /* Create the vector union type. */ - output_vector_union_type(s, reg_width, "svev"); + output_vector_union_type(&builder, reg_width, "svev"); /* Create the predicate vector type. */ - g_string_append_printf(s, - "", - pred_width / 8); + gdb_feature_builder_append_tag( + &builder, "", + pred_width / 8); /* Define the vector registers. */ for (i = 0; i < 32; i++) { - g_string_append_printf(s, - "", - i, reg_width, base_reg++); + name = g_strdup_printf("z%d", i); + gdb_feature_builder_append_reg(&builder, name, reg_width, reg++, + "svev", NULL); } /* fpscr & status registers */ - g_string_append_printf(s, "", base_reg++); - g_string_append_printf(s, "", base_reg++); + gdb_feature_builder_append_reg(&builder, "fpsr", 32, reg++, + "int", "float"); + gdb_feature_builder_append_reg(&builder, "fpcr", 32, reg++, + "int", "float"); /* Define the predicate registers. */ for (i = 0; i < 16; i++) { - g_string_append_printf(s, - "", - i, pred_width, base_reg++); + name = g_strdup_printf("p%d", i); + gdb_feature_builder_append_reg(&builder, name, pred_width, reg++, + "svep", NULL); } - g_string_append_printf(s, - "", - pred_width, base_reg++); + gdb_feature_builder_append_reg(&builder, "ffr", pred_width, reg++, + "svep", "vector"); /* Define the vector length pseudo-register. */ - g_string_append_printf(s, - "", - base_reg++); + gdb_feature_builder_append_reg(&builder, "vg", 64, reg++, "int", NULL); - g_string_append_printf(s, ""); + gdb_feature_builder_end(&builder); - info->desc = g_string_free(s, false); - info->num = base_reg - orig_base_reg; - return info->num; + return &cpu->dyn_svereg_feature.desc; } From patchwork Wed Jan 3 17:33:33 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: 759620 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6610952wrw; Wed, 3 Jan 2024 09:37:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZpvZvPdmXZSRV6Ib0KwOLHMGbG5+pyDmMOvtLR87lmhXAFRDWbXaponKLdcWOTtPVVc/H X-Received: by 2002:a05:6808:1283:b0:3bb:cddf:4258 with SMTP id a3-20020a056808128300b003bbcddf4258mr16894448oiw.62.1704303425058; Wed, 03 Jan 2024 09:37:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303425; cv=none; d=google.com; s=arc-20160816; b=dCBafu1UAFbPplaC1pX0aaJQTGHyazdQF2OHD8ooIUdbFJz4kgj+k7Ve8Dq6Ssj1lE 3wC1tKUv/ig3UcSABOud1VBDSpI64cpndGA1uuGDRt6JcyhYUSMtGOmRgU/RdThixGrh wFiMaBEM4fsgj1hA6Ck1mZ8Q1+iFdQhfsad8OzVZK8lqa4q9ipAU0R75gW1LNtiZu9m0 cSGHRClvMehtleeWRjo5WMvXgOd0pmWpLqbhqzEihb2f2yxhxtH6dNFMCUAi4dmPDg5C Q3KVD5IFn6eZAbdnvMMUYREKDOy+4DJgydBNtBxrBCFVEPLMeC3mOZrc5rkxfDGDg2bc Gz1Q== 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=jmYJ2fC1lZn0rQD/zyego8qIqXmQTboU/MlKw2VVHwg=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=ntJq9n9aYSzgLtEVw2nAZa/A3Qxx6nJUUsHcjDzbS5P4Yw/+DQCOjhGmv27rWgY++g BS/Dr9HXrrARVFbnrGzK7RcPEsCGrfPpDydpSU2OAs9QZLjUHGdDYtnh7sByeUU9CvFx fJIzd2ZomzlpbbKMjvQ4d/09o70kaXT8nYaA1xUaIBW0iV4nDnQmMTPqOVxTv1pd2kq+ mKhAp8tpPpMSlMkzWbXsr+2RDEEpOOmA+byMqFEC1XHbOu6BwbhMaAOwDMlNGMb0m9X3 IeZuGn597YWLqUR1dq0coR26PVmRDBKjKA4HyfPhQvcg0kbbpNjQw/FJE50V1i7ovE50 rcZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SV4oGXXK; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z15-20020a0cf24f000000b0067f65b8f3e7si29801863qvl.315.2024.01.03.09.37.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:37:05 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SV4oGXXK; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58c-00046i-4w; Wed, 03 Jan 2024 12:34:43 -0500 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 1rL58N-0003vW-PE for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:27 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL584-0002XQ-1f for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:27 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40b5155e154so138758745e9.3 for ; Wed, 03 Jan 2024 09:34:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303245; x=1704908045; 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=jmYJ2fC1lZn0rQD/zyego8qIqXmQTboU/MlKw2VVHwg=; b=SV4oGXXKV8ceqjyCgDydaMUeX/s/VoYyfszV2nH4LDfDGkaknsjy16hL5HeFoHJZY0 60zqvcyLPsasDYYxIoz8OseDsV8uF/C4Sl8hLq7LxQzWFRj1g4H0ddOr1t6b5aROm8YW Ri9Hp0sy3t75OV1LxCiTdRn1WdoYsZE3TCGnzHBc4+dqOmvryqDw4PdiliqU8aahf0cQ DpE0Z50GwoH47ZT6SF7bXuxYORiqmfDEe0nY5S9PbutFNm7Kh0gjz1Y1mB9UBLhBlGyU 3O0akA8DKGpW7zLnMU6ljJxvD6kn7DqfO/nuka8MdgQyGjn7zFLOlcrQLqEqwtH+iLPS VuPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303245; x=1704908045; 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=jmYJ2fC1lZn0rQD/zyego8qIqXmQTboU/MlKw2VVHwg=; b=aL7i5g9mmKmP9V1VuHGTyVwOC5rGXzdz70uJJ8qgtQ/8RpC12M3OSTLak07BfY5tXt 9GJUQ7rnM5aHP2rGPqDytRXIE+xD9PlppaDpHZ/okirONJpjY+bW72jmCaAJZrIavZKx Xxm/XDzsgWHhMOqtet00ZHZV6oOeRrdD/vwicvDPSmVOMj9l7/wuVaVGThkbS59RRCKA SSoRiWnO+FepAn6IzVu4U5/XV7fKFWFUGVF50v+zXZzWF5xEWwdzDQILEo7dM1cGsZcz fvG/8qdy1GObGAD8m7OaD9Z2ocaC5jmnkHPFkFh4D/0Ead9g2EoJ1L4loDo0trpmt7+h cTrw== X-Gm-Message-State: AOJu0YzxSAVa4wH0e0IVJgp6E0GJCBTUed7gWN66ZA5bB1ndupFTkolq JlOufJzUlCjgtbHdcmvcdZqWCnK7UDXjTQ== X-Received: by 2002:a05:600c:3212:b0:409:79cb:1df6 with SMTP id r18-20020a05600c321200b0040979cb1df6mr10062086wmp.14.1704303245186; Wed, 03 Jan 2024 09:34:05 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id bg40-20020a05600c3ca800b0040d87b5a87csm2886253wmb.48.2024.01.03.09.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:34:02 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D8A215F95A; Wed, 3 Jan 2024 17:33:51 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 27/43] target/ppc: Use GDBFeature for dynamic XML Date: Wed, 3 Jan 2024 17:33:33 +0000 Message-Id: <20240103173349.398526-28-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.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=unavailable 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: Akihiko Odaki In preparation for a change to use GDBFeature as a parameter of gdb_register_coprocessor(), convert the internal representation of dynamic feature from plain XML to GDBFeature. Signed-off-by: Akihiko Odaki Reviewed-by: Richard Henderson Message-Id: <20231213-gdb-v17-2-777047380591@daynix.com> Signed-off-by: Alex Bennée --- target/ppc/cpu-qom.h | 1 + target/ppc/cpu.h | 4 +--- target/ppc/cpu_init.c | 4 ---- target/ppc/gdbstub.c | 51 ++++++++++++++++--------------------------- 4 files changed, 21 insertions(+), 39 deletions(-) diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index 0241609efef..8247fa23367 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -20,6 +20,7 @@ #ifndef QEMU_PPC_CPU_QOM_H #define QEMU_PPC_CPU_QOM_H +#include "exec/gdbstub.h" #include "hw/core/cpu.h" #ifdef TARGET_PPC64 diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index f8101ffa296..f87c26f98a6 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1471,8 +1471,7 @@ struct PowerPCCPUClass { int bfd_mach; uint32_t l1_dcache_size, l1_icache_size; #ifndef CONFIG_USER_ONLY - unsigned int gdb_num_sprs; - const char *gdb_spr_xml; + GDBFeature gdb_spr; #endif const PPCHash64Options *hash64_opts; struct ppc_radix_page_info *radix_page_info; @@ -1525,7 +1524,6 @@ int ppc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); int ppc_cpu_gdb_write_register_apple(CPUState *cpu, uint8_t *buf, int reg); #ifndef CONFIG_USER_ONLY hwaddr ppc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); -void ppc_gdb_gen_spr_xml(PowerPCCPU *cpu); const char *ppc_gdb_get_dynamic_xml(CPUState *cs, const char *xml_name); #endif int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 40fe14a6c25..a0178c3ce80 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -6682,10 +6682,6 @@ static void init_ppc_proc(PowerPCCPU *cpu) /* PowerPC implementation specific initialisations (SPRs, timers, ...) */ (*pcc->init_proc)(env); -#if !defined(CONFIG_USER_ONLY) - ppc_gdb_gen_spr_xml(cpu); -#endif - /* MSR bits & flags consistency checks */ if (env->msr_mask & (1 << 25)) { switch (env->flags & (POWERPC_FLAG_SPE | POWERPC_FLAG_VRE)) { diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c index ec5731e5d67..e3be3dbd109 100644 --- a/target/ppc/gdbstub.c +++ b/target/ppc/gdbstub.c @@ -300,15 +300,23 @@ int ppc_cpu_gdb_write_register_apple(CPUState *cs, uint8_t *mem_buf, int n) } #ifndef CONFIG_USER_ONLY -void ppc_gdb_gen_spr_xml(PowerPCCPU *cpu) +static void gdb_gen_spr_feature(CPUState *cs) { - PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu); + PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cs); + PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; - GString *xml; - char *spr_name; + GDBFeatureBuilder builder; unsigned int num_regs = 0; int i; + if (pcc->gdb_spr.xml) { + return; + } + + gdb_feature_builder_init(&builder, &pcc->gdb_spr, + "org.qemu.power.spr", "power-spr.xml", + cs->gdb_num_regs); + for (i = 0; i < ARRAY_SIZE(env->spr_cb); i++) { ppc_spr_t *spr = &env->spr_cb[i]; @@ -326,35 +334,13 @@ void ppc_gdb_gen_spr_xml(PowerPCCPU *cpu) */ spr->gdb_id = num_regs; num_regs++; - } - - if (pcc->gdb_spr_xml) { - return; - } - xml = g_string_new(""); - g_string_append(xml, ""); - g_string_append(xml, ""); - - for (i = 0; i < ARRAY_SIZE(env->spr_cb); i++) { - ppc_spr_t *spr = &env->spr_cb[i]; - - if (!spr->name) { - continue; - } - - spr_name = g_ascii_strdown(spr->name, -1); - g_string_append_printf(xml, ""); + gdb_feature_builder_append_reg(&builder, g_ascii_strdown(spr->name, -1), + TARGET_LONG_BITS, num_regs, + "int", "spr"); } - g_string_append(xml, ""); - - pcc->gdb_num_sprs = num_regs; - pcc->gdb_spr_xml = g_string_free(xml, false); + gdb_feature_builder_end(&builder); } const char *ppc_gdb_get_dynamic_xml(CPUState *cs, const char *xml_name) @@ -362,7 +348,7 @@ const char *ppc_gdb_get_dynamic_xml(CPUState *cs, const char *xml_name) PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cs); if (strcmp(xml_name, "power-spr.xml") == 0) { - return pcc->gdb_spr_xml; + return pcc->gdb_spr.xml; } return NULL; } @@ -599,7 +585,8 @@ void ppc_gdb_init(CPUState *cs, PowerPCCPUClass *pcc) 32, "power-vsx.xml", 0); } #ifndef CONFIG_USER_ONLY + gdb_gen_spr_feature(cs); gdb_register_coprocessor(cs, gdb_get_spr_reg, gdb_set_spr_reg, - pcc->gdb_num_sprs, "power-spr.xml", 0); + pcc->gdb_spr.num_regs, "power-spr.xml", 0); #endif } From patchwork Wed Jan 3 17:33:34 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: 759619 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6610945wrw; Wed, 3 Jan 2024 09:37:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IGl7HLA18JQYe71JLkqQXltEClg/6e4yYVIiTt47HrAuI7q90g/GA3kBUGL6mNPMj7c4aGv X-Received: by 2002:ad4:5c6a:0:b0:67f:2e75:3682 with SMTP id i10-20020ad45c6a000000b0067f2e753682mr26502598qvh.128.1704303423971; Wed, 03 Jan 2024 09:37:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303423; cv=none; d=google.com; s=arc-20160816; b=IX+C0TIhEVBcPN+wKTHHMs7s6UzSRM6xi55nUvb5odKumlZWs+RW+S/D2CpWUbrq7y JKy141hhfWZnsPPkuyo7Vh+E3vF3XI6N3kGiYT1jRPTI0+s3Zojzjukl6TaXnGe2K/Sp WTAvniHXVkAi4gjAUHBelMqct0Ww8aR8n87P16gSy98Qg7Mqy3+kg/xFcmWjKWWbsZQu iLhVZvVX/H0YRoUyhoomeK07X+4FC9oes0WLxpVq135EvToMny03z7lNnqp2RS+uy3A3 IjOaGuCpIvOrmeM2+15gr+m9LmT8QCFt6iuph8VIlDILc29oDVbiEAbuysmKzfqQgGPe //7A== 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=7D67tYXvih4KCwe2bBHgIjHHJeamoItQznsN6YA9Vd8=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=PYs02+xNa8+TbztyqAAnARhyo3Z9FLVLx48YW+YKsHm9zn9j2VMUYdihhMH/JslxUf W2pTHE1tGXq+KrNXJocHeVjteE8R37Jico62cda782FAdDJLZmSgqeww1FEf7MZzXEtS 5QgQzyyNHYhdB1Lg1NLDSpVhTfmBpHDfaty0QMGYYY66mSGmv45OvKAUuX+jtT68wUQl vk74CQXMmxdZo6rAcUrl/Y450zK2x2piKJAlENQIo7LGAo8sgPWeyduUqO8FI4Cb6mk7 8ecaO3xnDEhQ9AezKJyEmBNdUplz8rCY/CoPqAVxqkzmkB5QkhQe2a6Wa2Ek+11r35Ch 6fnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MFFXzJIf; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h6-20020a0cf446000000b0067f7071032csi6263402qvm.466.2024.01.03.09.37.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:37:03 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MFFXzJIf; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL59J-0005Sx-1s; Wed, 03 Jan 2024 12:35:25 -0500 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 1rL58g-0004FJ-2h for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:48 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL585-0002Yj-Rx for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:41 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40d3c4bfe45so111702225e9.1 for ; Wed, 03 Jan 2024 09:34:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303247; x=1704908047; 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=7D67tYXvih4KCwe2bBHgIjHHJeamoItQznsN6YA9Vd8=; b=MFFXzJIf55q9r0T+r5NolrJywjR80gmS2XBoakBnt/i7D6pEbltPJJlvojH3GPs6Z0 Iz5K1jz9E5pvvSYTfPqNwua2ICcqtPwPsnd9sKcIdbfNWtXgUdLyVHMWNCpIzK0JHSA9 0I9dQUXnP9orHAoijwDn/CjXH03/f/5xd8SyIyKG0kA2E5L6eKLyQUMemYER/er9vIjy TEVzanPvznl9A4Yf0Q+NQMu00L36lPEtswNoSWws+zOYFzm7FGxtsieK0TjZq+EVNK4S V7nay6aIAo0zBvSfQHOaMvgKuGdM4c0r+KoSF+rAyUjswT5HxXWfkMbJZ31I/xy5vD// WwLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303247; x=1704908047; 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=7D67tYXvih4KCwe2bBHgIjHHJeamoItQznsN6YA9Vd8=; b=lH48YL3EmssUStbziM+IcYT6rWFT4fJWW5q8Cx4b3P//qBya5ZyO+/LtllfnxHJUSv 2fQt/uFCtKMJKAiuqCtvvCPSHyVqf6ch+jzsGpRe3MP5+ra/sRfuXLCYauEJlSs3DO/W LRWvzHw3Wyh2p+xb6q4yRAVnzfTkxuzFv4CB3flF1c4nthAExWmmVNJrZxatsCQO9NYV JqevOa+4R/D2p4bNf9dDnpQmhwYdezD4rqpWvHKRQ4QOPzSlIE5CoBNJ5jCshdGsLhfA cuPQjdSsWZvLafTEKpNVjh34/rgsrCpxHHt4FAVE4FqrUywDp5p2ddnr9NfhBotsswH7 /ndA== X-Gm-Message-State: AOJu0YzUuza9MB0O/ZGlZYtWdXrF99d51odOqj8JcgEPSaelU6DW3uPy ZdDm5rUElm7WhY/pmWm8IDE1sutOdjwVfw== X-Received: by 2002:a05:600c:22c3:b0:40d:6085:b90 with SMTP id 3-20020a05600c22c300b0040d60850b90mr2702772wmg.363.1704303247304; Wed, 03 Jan 2024 09:34:07 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p15-20020a05600c1d8f00b0040d6eb44b94sm2957663wms.2.2024.01.03.09.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:34:02 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id EF90E5F95C; Wed, 3 Jan 2024 17:33:51 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 28/43] target/riscv: Use GDBFeature for dynamic XML Date: Wed, 3 Jan 2024 17:33:34 +0000 Message-Id: <20240103173349.398526-29-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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=unavailable 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: Akihiko Odaki In preparation for a change to use GDBFeature as a parameter of gdb_register_coprocessor(), convert the internal representation of dynamic feature from plain XML to GDBFeature. Signed-off-by: Akihiko Odaki Message-Id: <20231213-gdb-v17-3-777047380591@daynix.com> Signed-off-by: Alex Bennée --- target/riscv/cpu.h | 5 +-- target/riscv/cpu.c | 4 +-- target/riscv/gdbstub.c | 79 +++++++++++++++++++----------------------- 3 files changed, 40 insertions(+), 48 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 060b7f69a74..ad7236d7547 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -24,6 +24,7 @@ #include "hw/registerfields.h" #include "hw/qdev-properties.h" #include "exec/cpu-defs.h" +#include "exec/gdbstub.h" #include "qemu/cpu-float.h" #include "qom/object.h" #include "qemu/int128.h" @@ -424,8 +425,8 @@ struct ArchCPU { CPURISCVState env; - char *dyn_csr_xml; - char *dyn_vreg_xml; + GDBFeature dyn_csr_feature; + GDBFeature dyn_vreg_feature; /* Configuration Settings */ RISCVCPUConfig cfg; diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index b799f133604..673e937a5d8 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1534,9 +1534,9 @@ static const char *riscv_gdb_get_dynamic_xml(CPUState *cs, const char *xmlname) RISCVCPU *cpu = RISCV_CPU(cs); if (strcmp(xmlname, "riscv-csr.xml") == 0) { - return cpu->dyn_csr_xml; + return cpu->dyn_csr_feature.xml; } else if (strcmp(xmlname, "riscv-vector.xml") == 0) { - return cpu->dyn_vreg_xml; + return cpu->dyn_vreg_feature.xml; } return NULL; diff --git a/target/riscv/gdbstub.c b/target/riscv/gdbstub.c index 365040228a1..76b72a95954 100644 --- a/target/riscv/gdbstub.c +++ b/target/riscv/gdbstub.c @@ -214,13 +214,14 @@ static int riscv_gdb_set_virtual(CPURISCVState *cs, uint8_t *mem_buf, int n) return 0; } -static int riscv_gen_dynamic_csr_xml(CPUState *cs, int base_reg) +static GDBFeature *riscv_gen_dynamic_csr_feature(CPUState *cs, int base_reg) { RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cs); RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; - GString *s = g_string_new(NULL); + GDBFeatureBuilder builder; riscv_csr_predicate_fn predicate; + const char *name; int bitsize = 16 << mcc->misa_mxl_max; int i; @@ -233,9 +234,9 @@ static int riscv_gen_dynamic_csr_xml(CPUState *cs, int base_reg) bitsize = 64; } - g_string_printf(s, ""); - g_string_append_printf(s, ""); - g_string_append_printf(s, ""); + gdb_feature_builder_init(&builder, &cpu->dyn_csr_feature, + "org.gnu.gdb.riscv.csr", "riscv-csr.xml", + base_reg); for (i = 0; i < CSR_TABLE_SIZE; i++) { if (env->priv_ver < csr_ops[i].min_priv_ver) { @@ -243,72 +244,64 @@ static int riscv_gen_dynamic_csr_xml(CPUState *cs, int base_reg) } predicate = csr_ops[i].predicate; if (predicate && (predicate(env, i) == RISCV_EXCP_NONE)) { - if (csr_ops[i].name) { - g_string_append_printf(s, "", base_reg + i); + + gdb_feature_builder_append_reg(&builder, name, bitsize, i, + "int", NULL); } } - g_string_append_printf(s, ""); - - cpu->dyn_csr_xml = g_string_free(s, false); + gdb_feature_builder_end(&builder); #if !defined(CONFIG_USER_ONLY) env->debugger = false; #endif - return CSR_TABLE_SIZE; + return &cpu->dyn_csr_feature; } -static int ricsv_gen_dynamic_vector_xml(CPUState *cs, int base_reg) +static GDBFeature *ricsv_gen_dynamic_vector_feature(CPUState *cs, int base_reg) { RISCVCPU *cpu = RISCV_CPU(cs); - GString *s = g_string_new(NULL); - g_autoptr(GString) ts = g_string_new(""); + GDBFeatureBuilder builder; int reg_width = cpu->cfg.vlen; - int num_regs = 0; int i; - g_string_printf(s, ""); - g_string_append_printf(s, ""); - g_string_append_printf(s, ""); + gdb_feature_builder_init(&builder, &cpu->dyn_vreg_feature, + "org.gnu.gdb.riscv.vector", "riscv-vector.xml", + base_reg); /* First define types and totals in a whole VL */ for (i = 0; i < ARRAY_SIZE(vec_lanes); i++) { int count = reg_width / vec_lanes[i].size; - g_string_printf(ts, "%s", vec_lanes[i].id); - g_string_append_printf(s, - "", - ts->str, vec_lanes[i].gdb_type, count); + gdb_feature_builder_append_tag( + &builder, "", + vec_lanes[i].id, vec_lanes[i].gdb_type, count); } /* Define unions */ - g_string_append_printf(s, ""); + gdb_feature_builder_append_tag(&builder, ""); for (i = 0; i < ARRAY_SIZE(vec_lanes); i++) { - g_string_append_printf(s, "", - vec_lanes[i].suffix, - vec_lanes[i].id); + gdb_feature_builder_append_tag(&builder, + "", + vec_lanes[i].suffix, vec_lanes[i].id); } - g_string_append(s, ""); + gdb_feature_builder_append_tag(&builder, ""); /* Define vector registers */ for (i = 0; i < 32; i++) { - g_string_append_printf(s, - "", - i, reg_width, base_reg++); - num_regs++; + gdb_feature_builder_append_reg(&builder, g_strdup_printf("v%d", i), + reg_width, i, "riscv_vector", "vector"); } - g_string_append_printf(s, ""); + gdb_feature_builder_end(&builder); - cpu->dyn_vreg_xml = g_string_free(s, false); - return num_regs; + return &cpu->dyn_vreg_feature; } void riscv_cpu_register_gdb_regs_for_features(CPUState *cs) @@ -324,10 +317,9 @@ void riscv_cpu_register_gdb_regs_for_features(CPUState *cs) 32, "riscv-32bit-fpu.xml", 0); } if (env->misa_ext & RVV) { - int base_reg = cs->gdb_num_regs; gdb_register_coprocessor(cs, riscv_gdb_get_vector, riscv_gdb_set_vector, - ricsv_gen_dynamic_vector_xml(cs, base_reg), + ricsv_gen_dynamic_vector_feature(cs, cs->gdb_num_regs)->num_regs, "riscv-vector.xml", 0); } switch (mcc->misa_mxl_max) { @@ -347,9 +339,8 @@ void riscv_cpu_register_gdb_regs_for_features(CPUState *cs) } if (cpu->cfg.ext_zicsr) { - int base_reg = cs->gdb_num_regs; gdb_register_coprocessor(cs, riscv_gdb_get_csr, riscv_gdb_set_csr, - riscv_gen_dynamic_csr_xml(cs, base_reg), + riscv_gen_dynamic_csr_feature(cs, cs->gdb_num_regs)->num_regs, "riscv-csr.xml", 0); } } From patchwork Wed Jan 3 17:33:35 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: 759633 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6612109wrw; Wed, 3 Jan 2024 09:40:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IEFCX5TESxYKJbT+wbvfGKHs4tdgwUVhy3CAeL99ll0yXamgQq4p3bUzRNax4ADPYNpHNbD X-Received: by 2002:a05:622a:4cb:b0:427:ea31:e81d with SMTP id q11-20020a05622a04cb00b00427ea31e81dmr14990496qtx.64.1704303600808; Wed, 03 Jan 2024 09:40:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303600; cv=none; d=google.com; s=arc-20160816; b=JhuukH/T5oRRDU4fi2724bZEv14HvevYNVIfG+7OhOLKFkjIUvCRKnPLsZacNEh5Rb k8yAXV0lpYhKB2F1ie0yoF77o0dhnw78orm+JwZvx5wRFLDrovbWK+wJ0zA+9AOIuAlU BOy11gWYDblZofEZzlceiRAvzJw1T+G3y++53f6Q9oMHeAdjpDSJfr8o782KnHmYutkY NNpE91tYLR6H3Ncu5M8t1Jb8DujIjM+i8yp5raVjJImP2RcxvsJbUBOKeBnk5mK5Kdbk uWMg3mwjV8o8zhb5jq9KAprwmRCIAS6KOu/PLL2B2GRzm4F9qfEZ7B76ksgvCO79CxKO fIQA== 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=yyzb1060eIKZjEB6vFAQrFyjnWMUmf7w7Vsll32FTpM=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=0vcfvsZhiTdN88b93fCieWzCJmNc6qNEOQystJ7F9+Goh7ZNeJjvB4tGArio6RBbCd WEOehXJgoK6nd0RWuUz/kB7iA/0I64vm07tBgL5Z3KxIiqKG9bZTcAU21zg8KTV2csw3 oVVZkNS7YQVDoBPn4wmyFQy+7NQSyPnnZTT0LoJPNqSGCvXxN/3YlA++5bR8Y/Bg0SNt zx+ghOFVfuQBB2yXE6yMst8CEMq48jZEKBrOBY8WarCKG8kGo0XKRTEvYeuj3KOa55kx SJdTf3vOPQ03ed3xrDyJ1k57ebuCOzTeSE13iiuZUZbSu4TEPK67XgQD98oGn6O1Sc2e evVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lggtbI4U; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n1-20020ac85a01000000b004254e5138fesi29784920qta.260.2024.01.03.09.40.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:40:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lggtbI4U; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5DS-0007mX-Qi; Wed, 03 Jan 2024 12:39:42 -0500 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 1rL5DL-0007LE-11 for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:35 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5D0-0000kX-P2 for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:34 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40d3c4bfe45so111752175e9.1 for ; Wed, 03 Jan 2024 09:39:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303553; x=1704908353; 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=yyzb1060eIKZjEB6vFAQrFyjnWMUmf7w7Vsll32FTpM=; b=lggtbI4UhRO2tYluwQdndXfQAFLf8KmnmBbjqqP7zz0yEBU6iXMP6pEwagZao4Vy8W Ns8n6ZXZBlvs0FcR+i9h4twdcguGUNTJ4PmLbSTBJwupA4jzsa6pkQ1VF0jFdd/QK/pR TgunWDDovBUebenuZBzkA7CN8YjN3xoLEzpBkD9LhySzcrRcbBibLRSEbaMajwa093N3 yYHCv5RgXZ35qxHx20AfdYm1Xs+d3uKCiI41Is45l0W1hIU5m5DqrlO327D91BYNpulQ G+dKMNi/vqDIvr+/mNdBq7UdNMuEnbALT4TKBNtvBtALKgOEHRQG6TB2ilOPgORCjdUk 2BEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303553; x=1704908353; 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=yyzb1060eIKZjEB6vFAQrFyjnWMUmf7w7Vsll32FTpM=; b=oG78ZMeULbxWwRnjAgYXar/h84SrIJ/Zlisa7tzvfl+TJubdAUm+e5IvtlEKlqA8Ot JycOmuy4Edo/KdbTGlCfWGAOQ8bZEH5+8eFdjVxLNLs0lZG5CCRsf2S67Aa/d5bz1Vsp Y0ca1I4r9sAsgQC58X/vDqki9AQ2Ne9DBr07BgqcHMjeodDst2lc5KRMGF0PR29UXgbv b0CenKI0OvndErEZWkql7cEXof6bsvNoE5iv/FFuNWx+by/DKOSawSQmoMp1HCgAQuzO XngM30VywOworE+/xSMx+rioZUztxjzk/ebSLax4c6bNqYGazzvj3P6oQaSmwxfy3aql kfVQ== X-Gm-Message-State: AOJu0YxJO5/PqdiduetcOLs6HaQUQfS62Vf/uO8tQCsu2AlsYwRebW7R K6g5ZrUGgFW6VolRmBTCns/AnV5jjNj5aw== X-Received: by 2002:a05:600c:4f0d:b0:40d:898d:5c7e with SMTP id l13-20020a05600c4f0d00b0040d898d5c7emr1124944wmq.237.1704303553284; Wed, 03 Jan 2024 09:39:13 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z6-20020a05600c0a0600b0040b3d8907fesm2978340wmp.29.2024.01.03.09.39.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:39:08 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 1EB645F9CB; Wed, 3 Jan 2024 17:33:52 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 29/43] gdbstub: Use GDBFeature for gdb_register_coprocessor Date: Wed, 3 Jan 2024 17:33:35 +0000 Message-Id: <20240103173349.398526-30-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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=unavailable 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: Akihiko Odaki This is a tree-wide change to introduce GDBFeature parameter to gdb_register_coprocessor(). The new parameter just replaces num_regs and xml parameters for now. GDBFeature will be utilized to simplify XML lookup in a following change. Signed-off-by: Akihiko Odaki Acked-by: Alex Bennée Message-Id: <20231213-gdb-v17-4-777047380591@daynix.com> Signed-off-by: Alex Bennée --- include/exec/gdbstub.h | 2 +- gdbstub/gdbstub.c | 13 +++++++------ target/arm/gdbstub.c | 35 +++++++++++++++++++---------------- target/hexagon/cpu.c | 3 +-- target/loongarch/gdbstub.c | 2 +- target/m68k/helper.c | 6 +++--- target/microblaze/cpu.c | 5 +++-- target/ppc/gdbstub.c | 11 ++++++----- target/riscv/gdbstub.c | 20 ++++++++++++-------- target/s390x/gdbstub.c | 28 +++++++--------------------- 10 files changed, 60 insertions(+), 65 deletions(-) diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index d8a3c56fa2b..ac6fce99a64 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -38,7 +38,7 @@ typedef int (*gdb_set_reg_cb)(CPUArchState *env, uint8_t *buf, int reg); */ void gdb_register_coprocessor(CPUState *cpu, gdb_get_reg_cb get_reg, gdb_set_reg_cb set_reg, - int num_regs, const char *xml, int g_pos); + const GDBFeature *feature, int g_pos); /** * gdbserver_start: start the gdb server diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 46d752bbc2c..068180c83c7 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -544,7 +544,7 @@ static int gdb_write_register(CPUState *cpu, uint8_t *mem_buf, int reg) void gdb_register_coprocessor(CPUState *cpu, gdb_get_reg_cb get_reg, gdb_set_reg_cb set_reg, - int num_regs, const char *xml, int g_pos) + const GDBFeature *feature, int g_pos) { GDBRegisterState *s; guint i; @@ -553,7 +553,7 @@ void gdb_register_coprocessor(CPUState *cpu, for (i = 0; i < cpu->gdb_regs->len; i++) { /* Check for duplicates. */ s = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); - if (strcmp(s->xml, xml) == 0) { + if (strcmp(s->xml, feature->xmlname) == 0) { return; } } @@ -565,17 +565,18 @@ void gdb_register_coprocessor(CPUState *cpu, g_array_set_size(cpu->gdb_regs, i + 1); s = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); s->base_reg = cpu->gdb_num_regs; - s->num_regs = num_regs; + s->num_regs = feature->num_regs; s->get_reg = get_reg; s->set_reg = set_reg; - s->xml = xml; + s->xml = feature->xml; /* Add to end of list. */ - cpu->gdb_num_regs += num_regs; + cpu->gdb_num_regs += feature->num_regs; if (g_pos) { if (g_pos != s->base_reg) { error_report("Error: Bad gdb register numbering for '%s', " - "expected %d got %d", xml, g_pos, s->base_reg); + "expected %d got %d", feature->xml, + g_pos, s->base_reg); } else { cpu->gdb_num_g_regs = cpu->gdb_num_regs; } diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c index 5949adfb31a..f2b201d3125 100644 --- a/target/arm/gdbstub.c +++ b/target/arm/gdbstub.c @@ -483,14 +483,14 @@ void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu) */ #ifdef TARGET_AARCH64 if (isar_feature_aa64_sve(&cpu->isar)) { - int nreg = arm_gen_dynamic_svereg_feature(cs, cs->gdb_num_regs)->num_regs; + GDBFeature *feature = arm_gen_dynamic_svereg_feature(cs, cs->gdb_num_regs); gdb_register_coprocessor(cs, aarch64_gdb_get_sve_reg, - aarch64_gdb_set_sve_reg, nreg, - "sve-registers.xml", 0); + aarch64_gdb_set_sve_reg, feature, 0); } else { gdb_register_coprocessor(cs, aarch64_gdb_get_fpu_reg, aarch64_gdb_set_fpu_reg, - 34, "aarch64-fpu.xml", 0); + gdb_find_static_feature("aarch64-fpu.xml"), + 0); } /* * Note that we report pauth information via the feature name @@ -501,19 +501,22 @@ void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu) if (isar_feature_aa64_pauth(&cpu->isar)) { gdb_register_coprocessor(cs, aarch64_gdb_get_pauth_reg, aarch64_gdb_set_pauth_reg, - 4, "aarch64-pauth.xml", 0); + gdb_find_static_feature("aarch64-pauth.xml"), + 0); } #endif } else { if (arm_feature(env, ARM_FEATURE_NEON)) { gdb_register_coprocessor(cs, vfp_gdb_get_reg, vfp_gdb_set_reg, - 49, "arm-neon.xml", 0); + gdb_find_static_feature("arm-neon.xml"), + 0); } else if (cpu_isar_feature(aa32_simd_r32, cpu)) { gdb_register_coprocessor(cs, vfp_gdb_get_reg, vfp_gdb_set_reg, - 33, "arm-vfp3.xml", 0); + gdb_find_static_feature("arm-vfp3.xml"), + 0); } else if (cpu_isar_feature(aa32_vfp_simd, cpu)) { gdb_register_coprocessor(cs, vfp_gdb_get_reg, vfp_gdb_set_reg, - 17, "arm-vfp.xml", 0); + gdb_find_static_feature("arm-vfp.xml"), 0); } if (!arm_feature(env, ARM_FEATURE_M)) { /* @@ -521,29 +524,29 @@ void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu) * expose to gdb. */ gdb_register_coprocessor(cs, vfp_gdb_get_sysreg, vfp_gdb_set_sysreg, - 2, "arm-vfp-sysregs.xml", 0); + gdb_find_static_feature("arm-vfp-sysregs.xml"), + 0); } } if (cpu_isar_feature(aa32_mve, cpu) && tcg_enabled()) { gdb_register_coprocessor(cs, mve_gdb_get_reg, mve_gdb_set_reg, - 1, "arm-m-profile-mve.xml", 0); + gdb_find_static_feature("arm-m-profile-mve.xml"), + 0); } gdb_register_coprocessor(cs, arm_gdb_get_sysreg, arm_gdb_set_sysreg, - arm_gen_dynamic_sysreg_feature(cs, cs->gdb_num_regs)->num_regs, - "system-registers.xml", 0); + arm_gen_dynamic_sysreg_feature(cs, cs->gdb_num_regs), + 0); #ifdef CONFIG_TCG if (arm_feature(env, ARM_FEATURE_M) && tcg_enabled()) { gdb_register_coprocessor(cs, arm_gdb_get_m_systemreg, arm_gdb_set_m_systemreg, - arm_gen_dynamic_m_systemreg_feature(cs, cs->gdb_num_regs)->num_regs, - "arm-m-system.xml", 0); + arm_gen_dynamic_m_systemreg_feature(cs, cs->gdb_num_regs), 0); #ifndef CONFIG_USER_ONLY if (arm_feature(env, ARM_FEATURE_M_SECURITY)) { gdb_register_coprocessor(cs, arm_gdb_get_m_secextreg, arm_gdb_set_m_secextreg, - arm_gen_dynamic_m_secextreg_feature(cs, cs->gdb_num_regs)->num_regs, - "arm-m-secext.xml", 0); + arm_gen_dynamic_m_secextreg_feature(cs, cs->gdb_num_regs), 0); } #endif } diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index 9d1ffc3b4bb..65ac9c75ad0 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -341,8 +341,7 @@ static void hexagon_cpu_realize(DeviceState *dev, Error **errp) gdb_register_coprocessor(cs, hexagon_hvx_gdb_read_register, hexagon_hvx_gdb_write_register, - NUM_VREGS + NUM_QREGS, - "hexagon-hvx.xml", 0); + gdb_find_static_feature("hexagon-hvx.xml"), 0); qemu_init_vcpu(cs); cpu_reset(cs); diff --git a/target/loongarch/gdbstub.c b/target/loongarch/gdbstub.c index 5fc2f19e965..843a869450e 100644 --- a/target/loongarch/gdbstub.c +++ b/target/loongarch/gdbstub.c @@ -118,5 +118,5 @@ static int loongarch_gdb_set_fpu(CPULoongArchState *env, void loongarch_cpu_register_gdb_regs_for_features(CPUState *cs) { gdb_register_coprocessor(cs, loongarch_gdb_get_fpu, loongarch_gdb_set_fpu, - 41, "loongarch-fpu.xml", 0); + gdb_find_static_feature("loongarch-fpu.xml"), 0); } diff --git a/target/m68k/helper.c b/target/m68k/helper.c index 0a1544cd68d..675f2dcd5ad 100644 --- a/target/m68k/helper.c +++ b/target/m68k/helper.c @@ -152,10 +152,10 @@ void m68k_cpu_init_gdb(M68kCPU *cpu) if (m68k_feature(env, M68K_FEATURE_CF_FPU)) { gdb_register_coprocessor(cs, cf_fpu_gdb_get_reg, cf_fpu_gdb_set_reg, - 11, "cf-fp.xml", 18); + gdb_find_static_feature("cf-fp.xml"), 18); } else if (m68k_feature(env, M68K_FEATURE_FPU)) { - gdb_register_coprocessor(cs, m68k_fpu_gdb_get_reg, - m68k_fpu_gdb_set_reg, 11, "m68k-fp.xml", 18); + gdb_register_coprocessor(cs, m68k_fpu_gdb_get_reg, m68k_fpu_gdb_set_reg, + gdb_find_static_feature("m68k-fp.xml"), 18); } /* TODO: Add [E]MAC registers. */ } diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index bbb3335cadd..1998f69828f 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -297,8 +297,9 @@ static void mb_cpu_initfn(Object *obj) CPUMBState *env = &cpu->env; gdb_register_coprocessor(CPU(cpu), mb_cpu_gdb_read_stack_protect, - mb_cpu_gdb_write_stack_protect, 2, - "microblaze-stack-protect.xml", 0); + mb_cpu_gdb_write_stack_protect, + gdb_find_static_feature("microblaze-stack-protect.xml"), + 0); set_float_rounding_mode(float_round_nearest_even, &env->fp_status); diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c index e3be3dbd109..09b852464f3 100644 --- a/target/ppc/gdbstub.c +++ b/target/ppc/gdbstub.c @@ -570,23 +570,24 @@ void ppc_gdb_init(CPUState *cs, PowerPCCPUClass *pcc) { if (pcc->insns_flags & PPC_FLOAT) { gdb_register_coprocessor(cs, gdb_get_float_reg, gdb_set_float_reg, - 33, "power-fpu.xml", 0); + gdb_find_static_feature("power-fpu.xml"), 0); } if (pcc->insns_flags & PPC_ALTIVEC) { gdb_register_coprocessor(cs, gdb_get_avr_reg, gdb_set_avr_reg, - 34, "power-altivec.xml", 0); + gdb_find_static_feature("power-altivec.xml"), + 0); } if (pcc->insns_flags & PPC_SPE) { gdb_register_coprocessor(cs, gdb_get_spe_reg, gdb_set_spe_reg, - 34, "power-spe.xml", 0); + gdb_find_static_feature("power-spe.xml"), 0); } if (pcc->insns_flags2 & PPC2_VSX) { gdb_register_coprocessor(cs, gdb_get_vsx_reg, gdb_set_vsx_reg, - 32, "power-vsx.xml", 0); + gdb_find_static_feature("power-vsx.xml"), 0); } #ifndef CONFIG_USER_ONLY gdb_gen_spr_feature(cs); gdb_register_coprocessor(cs, gdb_get_spr_reg, gdb_set_spr_reg, - pcc->gdb_spr.num_regs, "power-spr.xml", 0); + &pcc->gdb_spr, 0); #endif } diff --git a/target/riscv/gdbstub.c b/target/riscv/gdbstub.c index 76b72a95954..a879869fa1a 100644 --- a/target/riscv/gdbstub.c +++ b/target/riscv/gdbstub.c @@ -311,28 +311,32 @@ void riscv_cpu_register_gdb_regs_for_features(CPUState *cs) CPURISCVState *env = &cpu->env; if (env->misa_ext & RVD) { gdb_register_coprocessor(cs, riscv_gdb_get_fpu, riscv_gdb_set_fpu, - 32, "riscv-64bit-fpu.xml", 0); + gdb_find_static_feature("riscv-64bit-fpu.xml"), + 0); } else if (env->misa_ext & RVF) { gdb_register_coprocessor(cs, riscv_gdb_get_fpu, riscv_gdb_set_fpu, - 32, "riscv-32bit-fpu.xml", 0); + gdb_find_static_feature("riscv-32bit-fpu.xml"), + 0); } if (env->misa_ext & RVV) { gdb_register_coprocessor(cs, riscv_gdb_get_vector, riscv_gdb_set_vector, - ricsv_gen_dynamic_vector_feature(cs, cs->gdb_num_regs)->num_regs, - "riscv-vector.xml", 0); + ricsv_gen_dynamic_vector_feature(cs, cs->gdb_num_regs), + 0); } switch (mcc->misa_mxl_max) { case MXL_RV32: gdb_register_coprocessor(cs, riscv_gdb_get_virtual, riscv_gdb_set_virtual, - 1, "riscv-32bit-virtual.xml", 0); + gdb_find_static_feature("riscv-32bit-virtual.xml"), + 0); break; case MXL_RV64: case MXL_RV128: gdb_register_coprocessor(cs, riscv_gdb_get_virtual, riscv_gdb_set_virtual, - 1, "riscv-64bit-virtual.xml", 0); + gdb_find_static_feature("riscv-64bit-virtual.xml"), + 0); break; default: g_assert_not_reached(); @@ -340,7 +344,7 @@ void riscv_cpu_register_gdb_regs_for_features(CPUState *cs) if (cpu->cfg.ext_zicsr) { gdb_register_coprocessor(cs, riscv_gdb_get_csr, riscv_gdb_set_csr, - riscv_gen_dynamic_csr_feature(cs, cs->gdb_num_regs)->num_regs, - "riscv-csr.xml", 0); + riscv_gen_dynamic_csr_feature(cs, cs->gdb_num_regs), + 0); } } diff --git a/target/s390x/gdbstub.c b/target/s390x/gdbstub.c index 6fbfd41bc86..02c388dc323 100644 --- a/target/s390x/gdbstub.c +++ b/target/s390x/gdbstub.c @@ -69,8 +69,6 @@ int s390_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) /* the values represent the positions in s390-acr.xml */ #define S390_A0_REGNUM 0 #define S390_A15_REGNUM 15 -/* total number of registers in s390-acr.xml */ -#define S390_NUM_AC_REGS 16 static int cpu_read_ac_reg(CPUS390XState *env, GByteArray *buf, int n) { @@ -98,8 +96,6 @@ static int cpu_write_ac_reg(CPUS390XState *env, uint8_t *mem_buf, int n) #define S390_FPC_REGNUM 0 #define S390_F0_REGNUM 1 #define S390_F15_REGNUM 16 -/* total number of registers in s390-fpr.xml */ -#define S390_NUM_FP_REGS 17 static int cpu_read_fp_reg(CPUS390XState *env, GByteArray *buf, int n) { @@ -132,8 +128,6 @@ static int cpu_write_fp_reg(CPUS390XState *env, uint8_t *mem_buf, int n) #define S390_V15L_REGNUM 15 #define S390_V16_REGNUM 16 #define S390_V31_REGNUM 31 -/* total number of registers in s390-vx.xml */ -#define S390_NUM_VREGS 32 static int cpu_read_vreg(CPUS390XState *env, GByteArray *buf, int n) { @@ -172,8 +166,6 @@ static int cpu_write_vreg(CPUS390XState *env, uint8_t *mem_buf, int n) /* the values represent the positions in s390-cr.xml */ #define S390_C0_REGNUM 0 #define S390_C15_REGNUM 15 -/* total number of registers in s390-cr.xml */ -#define S390_NUM_C_REGS 16 #ifndef CONFIG_USER_ONLY static int cpu_read_c_reg(CPUS390XState *env, GByteArray *buf, int n) @@ -206,8 +198,6 @@ static int cpu_write_c_reg(CPUS390XState *env, uint8_t *mem_buf, int n) #define S390_VIRT_CPUTM_REGNUM 1 #define S390_VIRT_BEA_REGNUM 2 #define S390_VIRT_PREFIX_REGNUM 3 -/* total number of registers in s390-virt.xml */ -#define S390_NUM_VIRT_REGS 4 static int cpu_read_virt_reg(CPUS390XState *env, GByteArray *mem_buf, int n) { @@ -254,8 +244,6 @@ static int cpu_write_virt_reg(CPUS390XState *env, uint8_t *mem_buf, int n) #define S390_VIRT_KVM_PFT_REGNUM 1 #define S390_VIRT_KVM_PFS_REGNUM 2 #define S390_VIRT_KVM_PFC_REGNUM 3 -/* total number of registers in s390-virt-kvm.xml */ -#define S390_NUM_VIRT_KVM_REGS 4 static int cpu_read_virt_kvm_reg(CPUS390XState *env, GByteArray *mem_buf, int n) { @@ -303,8 +291,6 @@ static int cpu_write_virt_kvm_reg(CPUS390XState *env, uint8_t *mem_buf, int n) #define S390_GS_GSD_REGNUM 1 #define S390_GS_GSSM_REGNUM 2 #define S390_GS_GSEPLA_REGNUM 3 -/* total number of registers in s390-gs.xml */ -#define S390_NUM_GS_REGS 4 static int cpu_read_gs_reg(CPUS390XState *env, GByteArray *buf, int n) { @@ -322,33 +308,33 @@ void s390_cpu_gdb_init(CPUState *cs) { gdb_register_coprocessor(cs, cpu_read_ac_reg, cpu_write_ac_reg, - S390_NUM_AC_REGS, "s390-acr.xml", 0); + gdb_find_static_feature("s390-acr.xml"), 0); gdb_register_coprocessor(cs, cpu_read_fp_reg, cpu_write_fp_reg, - S390_NUM_FP_REGS, "s390-fpr.xml", 0); + gdb_find_static_feature("s390-fpr.xml"), 0); gdb_register_coprocessor(cs, cpu_read_vreg, cpu_write_vreg, - S390_NUM_VREGS, "s390-vx.xml", 0); + gdb_find_static_feature("s390-vx.xml"), 0); gdb_register_coprocessor(cs, cpu_read_gs_reg, cpu_write_gs_reg, - S390_NUM_GS_REGS, "s390-gs.xml", 0); + gdb_find_static_feature("s390-gs.xml"), 0); #ifndef CONFIG_USER_ONLY gdb_register_coprocessor(cs, cpu_read_c_reg, cpu_write_c_reg, - S390_NUM_C_REGS, "s390-cr.xml", 0); + gdb_find_static_feature("s390-cr.xml"), 0); gdb_register_coprocessor(cs, cpu_read_virt_reg, cpu_write_virt_reg, - S390_NUM_VIRT_REGS, "s390-virt.xml", 0); + gdb_find_static_feature("s390-virt.xml"), 0); if (kvm_enabled()) { gdb_register_coprocessor(cs, cpu_read_virt_kvm_reg, cpu_write_virt_kvm_reg, - S390_NUM_VIRT_KVM_REGS, "s390-virt-kvm.xml", + gdb_find_static_feature("s390-virt-kvm.xml"), 0); } #endif From patchwork Wed Jan 3 17:33:36 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: 759647 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6615262wrw; Wed, 3 Jan 2024 09:48:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IE18nKVea1c+4LaBCbCTTGsWCWCFACt2wPrr1Y/bbqRXKlDLqtf9Rra30srlhmM/ogbKCWj X-Received: by 2002:a05:6808:2105:b0:3bc:1584:308a with SMTP id r5-20020a056808210500b003bc1584308amr3443427oiw.104.1704304111590; Wed, 03 Jan 2024 09:48:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704304111; cv=none; d=google.com; s=arc-20160816; b=t+zpLOzR3S4xAoPDvdoUdG1rERQNwzzxxYkS5myU1GGea0KJblIMmN7LNKt7VbSrvZ NT2v8ZQTZClcrLITjZpiL74UZdK/S36ZI5QqI5SND+LR4CP/t6V0/SK1QybQBl5zdafW jJg59YQzIR5G4Sa/NHU33KgzVmtyjF+t6psbkhLUuXwJahtKlrwSLdrZ5q2aagnQSmsY U4JfHzguQZpYXfjAs0K3ZwkXoPK03h/4eW2mU93/vtTwCURdCkpCrQbp39fFL7LtH8jh nrF6k826B7JQ1DR5qKQcpZefC3P+eBQK3249ARw+dNfuXxmk4+CZmo5YDJlpVs3WkWPy bXhw== 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=TgDW5VAJqq7zKC6xI7H/BZAKg5Ps7sHcrddcH+tFs60=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=hl5ZpEAaLEug2L5nsOweMWzjKkyPDf163B8uzVB56EvFUDCrXLbkdEqcVABLw5pKZ3 1hFcL2SGBg6NTXPX6tzP2utoBteZtP1KFH9nXKFeCjCsTIBCsLFmIw48zW7XCbu/drA0 XggeE2b7BXgIXfZyDWXel5qZZwFMX9D7j8r8nNgfVw7iBsgxmTK6qyFQ/fE3n1NteFX3 lBwc7aWRRJEbPmlaXS88sYBYErM1XgVHryWDOETIag2He3zHxNzKkBkKg8zpc9kWsHrI msmfUGpncA6uF8BRAvIcVtqO7oDpkf3W0ktRvUGRxGMwpVYoNgCVSTUhp/f5mUeCSSD7 N2KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xaybZ25a; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g29-20020a0caadd000000b00680d46d3a88si339873qvb.587.2024.01.03.09.48.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:48:31 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xaybZ25a; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5De-0008Ia-Me; Wed, 03 Jan 2024 12:39:54 -0500 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 1rL5DU-0007rK-SZ for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:44 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5D0-0000hp-8p for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:44 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-33723ad790cso4120253f8f.1 for ; Wed, 03 Jan 2024 09:39:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303552; x=1704908352; 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=TgDW5VAJqq7zKC6xI7H/BZAKg5Ps7sHcrddcH+tFs60=; b=xaybZ25a5sbfByqKrUUH63hT/sTyYWYwrttHo61ZwQo4PPwaR4ll/kzCnNlkgPesI8 cY2xWyMFk5CHnjvreTqP2D0N04lcFUHcsR4nmhs/L3k2X9RltTkyUm2i2oXJTR8iftc+ WJAOwKhrTzVn+5hQB3wEv5OoZnn4cX1Y2Nmaz4eI5DUfPV0drqZ3FTLzdYPxR7L3/Wz9 1mFk+tAEH2uCiovbpaMZ4QWzuMgsPjX3nNmKTufR0MiufHm20Zyt/rVyRldzn0MIbvKi xq0FZ0oLRlH3RJ/CFh/zNwIWB18v4NEhyOLu9UsrVG0i4mbAdZEomEZV52grQQOCYEi7 4TyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303552; x=1704908352; 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=TgDW5VAJqq7zKC6xI7H/BZAKg5Ps7sHcrddcH+tFs60=; b=HeZ8Cu2ES13LB4AYxb2Qmnbcp2fOT3yp6Xm8BebpMiO5xVlPsUNxW3gcqoDutqM83m pllXKxAp/L9xMJvei+FJe9EiQwgeikirMNUnYbAlHVssBiQWajkkf8imuji7QIwLgrMy NfCgwDrKsK4QLdm02DjfMjyEa2F58A4hOK3GqU7Cb4YKftk8GP8tBqo5oRbdscB72ddi +Kc/HMzVIHrBrm7KO5V/ZX2iiYv8wmwMCiPtVrt8p9WtDBswcTl1j9jtlsDOlmqhXNZC b0qWMJ5jDIchV2w9OSPhHYEjqzoNXvy+WBQSE7iA2MBa/IKaq5Qe25lUjDkb247jkAJf l2NQ== X-Gm-Message-State: AOJu0YzzS0kmhmkHfwy88pPTENg6iXEbm3XI4JeU6QkFo4NEKOsj9YWQ AJeKncaPquBDbe4tcmkI62+m2u143PNM1Q== X-Received: by 2002:a5d:6789:0:b0:336:566e:ffdc with SMTP id v9-20020a5d6789000000b00336566effdcmr6879484wru.101.1704303552300; Wed, 03 Jan 2024 09:39:12 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m12-20020adffe4c000000b0033677aae2e2sm30939987wrs.107.2024.01.03.09.39.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:39:08 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 383255F9CC; Wed, 3 Jan 2024 17:33:52 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 30/43] gdbstub: Use GDBFeature for GDBRegisterState Date: Wed, 3 Jan 2024 17:33:36 +0000 Message-Id: <20240103173349.398526-31-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.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_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=unavailable 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: Akihiko Odaki Simplify GDBRegisterState by replacing num_regs and xml members with one member that points to GDBFeature. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée Message-Id: <20231213-gdb-v17-5-777047380591@daynix.com> Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- gdbstub/gdbstub.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 068180c83c7..a80729436b6 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -47,10 +47,9 @@ typedef struct GDBRegisterState { int base_reg; - int num_regs; gdb_get_reg_cb get_reg; gdb_set_reg_cb set_reg; - const char *xml; + const GDBFeature *feature; } GDBRegisterState; GDBState gdbserver_state; @@ -391,7 +390,7 @@ static const char *get_feature_xml(const char *p, const char **newp, g_ptr_array_add( xml, g_markup_printf_escaped("", - r->xml)); + r->feature->xmlname)); } } g_ptr_array_add(xml, g_strdup("")); @@ -513,7 +512,7 @@ static int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) if (cpu->gdb_regs) { for (guint i = 0; i < cpu->gdb_regs->len; i++) { r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); - if (r->base_reg <= reg && reg < r->base_reg + r->num_regs) { + if (r->base_reg <= reg && reg < r->base_reg + r->feature->num_regs) { return r->get_reg(env, buf, reg - r->base_reg); } } @@ -534,7 +533,7 @@ static int gdb_write_register(CPUState *cpu, uint8_t *mem_buf, int reg) if (cpu->gdb_regs) { for (guint i = 0; i < cpu->gdb_regs->len; i++) { r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); - if (r->base_reg <= reg && reg < r->base_reg + r->num_regs) { + if (r->base_reg <= reg && reg < r->base_reg + r->feature->num_regs) { return r->set_reg(env, mem_buf, reg - r->base_reg); } } @@ -553,7 +552,7 @@ void gdb_register_coprocessor(CPUState *cpu, for (i = 0; i < cpu->gdb_regs->len; i++) { /* Check for duplicates. */ s = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); - if (strcmp(s->xml, feature->xmlname) == 0) { + if (s->feature == feature) { return; } } @@ -565,10 +564,9 @@ void gdb_register_coprocessor(CPUState *cpu, g_array_set_size(cpu->gdb_regs, i + 1); s = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); s->base_reg = cpu->gdb_num_regs; - s->num_regs = feature->num_regs; s->get_reg = get_reg; s->set_reg = set_reg; - s->xml = feature->xml; + s->feature = feature; /* Add to end of list. */ cpu->gdb_num_regs += feature->num_regs; From patchwork Wed Jan 3 17:33:37 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: 759625 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6611245wrw; Wed, 3 Jan 2024 09:37:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IEiE3d1+4S3KPoAVgeXQSF2tVM6kptDWG9WMpIQqwn3Mzv7WWz7ppdlkgCcWBuY6O0DpNUs X-Received: by 2002:a05:622a:1a0b:b0:428:34ef:7f49 with SMTP id f11-20020a05622a1a0b00b0042834ef7f49mr2015442qtb.124.1704303463737; Wed, 03 Jan 2024 09:37:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303463; cv=none; d=google.com; s=arc-20160816; b=Aik5EXrg3F1DaMy+VkCPVqBh3pFaLiJI7rxC7mhM2/siBHXHEAAoXAQxdLU3sUin0E 7hvcDZ4w3IVgtKCacj4Epu7MUHTMebRBRj9tpTjx02ZYepoo6lXZT/bXctQdCnZKouNA mdGXXNO6zPhsXhwRUkhPsNYcZ2xbgS/v2m2wlPO6bx4lHoyx8m7RfXtFvwSKdtkwZ8QA JltR1xp0PpJoe2NSxtJc8QTIqrGLCXlS+Iz9Xb2xBVo7SywsWbHyb1WK1FPUzcxym9vV g6LtUcdpexmZ9z9lZS5dDkzaUIRbdMYHP8HAAMjlSm8o4nrKykCHH/b3NzhZBIs76lib K85g== 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=ONXHbuvgkX4+WGf27zULd0XcConb0bPoQ1zwOoJUCD8=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=FMFxx9FZjP9K0HN3XeKfOmFbQSza0LJJUBNNWU4YWczLNAg2LCUuczeWvsctEldfoU YmswrQX4lHwZDHb2TJzr92yWO43fxOksHaGs58FxPNOaj0GKhfyyqilQwn6c2EZycMNf 4iljFKx57jtIGTDRZ1QiyrKbYOzkQumlAPJLykaoKrFhx7ySncXv5+IOmhzZlogUg99d UimfN6FYn/Pz4P7riTarD3dmjiWyGbUZ0TGk8s8kKiP78Fr6jziQ5iIaRHAmYMNJTG1D cXr8cFRS2C14WoWj12uwYuUoJbuMbRx44RfC8aRneYs9WfnYiS5jMqBrCZrYacjW4BfV 47uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r0onP2tc; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n12-20020a05622a11cc00b004283cfac61bsi640946qtk.567.2024.01.03.09.37.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:37:43 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r0onP2tc; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL590-0004l3-Bg; Wed, 03 Jan 2024 12:35:07 -0500 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 1rL58V-00044c-3t for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:36 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL584-0002YU-CA for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:34 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40d3352b525so116668645e9.1 for ; Wed, 03 Jan 2024 09:34:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303247; x=1704908047; 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=ONXHbuvgkX4+WGf27zULd0XcConb0bPoQ1zwOoJUCD8=; b=r0onP2tcIUbY2Udnk7lRic0HQ3PFLRGE1/lw3U5Kze9f2WEHZoTV0zf9SvSDKZ3WRX PddA4sPXhbe4RNBnkymXoDF62lkTuzI0Y1xwQVG7L8jOqph5d0fFlDVzMKZwZBPKBOB4 Ey9fM6K38jYsq56zATXS7DTYKUTdW6nmwElGd0RXFIMi0uNBBb2/l2SDypg3vRtEVMpP PZ21UwVSUMKv50QMv7dOF2Kd4vTWPP7ryeU1coeCHPbhJqvWWFHNgxVaMUHBswBmM3Pg q7P+uLhaDe71qF9o433hrYGv2fOPHWoAgSjuinIJq0G9JKAmtd2YKTNDhLffZepKKRye RoSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303247; x=1704908047; 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=ONXHbuvgkX4+WGf27zULd0XcConb0bPoQ1zwOoJUCD8=; b=LsSw/G7DEEpZM9JcaU+Sx73y7/KpZrSLGm9ljQKe3YRxPdohZ8L7RtqD/utd0/SgIj GrXAW2bInqxkP4fQmJ88PDIGjyX+AMgXjKFmfntB3k4orHGJ8Xs4fuOOBXBsIUUpZyZZ 2wxPcorildYCB8gXr8MXOiO9mgyE9gCZJH8k+3wKnDdqVLvXUy8C+lF1vHU9LaeWMR8g dkNjHqlQBqWtVoRo52KRikL9YkLZc/xjX1rQVFDkf15ifOGd0/0W0Nod8olm6ajHClZz V90uGsuQLZXeFxjK3Ghi/T3TjQr/qUwKd9UB9vCWzKVyImi67APKOSBe6VmNTJzClMGg QK8g== X-Gm-Message-State: AOJu0YxQLB8vtlTvrhmwEuzRDq4/hVKJDdXvHtIkUD8jvp7vbnKkiXkR /PEiLqasYE1FjU66wcc3ux677Y9QyuvgUA== X-Received: by 2002:a1c:4b0a:0:b0:40d:8bc5:d9c0 with SMTP id y10-20020a1c4b0a000000b0040d8bc5d9c0mr1541524wma.180.1704303246776; Wed, 03 Jan 2024 09:34:06 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v28-20020adfa1dc000000b00336f8b2f60fsm18079325wrv.8.2024.01.03.09.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:34:02 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6195B5F9CD; Wed, 3 Jan 2024 17:33:52 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 31/43] gdbstub: Change gdb_get_reg_cb and gdb_set_reg_cb Date: Wed, 3 Jan 2024 17:33:37 +0000 Message-Id: <20240103173349.398526-32-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.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: Akihiko Odaki Align the parameters of gdb_get_reg_cb and gdb_set_reg_cb with the gdb_read_register and gdb_write_register members of CPUClass to allow to unify the logic to access registers of the core and coprocessors in the future. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée Message-Id: <20231213-gdb-v17-6-777047380591@daynix.com> Signed-off-by: Alex Bennée --- include/exec/gdbstub.h | 4 +- target/arm/internals.h | 12 +++--- target/hexagon/internal.h | 4 +- target/microblaze/cpu.h | 4 +- gdbstub/gdbstub.c | 6 +-- target/arm/gdbstub.c | 51 ++++++++++++++++-------- target/arm/gdbstub64.c | 27 +++++++++---- target/hexagon/gdbstub.c | 10 ++++- target/loongarch/gdbstub.c | 11 ++++-- target/m68k/helper.c | 20 ++++++++-- target/microblaze/gdbstub.c | 9 ++++- target/ppc/gdbstub.c | 46 +++++++++++++++++----- target/riscv/gdbstub.c | 46 ++++++++++++++++------ target/s390x/gdbstub.c | 77 ++++++++++++++++++++++++++++--------- 14 files changed, 236 insertions(+), 91 deletions(-) diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index ac6fce99a64..bcaab1bc750 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -24,8 +24,8 @@ typedef struct GDBFeatureBuilder { /* Get or set a register. Returns the size of the register. */ -typedef int (*gdb_get_reg_cb)(CPUArchState *env, GByteArray *buf, int reg); -typedef int (*gdb_set_reg_cb)(CPUArchState *env, uint8_t *buf, int reg); +typedef int (*gdb_get_reg_cb)(CPUState *cpu, GByteArray *buf, int reg); +typedef int (*gdb_set_reg_cb)(CPUState *cpu, uint8_t *buf, int reg); /** * gdb_register_coprocessor() - register a supplemental set of registers diff --git a/target/arm/internals.h b/target/arm/internals.h index 1136710741f..a08f461f444 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1447,12 +1447,12 @@ static inline uint64_t pmu_counter_mask(CPUARMState *env) #ifdef TARGET_AARCH64 GDBFeature *arm_gen_dynamic_svereg_feature(CPUState *cpu, int base_reg); -int aarch64_gdb_get_sve_reg(CPUARMState *env, GByteArray *buf, int reg); -int aarch64_gdb_set_sve_reg(CPUARMState *env, uint8_t *buf, int reg); -int aarch64_gdb_get_fpu_reg(CPUARMState *env, GByteArray *buf, int reg); -int aarch64_gdb_set_fpu_reg(CPUARMState *env, uint8_t *buf, int reg); -int aarch64_gdb_get_pauth_reg(CPUARMState *env, GByteArray *buf, int reg); -int aarch64_gdb_set_pauth_reg(CPUARMState *env, uint8_t *buf, int reg); +int aarch64_gdb_get_sve_reg(CPUState *cs, GByteArray *buf, int reg); +int aarch64_gdb_set_sve_reg(CPUState *cs, uint8_t *buf, int reg); +int aarch64_gdb_get_fpu_reg(CPUState *cs, GByteArray *buf, int reg); +int aarch64_gdb_set_fpu_reg(CPUState *cs, uint8_t *buf, int reg); +int aarch64_gdb_get_pauth_reg(CPUState *cs, GByteArray *buf, int reg); +int aarch64_gdb_set_pauth_reg(CPUState *cs, uint8_t *buf, int reg); void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp); void arm_cpu_sme_finalize(ARMCPU *cpu, Error **errp); void arm_cpu_pauth_finalize(ARMCPU *cpu, Error **errp); diff --git a/target/hexagon/internal.h b/target/hexagon/internal.h index d732b6bb3c7..beb08cb7e38 100644 --- a/target/hexagon/internal.h +++ b/target/hexagon/internal.h @@ -33,8 +33,8 @@ int hexagon_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int hexagon_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); -int hexagon_hvx_gdb_read_register(CPUHexagonState *env, GByteArray *mem_buf, int n); -int hexagon_hvx_gdb_write_register(CPUHexagonState *env, uint8_t *mem_buf, int n); +int hexagon_hvx_gdb_read_register(CPUState *env, GByteArray *mem_buf, int n); +int hexagon_hvx_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n); void hexagon_debug_vreg(CPUHexagonState *env, int regnum); void hexagon_debug_qreg(CPUHexagonState *env, int regnum); diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index b5374365f5f..1906d8f266a 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -381,8 +381,8 @@ G_NORETURN void mb_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, void mb_cpu_dump_state(CPUState *cpu, FILE *f, int flags); int mb_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int mb_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); -int mb_cpu_gdb_read_stack_protect(CPUArchState *cpu, GByteArray *buf, int reg); -int mb_cpu_gdb_write_stack_protect(CPUArchState *cpu, uint8_t *buf, int reg); +int mb_cpu_gdb_read_stack_protect(CPUState *cs, GByteArray *buf, int reg); +int mb_cpu_gdb_write_stack_protect(CPUState *cs, uint8_t *buf, int reg); static inline uint32_t mb_cpu_read_msr(const CPUMBState *env) { diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index a80729436b6..21fea7fffae 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -502,7 +502,6 @@ const GDBFeature *gdb_find_static_feature(const char *xmlname) static int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) { CPUClass *cc = CPU_GET_CLASS(cpu); - CPUArchState *env = cpu_env(cpu); GDBRegisterState *r; if (reg < cc->gdb_num_core_regs) { @@ -513,7 +512,7 @@ static int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) for (guint i = 0; i < cpu->gdb_regs->len; i++) { r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); if (r->base_reg <= reg && reg < r->base_reg + r->feature->num_regs) { - return r->get_reg(env, buf, reg - r->base_reg); + return r->get_reg(cpu, buf, reg - r->base_reg); } } } @@ -523,7 +522,6 @@ static int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) static int gdb_write_register(CPUState *cpu, uint8_t *mem_buf, int reg) { CPUClass *cc = CPU_GET_CLASS(cpu); - CPUArchState *env = cpu_env(cpu); GDBRegisterState *r; if (reg < cc->gdb_num_core_regs) { @@ -534,7 +532,7 @@ static int gdb_write_register(CPUState *cpu, uint8_t *mem_buf, int reg) for (guint i = 0; i < cpu->gdb_regs->len; i++) { r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); if (r->base_reg <= reg && reg < r->base_reg + r->feature->num_regs) { - return r->set_reg(env, mem_buf, reg - r->base_reg); + return r->set_reg(cpu, mem_buf, reg - r->base_reg); } } } diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c index f2b201d3125..059d84f98e5 100644 --- a/target/arm/gdbstub.c +++ b/target/arm/gdbstub.c @@ -106,9 +106,10 @@ int arm_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) return 0; } -static int vfp_gdb_get_reg(CPUARMState *env, GByteArray *buf, int reg) +static int vfp_gdb_get_reg(CPUState *cs, GByteArray *buf, int reg) { - ARMCPU *cpu = env_archcpu(env); + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; int nregs = cpu_isar_feature(aa32_simd_r32, cpu) ? 32 : 16; /* VFP data registers are always little-endian. */ @@ -130,9 +131,10 @@ static int vfp_gdb_get_reg(CPUARMState *env, GByteArray *buf, int reg) return 0; } -static int vfp_gdb_set_reg(CPUARMState *env, uint8_t *buf, int reg) +static int vfp_gdb_set_reg(CPUState *cs, uint8_t *buf, int reg) { - ARMCPU *cpu = env_archcpu(env); + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; int nregs = cpu_isar_feature(aa32_simd_r32, cpu) ? 32 : 16; if (reg < nregs) { @@ -156,8 +158,11 @@ static int vfp_gdb_set_reg(CPUARMState *env, uint8_t *buf, int reg) return 0; } -static int vfp_gdb_get_sysreg(CPUARMState *env, GByteArray *buf, int reg) +static int vfp_gdb_get_sysreg(CPUState *cs, GByteArray *buf, int reg) { + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; + switch (reg) { case 0: return gdb_get_reg32(buf, env->vfp.xregs[ARM_VFP_FPSID]); @@ -167,8 +172,11 @@ static int vfp_gdb_get_sysreg(CPUARMState *env, GByteArray *buf, int reg) return 0; } -static int vfp_gdb_set_sysreg(CPUARMState *env, uint8_t *buf, int reg) +static int vfp_gdb_set_sysreg(CPUState *cs, uint8_t *buf, int reg) { + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; + switch (reg) { case 0: env->vfp.xregs[ARM_VFP_FPSID] = ldl_p(buf); @@ -180,8 +188,11 @@ static int vfp_gdb_set_sysreg(CPUARMState *env, uint8_t *buf, int reg) return 0; } -static int mve_gdb_get_reg(CPUARMState *env, GByteArray *buf, int reg) +static int mve_gdb_get_reg(CPUState *cs, GByteArray *buf, int reg) { + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; + switch (reg) { case 0: return gdb_get_reg32(buf, env->v7m.vpr); @@ -190,8 +201,11 @@ static int mve_gdb_get_reg(CPUARMState *env, GByteArray *buf, int reg) } } -static int mve_gdb_set_reg(CPUARMState *env, uint8_t *buf, int reg) +static int mve_gdb_set_reg(CPUState *cs, uint8_t *buf, int reg) { + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; + switch (reg) { case 0: env->v7m.vpr = ldl_p(buf); @@ -210,9 +224,10 @@ static int mve_gdb_set_reg(CPUARMState *env, uint8_t *buf, int reg) * We return the number of bytes copied */ -static int arm_gdb_get_sysreg(CPUARMState *env, GByteArray *buf, int reg) +static int arm_gdb_get_sysreg(CPUState *cs, GByteArray *buf, int reg) { - ARMCPU *cpu = env_archcpu(env); + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; const ARMCPRegInfo *ri; uint32_t key; @@ -228,7 +243,7 @@ static int arm_gdb_get_sysreg(CPUARMState *env, GByteArray *buf, int reg) return 0; } -static int arm_gdb_set_sysreg(CPUARMState *env, uint8_t *buf, int reg) +static int arm_gdb_set_sysreg(CPUState *cs, uint8_t *buf, int reg) { return 0; } @@ -367,8 +382,11 @@ static int m_sysreg_get(CPUARMState *env, GByteArray *buf, return gdb_get_reg32(buf, *ptr); } -static int arm_gdb_get_m_systemreg(CPUARMState *env, GByteArray *buf, int reg) +static int arm_gdb_get_m_systemreg(CPUState *cs, GByteArray *buf, int reg) { + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; + /* * Here, we emulate MRS instruction, where CONTROL has a mix of * banked and non-banked bits. @@ -379,7 +397,7 @@ static int arm_gdb_get_m_systemreg(CPUARMState *env, GByteArray *buf, int reg) return m_sysreg_get(env, buf, reg, env->v7m.secure); } -static int arm_gdb_set_m_systemreg(CPUARMState *env, uint8_t *buf, int reg) +static int arm_gdb_set_m_systemreg(CPUState *cs, uint8_t *buf, int reg) { return 0; /* TODO */ } @@ -414,12 +432,15 @@ static GDBFeature *arm_gen_dynamic_m_systemreg_feature(CPUState *cs, * For user-only, we see the non-secure registers via m_systemreg above. * For secext, encode the non-secure view as even and secure view as odd. */ -static int arm_gdb_get_m_secextreg(CPUARMState *env, GByteArray *buf, int reg) +static int arm_gdb_get_m_secextreg(CPUState *cs, GByteArray *buf, int reg) { + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; + return m_sysreg_get(env, buf, reg >> 1, reg & 1); } -static int arm_gdb_set_m_secextreg(CPUARMState *env, uint8_t *buf, int reg) +static int arm_gdb_set_m_secextreg(CPUState *cs, uint8_t *buf, int reg) { return 0; /* TODO */ } diff --git a/target/arm/gdbstub64.c b/target/arm/gdbstub64.c index 5286d5c6043..caa31ff3fa1 100644 --- a/target/arm/gdbstub64.c +++ b/target/arm/gdbstub64.c @@ -72,8 +72,11 @@ int aarch64_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) return 0; } -int aarch64_gdb_get_fpu_reg(CPUARMState *env, GByteArray *buf, int reg) +int aarch64_gdb_get_fpu_reg(CPUState *cs, GByteArray *buf, int reg) { + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; + switch (reg) { case 0 ... 31: { @@ -92,8 +95,11 @@ int aarch64_gdb_get_fpu_reg(CPUARMState *env, GByteArray *buf, int reg) } } -int aarch64_gdb_set_fpu_reg(CPUARMState *env, uint8_t *buf, int reg) +int aarch64_gdb_set_fpu_reg(CPUState *cs, uint8_t *buf, int reg) { + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; + switch (reg) { case 0 ... 31: /* 128 bit FP register */ @@ -116,9 +122,10 @@ int aarch64_gdb_set_fpu_reg(CPUARMState *env, uint8_t *buf, int reg) } } -int aarch64_gdb_get_sve_reg(CPUARMState *env, GByteArray *buf, int reg) +int aarch64_gdb_get_sve_reg(CPUState *cs, GByteArray *buf, int reg) { - ARMCPU *cpu = env_archcpu(env); + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; switch (reg) { /* The first 32 registers are the zregs */ @@ -164,9 +171,10 @@ int aarch64_gdb_get_sve_reg(CPUARMState *env, GByteArray *buf, int reg) return 0; } -int aarch64_gdb_set_sve_reg(CPUARMState *env, uint8_t *buf, int reg) +int aarch64_gdb_set_sve_reg(CPUState *cs, uint8_t *buf, int reg) { - ARMCPU *cpu = env_archcpu(env); + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; /* The first 32 registers are the zregs */ switch (reg) { @@ -210,8 +218,11 @@ int aarch64_gdb_set_sve_reg(CPUARMState *env, uint8_t *buf, int reg) return 0; } -int aarch64_gdb_get_pauth_reg(CPUARMState *env, GByteArray *buf, int reg) +int aarch64_gdb_get_pauth_reg(CPUState *cs, GByteArray *buf, int reg) { + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; + switch (reg) { case 0: /* pauth_dmask */ case 1: /* pauth_cmask */ @@ -241,7 +252,7 @@ int aarch64_gdb_get_pauth_reg(CPUARMState *env, GByteArray *buf, int reg) } } -int aarch64_gdb_set_pauth_reg(CPUARMState *env, uint8_t *buf, int reg) +int aarch64_gdb_set_pauth_reg(CPUState *cs, uint8_t *buf, int reg) { /* All pseudo registers are read-only. */ return 0; diff --git a/target/hexagon/gdbstub.c b/target/hexagon/gdbstub.c index 54d37e006e0..6007e6462b9 100644 --- a/target/hexagon/gdbstub.c +++ b/target/hexagon/gdbstub.c @@ -81,8 +81,11 @@ static int gdb_get_qreg(CPUHexagonState *env, GByteArray *mem_buf, int n) return total; } -int hexagon_hvx_gdb_read_register(CPUHexagonState *env, GByteArray *mem_buf, int n) +int hexagon_hvx_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) { + HexagonCPU *cpu = HEXAGON_CPU(cs); + CPUHexagonState *env = &cpu->env; + if (n < NUM_VREGS) { return gdb_get_vreg(env, mem_buf, n); } @@ -115,8 +118,11 @@ static int gdb_put_qreg(CPUHexagonState *env, uint8_t *mem_buf, int n) return MAX_VEC_SIZE_BYTES / 8; } -int hexagon_hvx_gdb_write_register(CPUHexagonState *env, uint8_t *mem_buf, int n) +int hexagon_hvx_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) { + HexagonCPU *cpu = HEXAGON_CPU(cs); + CPUHexagonState *env = &cpu->env; + if (n < NUM_VREGS) { return gdb_put_vreg(env, mem_buf, n); } diff --git a/target/loongarch/gdbstub.c b/target/loongarch/gdbstub.c index 843a869450e..22c6889011e 100644 --- a/target/loongarch/gdbstub.c +++ b/target/loongarch/gdbstub.c @@ -84,9 +84,11 @@ int loongarch_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) return length; } -static int loongarch_gdb_get_fpu(CPULoongArchState *env, - GByteArray *mem_buf, int n) +static int loongarch_gdb_get_fpu(CPUState *cs, GByteArray *mem_buf, int n) { + LoongArchCPU *cpu = LOONGARCH_CPU(cs); + CPULoongArchState *env = &cpu->env; + if (0 <= n && n < 32) { return gdb_get_reg64(mem_buf, env->fpr[n].vreg.D(0)); } else if (32 <= n && n < 40) { @@ -97,9 +99,10 @@ static int loongarch_gdb_get_fpu(CPULoongArchState *env, return 0; } -static int loongarch_gdb_set_fpu(CPULoongArchState *env, - uint8_t *mem_buf, int n) +static int loongarch_gdb_set_fpu(CPUState *cs, uint8_t *mem_buf, int n) { + LoongArchCPU *cpu = LOONGARCH_CPU(cs); + CPULoongArchState *env = &cpu->env; int length = 0; if (0 <= n && n < 32) { diff --git a/target/m68k/helper.c b/target/m68k/helper.c index 675f2dcd5ad..a5ee4d87e32 100644 --- a/target/m68k/helper.c +++ b/target/m68k/helper.c @@ -69,8 +69,11 @@ void m68k_cpu_list(void) g_slist_free(list); } -static int cf_fpu_gdb_get_reg(CPUM68KState *env, GByteArray *mem_buf, int n) +static int cf_fpu_gdb_get_reg(CPUState *cs, GByteArray *mem_buf, int n) { + M68kCPU *cpu = M68K_CPU(cs); + CPUM68KState *env = &cpu->env; + if (n < 8) { float_status s; return gdb_get_reg64(mem_buf, floatx80_to_float64(env->fregs[n].d, &s)); @@ -86,8 +89,11 @@ static int cf_fpu_gdb_get_reg(CPUM68KState *env, GByteArray *mem_buf, int n) return 0; } -static int cf_fpu_gdb_set_reg(CPUM68KState *env, uint8_t *mem_buf, int n) +static int cf_fpu_gdb_set_reg(CPUState *cs, uint8_t *mem_buf, int n) { + M68kCPU *cpu = M68K_CPU(cs); + CPUM68KState *env = &cpu->env; + if (n < 8) { float_status s; env->fregs[n].d = float64_to_floatx80(ldq_p(mem_buf), &s); @@ -106,8 +112,11 @@ static int cf_fpu_gdb_set_reg(CPUM68KState *env, uint8_t *mem_buf, int n) return 0; } -static int m68k_fpu_gdb_get_reg(CPUM68KState *env, GByteArray *mem_buf, int n) +static int m68k_fpu_gdb_get_reg(CPUState *cs, GByteArray *mem_buf, int n) { + M68kCPU *cpu = M68K_CPU(cs); + CPUM68KState *env = &cpu->env; + if (n < 8) { int len = gdb_get_reg16(mem_buf, env->fregs[n].l.upper); len += gdb_get_reg16(mem_buf, 0); @@ -125,8 +134,11 @@ static int m68k_fpu_gdb_get_reg(CPUM68KState *env, GByteArray *mem_buf, int n) return 0; } -static int m68k_fpu_gdb_set_reg(CPUM68KState *env, uint8_t *mem_buf, int n) +static int m68k_fpu_gdb_set_reg(CPUState *cs, uint8_t *mem_buf, int n) { + M68kCPU *cpu = M68K_CPU(cs); + CPUM68KState *env = &cpu->env; + if (n < 8) { env->fregs[n].l.upper = lduw_be_p(mem_buf); env->fregs[n].l.lower = ldq_be_p(mem_buf + 4); diff --git a/target/microblaze/gdbstub.c b/target/microblaze/gdbstub.c index 29ac6e9c0f7..6ffc5ad0752 100644 --- a/target/microblaze/gdbstub.c +++ b/target/microblaze/gdbstub.c @@ -94,8 +94,10 @@ int mb_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) return gdb_get_reg32(mem_buf, val); } -int mb_cpu_gdb_read_stack_protect(CPUMBState *env, GByteArray *mem_buf, int n) +int mb_cpu_gdb_read_stack_protect(CPUState *cs, GByteArray *mem_buf, int n) { + MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs); + CPUMBState *env = &cpu->env; uint32_t val; switch (n) { @@ -153,8 +155,11 @@ int mb_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) return 4; } -int mb_cpu_gdb_write_stack_protect(CPUMBState *env, uint8_t *mem_buf, int n) +int mb_cpu_gdb_write_stack_protect(CPUState *cs, uint8_t *mem_buf, int n) { + MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs); + CPUMBState *env = &cpu->env; + switch (n) { case GDB_SP_SHL: env->slr = ldl_p(mem_buf); diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c index 09b852464f3..8ca37b6bf95 100644 --- a/target/ppc/gdbstub.c +++ b/target/ppc/gdbstub.c @@ -369,8 +369,10 @@ static int gdb_find_spr_idx(CPUPPCState *env, int n) return -1; } -static int gdb_get_spr_reg(CPUPPCState *env, GByteArray *buf, int n) +static int gdb_get_spr_reg(CPUState *cs, GByteArray *buf, int n) { + PowerPCCPU *cpu = POWERPC_CPU(cs); + CPUPPCState *env = &cpu->env; int reg; int len; @@ -385,8 +387,10 @@ static int gdb_get_spr_reg(CPUPPCState *env, GByteArray *buf, int n) return len; } -static int gdb_set_spr_reg(CPUPPCState *env, uint8_t *mem_buf, int n) +static int gdb_set_spr_reg(CPUState *cs, uint8_t *mem_buf, int n) { + PowerPCCPU *cpu = POWERPC_CPU(cs); + CPUPPCState *env = &cpu->env; int reg; int len; @@ -403,8 +407,10 @@ static int gdb_set_spr_reg(CPUPPCState *env, uint8_t *mem_buf, int n) } #endif -static int gdb_get_float_reg(CPUPPCState *env, GByteArray *buf, int n) +static int gdb_get_float_reg(CPUState *cs, GByteArray *buf, int n) { + PowerPCCPU *cpu = POWERPC_CPU(cs); + CPUPPCState *env = &cpu->env; uint8_t *mem_buf; if (n < 32) { gdb_get_reg64(buf, *cpu_fpr_ptr(env, n)); @@ -421,8 +427,11 @@ static int gdb_get_float_reg(CPUPPCState *env, GByteArray *buf, int n) return 0; } -static int gdb_set_float_reg(CPUPPCState *env, uint8_t *mem_buf, int n) +static int gdb_set_float_reg(CPUState *cs, uint8_t *mem_buf, int n) { + PowerPCCPU *cpu = POWERPC_CPU(cs); + CPUPPCState *env = &cpu->env; + if (n < 32) { ppc_maybe_bswap_register(env, mem_buf, 8); *cpu_fpr_ptr(env, n) = ldq_p(mem_buf); @@ -436,8 +445,10 @@ static int gdb_set_float_reg(CPUPPCState *env, uint8_t *mem_buf, int n) return 0; } -static int gdb_get_avr_reg(CPUPPCState *env, GByteArray *buf, int n) +static int gdb_get_avr_reg(CPUState *cs, GByteArray *buf, int n) { + PowerPCCPU *cpu = POWERPC_CPU(cs); + CPUPPCState *env = &cpu->env; uint8_t *mem_buf; if (n < 32) { @@ -462,8 +473,11 @@ static int gdb_get_avr_reg(CPUPPCState *env, GByteArray *buf, int n) return 0; } -static int gdb_set_avr_reg(CPUPPCState *env, uint8_t *mem_buf, int n) +static int gdb_set_avr_reg(CPUState *cs, uint8_t *mem_buf, int n) { + PowerPCCPU *cpu = POWERPC_CPU(cs); + CPUPPCState *env = &cpu->env; + if (n < 32) { ppc_avr_t *avr = cpu_avr_ptr(env, n); ppc_maybe_bswap_register(env, mem_buf, 16); @@ -484,8 +498,11 @@ static int gdb_set_avr_reg(CPUPPCState *env, uint8_t *mem_buf, int n) return 0; } -static int gdb_get_spe_reg(CPUPPCState *env, GByteArray *buf, int n) +static int gdb_get_spe_reg(CPUState *cs, GByteArray *buf, int n) { + PowerPCCPU *cpu = POWERPC_CPU(cs); + CPUPPCState *env = &cpu->env; + if (n < 32) { #if defined(TARGET_PPC64) gdb_get_reg32(buf, env->gpr[n] >> 32); @@ -508,8 +525,11 @@ static int gdb_get_spe_reg(CPUPPCState *env, GByteArray *buf, int n) return 0; } -static int gdb_set_spe_reg(CPUPPCState *env, uint8_t *mem_buf, int n) +static int gdb_set_spe_reg(CPUState *cs, uint8_t *mem_buf, int n) { + PowerPCCPU *cpu = POWERPC_CPU(cs); + CPUPPCState *env = &cpu->env; + if (n < 32) { #if defined(TARGET_PPC64) target_ulong lo = (uint32_t)env->gpr[n]; @@ -537,8 +557,11 @@ static int gdb_set_spe_reg(CPUPPCState *env, uint8_t *mem_buf, int n) return 0; } -static int gdb_get_vsx_reg(CPUPPCState *env, GByteArray *buf, int n) +static int gdb_get_vsx_reg(CPUState *cs, GByteArray *buf, int n) { + PowerPCCPU *cpu = POWERPC_CPU(cs); + CPUPPCState *env = &cpu->env; + if (n < 32) { gdb_get_reg64(buf, *cpu_vsrl_ptr(env, n)); ppc_maybe_bswap_register(env, gdb_get_reg_ptr(buf, 8), 8); @@ -547,8 +570,11 @@ static int gdb_get_vsx_reg(CPUPPCState *env, GByteArray *buf, int n) return 0; } -static int gdb_set_vsx_reg(CPUPPCState *env, uint8_t *mem_buf, int n) +static int gdb_set_vsx_reg(CPUState *cs, uint8_t *mem_buf, int n) { + PowerPCCPU *cpu = POWERPC_CPU(cs); + CPUPPCState *env = &cpu->env; + if (n < 32) { ppc_maybe_bswap_register(env, mem_buf, 8); *cpu_vsrl_ptr(env, n) = ldq_p(mem_buf); diff --git a/target/riscv/gdbstub.c b/target/riscv/gdbstub.c index a879869fa1a..68d0fdc1fd6 100644 --- a/target/riscv/gdbstub.c +++ b/target/riscv/gdbstub.c @@ -108,8 +108,11 @@ int riscv_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) return length; } -static int riscv_gdb_get_fpu(CPURISCVState *env, GByteArray *buf, int n) +static int riscv_gdb_get_fpu(CPUState *cs, GByteArray *buf, int n) { + RISCVCPU *cpu = RISCV_CPU(cs); + CPURISCVState *env = &cpu->env; + if (n < 32) { if (env->misa_ext & RVD) { return gdb_get_reg64(buf, env->fpr[n]); @@ -121,8 +124,11 @@ static int riscv_gdb_get_fpu(CPURISCVState *env, GByteArray *buf, int n) return 0; } -static int riscv_gdb_set_fpu(CPURISCVState *env, uint8_t *mem_buf, int n) +static int riscv_gdb_set_fpu(CPUState *cs, uint8_t *mem_buf, int n) { + RISCVCPU *cpu = RISCV_CPU(cs); + CPURISCVState *env = &cpu->env; + if (n < 32) { env->fpr[n] = ldq_p(mem_buf); /* always 64-bit */ return sizeof(uint64_t); @@ -130,8 +136,10 @@ static int riscv_gdb_set_fpu(CPURISCVState *env, uint8_t *mem_buf, int n) return 0; } -static int riscv_gdb_get_vector(CPURISCVState *env, GByteArray *buf, int n) +static int riscv_gdb_get_vector(CPUState *cs, GByteArray *buf, int n) { + RISCVCPU *cpu = RISCV_CPU(cs); + CPURISCVState *env = &cpu->env; uint16_t vlenb = riscv_cpu_cfg(env)->vlen >> 3; if (n < 32) { int i; @@ -146,8 +154,10 @@ static int riscv_gdb_get_vector(CPURISCVState *env, GByteArray *buf, int n) return 0; } -static int riscv_gdb_set_vector(CPURISCVState *env, uint8_t *mem_buf, int n) +static int riscv_gdb_set_vector(CPUState *cs, uint8_t *mem_buf, int n) { + RISCVCPU *cpu = RISCV_CPU(cs); + CPURISCVState *env = &cpu->env; uint16_t vlenb = riscv_cpu_cfg(env)->vlen >> 3; if (n < 32) { int i; @@ -160,8 +170,11 @@ static int riscv_gdb_set_vector(CPURISCVState *env, uint8_t *mem_buf, int n) return 0; } -static int riscv_gdb_get_csr(CPURISCVState *env, GByteArray *buf, int n) +static int riscv_gdb_get_csr(CPUState *cs, GByteArray *buf, int n) { + RISCVCPU *cpu = RISCV_CPU(cs); + CPURISCVState *env = &cpu->env; + if (n < CSR_TABLE_SIZE) { target_ulong val = 0; int result; @@ -174,8 +187,11 @@ static int riscv_gdb_get_csr(CPURISCVState *env, GByteArray *buf, int n) return 0; } -static int riscv_gdb_set_csr(CPURISCVState *env, uint8_t *mem_buf, int n) +static int riscv_gdb_set_csr(CPUState *cs, uint8_t *mem_buf, int n) { + RISCVCPU *cpu = RISCV_CPU(cs); + CPURISCVState *env = &cpu->env; + if (n < CSR_TABLE_SIZE) { target_ulong val = ldtul_p(mem_buf); int result; @@ -188,25 +204,31 @@ static int riscv_gdb_set_csr(CPURISCVState *env, uint8_t *mem_buf, int n) return 0; } -static int riscv_gdb_get_virtual(CPURISCVState *cs, GByteArray *buf, int n) +static int riscv_gdb_get_virtual(CPUState *cs, GByteArray *buf, int n) { if (n == 0) { #ifdef CONFIG_USER_ONLY return gdb_get_regl(buf, 0); #else - return gdb_get_regl(buf, cs->priv); + RISCVCPU *cpu = RISCV_CPU(cs); + CPURISCVState *env = &cpu->env; + + return gdb_get_regl(buf, env->priv); #endif } return 0; } -static int riscv_gdb_set_virtual(CPURISCVState *cs, uint8_t *mem_buf, int n) +static int riscv_gdb_set_virtual(CPUState *cs, uint8_t *mem_buf, int n) { if (n == 0) { #ifndef CONFIG_USER_ONLY - cs->priv = ldtul_p(mem_buf) & 0x3; - if (cs->priv == PRV_RESERVED) { - cs->priv = PRV_S; + RISCVCPU *cpu = RISCV_CPU(cs); + CPURISCVState *env = &cpu->env; + + env->priv = ldtul_p(mem_buf) & 0x3; + if (env->priv == PRV_RESERVED) { + env->priv = PRV_S; } #endif return sizeof(target_ulong); diff --git a/target/s390x/gdbstub.c b/target/s390x/gdbstub.c index 02c388dc323..c1e7c59b822 100644 --- a/target/s390x/gdbstub.c +++ b/target/s390x/gdbstub.c @@ -70,8 +70,11 @@ int s390_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) #define S390_A0_REGNUM 0 #define S390_A15_REGNUM 15 -static int cpu_read_ac_reg(CPUS390XState *env, GByteArray *buf, int n) +static int cpu_read_ac_reg(CPUState *cs, GByteArray *buf, int n) { + S390CPU *cpu = S390_CPU(cs); + CPUS390XState *env = &cpu->env; + switch (n) { case S390_A0_REGNUM ... S390_A15_REGNUM: return gdb_get_reg32(buf, env->aregs[n]); @@ -80,8 +83,11 @@ static int cpu_read_ac_reg(CPUS390XState *env, GByteArray *buf, int n) } } -static int cpu_write_ac_reg(CPUS390XState *env, uint8_t *mem_buf, int n) +static int cpu_write_ac_reg(CPUState *cs, uint8_t *mem_buf, int n) { + S390CPU *cpu = S390_CPU(cs); + CPUS390XState *env = &cpu->env; + switch (n) { case S390_A0_REGNUM ... S390_A15_REGNUM: env->aregs[n] = ldl_p(mem_buf); @@ -97,8 +103,11 @@ static int cpu_write_ac_reg(CPUS390XState *env, uint8_t *mem_buf, int n) #define S390_F0_REGNUM 1 #define S390_F15_REGNUM 16 -static int cpu_read_fp_reg(CPUS390XState *env, GByteArray *buf, int n) +static int cpu_read_fp_reg(CPUState *cs, GByteArray *buf, int n) { + S390CPU *cpu = S390_CPU(cs); + CPUS390XState *env = &cpu->env; + switch (n) { case S390_FPC_REGNUM: return gdb_get_reg32(buf, env->fpc); @@ -109,8 +118,11 @@ static int cpu_read_fp_reg(CPUS390XState *env, GByteArray *buf, int n) } } -static int cpu_write_fp_reg(CPUS390XState *env, uint8_t *mem_buf, int n) +static int cpu_write_fp_reg(CPUState *cs, uint8_t *mem_buf, int n) { + S390CPU *cpu = S390_CPU(cs); + CPUS390XState *env = &cpu->env; + switch (n) { case S390_FPC_REGNUM: env->fpc = ldl_p(mem_buf); @@ -129,8 +141,10 @@ static int cpu_write_fp_reg(CPUS390XState *env, uint8_t *mem_buf, int n) #define S390_V16_REGNUM 16 #define S390_V31_REGNUM 31 -static int cpu_read_vreg(CPUS390XState *env, GByteArray *buf, int n) +static int cpu_read_vreg(CPUState *cs, GByteArray *buf, int n) { + S390CPU *cpu = S390_CPU(cs); + CPUS390XState *env = &cpu->env; int ret; switch (n) { @@ -148,8 +162,11 @@ static int cpu_read_vreg(CPUS390XState *env, GByteArray *buf, int n) return ret; } -static int cpu_write_vreg(CPUS390XState *env, uint8_t *mem_buf, int n) +static int cpu_write_vreg(CPUState *cs, uint8_t *mem_buf, int n) { + S390CPU *cpu = S390_CPU(cs); + CPUS390XState *env = &cpu->env; + switch (n) { case S390_V0L_REGNUM ... S390_V15L_REGNUM: env->vregs[n][1] = ldtul_p(mem_buf + 8); @@ -168,8 +185,11 @@ static int cpu_write_vreg(CPUS390XState *env, uint8_t *mem_buf, int n) #define S390_C15_REGNUM 15 #ifndef CONFIG_USER_ONLY -static int cpu_read_c_reg(CPUS390XState *env, GByteArray *buf, int n) +static int cpu_read_c_reg(CPUState *cs, GByteArray *buf, int n) { + S390CPU *cpu = S390_CPU(cs); + CPUS390XState *env = &cpu->env; + switch (n) { case S390_C0_REGNUM ... S390_C15_REGNUM: return gdb_get_regl(buf, env->cregs[n]); @@ -178,8 +198,11 @@ static int cpu_read_c_reg(CPUS390XState *env, GByteArray *buf, int n) } } -static int cpu_write_c_reg(CPUS390XState *env, uint8_t *mem_buf, int n) +static int cpu_write_c_reg(CPUState *cs, uint8_t *mem_buf, int n) { + S390CPU *cpu = S390_CPU(cs); + CPUS390XState *env = &cpu->env; + switch (n) { case S390_C0_REGNUM ... S390_C15_REGNUM: env->cregs[n] = ldtul_p(mem_buf); @@ -199,8 +222,11 @@ static int cpu_write_c_reg(CPUS390XState *env, uint8_t *mem_buf, int n) #define S390_VIRT_BEA_REGNUM 2 #define S390_VIRT_PREFIX_REGNUM 3 -static int cpu_read_virt_reg(CPUS390XState *env, GByteArray *mem_buf, int n) +static int cpu_read_virt_reg(CPUState *cs, GByteArray *mem_buf, int n) { + S390CPU *cpu = S390_CPU(cs); + CPUS390XState *env = &cpu->env; + switch (n) { case S390_VIRT_CKC_REGNUM: return gdb_get_regl(mem_buf, env->ckc); @@ -215,24 +241,27 @@ static int cpu_read_virt_reg(CPUS390XState *env, GByteArray *mem_buf, int n) } } -static int cpu_write_virt_reg(CPUS390XState *env, uint8_t *mem_buf, int n) +static int cpu_write_virt_reg(CPUState *cs, uint8_t *mem_buf, int n) { + S390CPU *cpu = S390_CPU(cs); + CPUS390XState *env = &cpu->env; + switch (n) { case S390_VIRT_CKC_REGNUM: env->ckc = ldtul_p(mem_buf); - cpu_synchronize_post_init(env_cpu(env)); + cpu_synchronize_post_init(cs); return 8; case S390_VIRT_CPUTM_REGNUM: env->cputm = ldtul_p(mem_buf); - cpu_synchronize_post_init(env_cpu(env)); + cpu_synchronize_post_init(cs); return 8; case S390_VIRT_BEA_REGNUM: env->gbea = ldtul_p(mem_buf); - cpu_synchronize_post_init(env_cpu(env)); + cpu_synchronize_post_init(cs); return 8; case S390_VIRT_PREFIX_REGNUM: env->psa = ldtul_p(mem_buf); - cpu_synchronize_post_init(env_cpu(env)); + cpu_synchronize_post_init(cs); return 8; default: return 0; @@ -245,8 +274,11 @@ static int cpu_write_virt_reg(CPUS390XState *env, uint8_t *mem_buf, int n) #define S390_VIRT_KVM_PFS_REGNUM 2 #define S390_VIRT_KVM_PFC_REGNUM 3 -static int cpu_read_virt_kvm_reg(CPUS390XState *env, GByteArray *mem_buf, int n) +static int cpu_read_virt_kvm_reg(CPUState *cs, GByteArray *mem_buf, int n) { + S390CPU *cpu = S390_CPU(cs); + CPUS390XState *env = &cpu->env; + switch (n) { case S390_VIRT_KVM_PP_REGNUM: return gdb_get_regl(mem_buf, env->pp); @@ -261,8 +293,11 @@ static int cpu_read_virt_kvm_reg(CPUS390XState *env, GByteArray *mem_buf, int n) } } -static int cpu_write_virt_kvm_reg(CPUS390XState *env, uint8_t *mem_buf, int n) +static int cpu_write_virt_kvm_reg(CPUState *cs, uint8_t *mem_buf, int n) { + S390CPU *cpu = S390_CPU(cs); + CPUS390XState *env = &cpu->env; + switch (n) { case S390_VIRT_KVM_PP_REGNUM: env->pp = ldtul_p(mem_buf); @@ -292,13 +327,19 @@ static int cpu_write_virt_kvm_reg(CPUS390XState *env, uint8_t *mem_buf, int n) #define S390_GS_GSSM_REGNUM 2 #define S390_GS_GSEPLA_REGNUM 3 -static int cpu_read_gs_reg(CPUS390XState *env, GByteArray *buf, int n) +static int cpu_read_gs_reg(CPUState *cs, GByteArray *buf, int n) { + S390CPU *cpu = S390_CPU(cs); + CPUS390XState *env = &cpu->env; + return gdb_get_regl(buf, env->gscb[n]); } -static int cpu_write_gs_reg(CPUS390XState *env, uint8_t *mem_buf, int n) +static int cpu_write_gs_reg(CPUState *cs, uint8_t *mem_buf, int n) { + S390CPU *cpu = S390_CPU(cs); + CPUS390XState *env = &cpu->env; + env->gscb[n] = ldtul_p(mem_buf); cpu_synchronize_post_init(env_cpu(env)); return 8; From patchwork Wed Jan 3 17:33:38 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: 759616 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6610673wrw; Wed, 3 Jan 2024 09:36:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGn1jAwmgW79gJutb8Gi9y5FI3V875pT2GA0XVK21Ou4rqfEfKKL08SUSUEVjPcSCSnitMm X-Received: by 2002:a05:6808:159e:b0:3bc:2481:fcde with SMTP id t30-20020a056808159e00b003bc2481fcdemr1545696oiw.4.1704303379748; Wed, 03 Jan 2024 09:36:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303379; cv=none; d=google.com; s=arc-20160816; b=Odg+pu0ZY5ede3/In2gjpIO/w7KvHiIWwANcTpnw8YiDj4Gv+Ru7W7wxc2cJMiXqnt W+jGEkNQHrsjtN//WWSL77QOi68Id1iXN88J7R2K2TivuXLciUlEMe56y5yHgCkNKxYD rPh/FwdoyBjl2LU8CIrBrF1tyh2Pp25Ov8e+xpDbgpVQsaF9V7i7Q+10UhbPpWEsca4q SOfdy6QkAUj2iFYjwapOlle/9/Xe/+q/4wpzUQps3Zz76zh4+Wf3oYfived483FCp+S0 yLC2+Ghf5Hc1K7QQblIFxxpGyTuwG3JZADKMAzJxaZXo7QnJ91/51tCFtBXE6uZlopm+ 2R/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=0Ha0YdQiAm0Sb5o4T4mCAdJBoZ8w/bFrJlrZ9NOmRtI=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=RAwxbEFwIOR7IEkRZ3PQt9YKcEoxY4TujYQTLxhuO+mY121oxm4e1OTEB9Tg8ibeGz S9T46n57p9SEGgfjk4FLCqiq/RWi5hUx+fwSUMNcukq1wn/kOtVmp1uhfafKNhWOG4Rk CvUdC4YNcPtS8UmI4g6jo+mbmGPzlIQz6bAghhAT00iTyCceHmSbyd328PstzpVSgP3K 0+EYL2ZO4odh3Mqbz4E5E/zR7ujB5YbQBauJLMaTFto/nLo7QonyvxxZ9sNqVRMaFBAd n8ytSHeF3P0p2ULio/OwuCqvYqNJpPOHiL6owseASaj+igwMA7u8UrTrf9JrcluF6Rmk PhXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dfRl4ePf; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t25-20020a0cb719000000b0067f9e856597si25861406qvd.270.2024.01.03.09.36.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:36:19 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dfRl4ePf; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58x-0004h7-VP; Wed, 03 Jan 2024 12:35:03 -0500 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 1rL58T-00042l-Sa for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:34 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL584-0002XH-AO for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:33 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40d5a41143fso67859845e9.3 for ; Wed, 03 Jan 2024 09:34:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303245; x=1704908045; 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=0Ha0YdQiAm0Sb5o4T4mCAdJBoZ8w/bFrJlrZ9NOmRtI=; b=dfRl4ePf7Dr6ChMa1wCC7lRkl6NegGD1rreCGDC/HvcNy1sFo/1LbKc/Oqq5uPwWz6 d17n7lwA6+rPWIKE1CSlnmrvm3h/qEsxtq9FEruepK46weqSyDOOGygsRJBaRwk1Y/Lb iLU/NQtVQL9fzFbxlnF0lBZAcF/wsReM8X6gytQ+HDAu3juD7wmScuhWeK/rQ+K5QHci LK+g+WNS7woyj6Ipfi1vKW/WggZuuM0gKx5rEDRZTvNfMSG3qC2xw1jKGxNQ0196yFZt AKDjGfyA+3WsMozAu0rGqdsqcuObYfVdCvhURIlqvd+L3yCDaqJs8YvvkaqyfejdluLn /h8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303245; x=1704908045; 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=0Ha0YdQiAm0Sb5o4T4mCAdJBoZ8w/bFrJlrZ9NOmRtI=; b=gFa/xvLuX+XXX6+gKhRkZs7ZUsWUF22xsAfzc0tWo4LEt09B3O+zx2OTYi23USKT7I KtqqHoJSbuKz3UCoaAHicUDT2dx5ZzS7400ohhBiwn1P07pc8PZYWyJKv50YJjBmDCH0 G5Z73i3y19ecj7wkmRkW1QHRVsiCsCDT3KTNl62+15kY3+2rOWtyMKEdXbk7VpU6eRZt KBCvquX4Pels3wsHnHv6gKSu7zrpRMDQ1pKDiOUKllXC15CZMi0tm3No76BPJ/ZP4bvi pZRs3EesscS0qHKW/YruS3+qOHVIa7Ii69fiPJAwOpMd6Rf3CqvWILXa+U+trQAoe4zB 0hJw== X-Gm-Message-State: AOJu0Yz/EmVsOyXIHoO7Saj4/Ll/0of0dr/FVudDib6V8Fwg5BbPNiim GivM/lQxaNCqk1fUvpUbkfkNsRayU3YFZA== X-Received: by 2002:a05:600c:4444:b0:40d:77d4:395b with SMTP id v4-20020a05600c444400b0040d77d4395bmr4184643wmn.59.1704303244894; Wed, 03 Jan 2024 09:34:04 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n4-20020a7bc5c4000000b0040d376ac369sm2876694wmk.40.2024.01.03.09.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:34:02 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 7E2865F9CE; Wed, 3 Jan 2024 17:33:52 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 32/43] gdbstub: Simplify XML lookup Date: Wed, 3 Jan 2024 17:33:38 +0000 Message-Id: <20240103173349.398526-33-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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=unavailable 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: Akihiko Odaki Now we know all instances of GDBFeature that is used in CPU so we can traverse them to find XML. This removes the need for a CPU-specific lookup function for dynamic XMLs. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée Message-Id: <20231213-gdb-v17-7-777047380591@daynix.com> Signed-off-by: Alex Bennée --- include/exec/gdbstub.h | 6 +++ gdbstub/gdbstub.c | 118 +++++++++++++++++++++-------------------- hw/core/cpu-common.c | 5 +- 3 files changed, 69 insertions(+), 60 deletions(-) diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index bcaab1bc750..82a8afa237f 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -27,6 +27,12 @@ typedef struct GDBFeatureBuilder { typedef int (*gdb_get_reg_cb)(CPUState *cpu, GByteArray *buf, int reg); typedef int (*gdb_set_reg_cb)(CPUState *cpu, uint8_t *buf, int reg); +/** + * gdb_init_cpu(): Initialize the CPU for gdbstub. + * @cpu: The CPU to be initialized. + */ +void gdb_init_cpu(CPUState *cpu); + /** * gdb_register_coprocessor() - register a supplemental set of registers * @cpu - the CPU associated with registers diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 21fea7fffae..1d5c1da1b24 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -352,6 +352,7 @@ static const char *get_feature_xml(const char *p, const char **newp, { CPUState *cpu = gdb_get_first_cpu_in_process(process); CPUClass *cc = CPU_GET_CLASS(cpu); + GDBRegisterState *r; size_t len; /* @@ -365,7 +366,6 @@ static const char *get_feature_xml(const char *p, const char **newp, /* Is it the main target xml? */ if (strncmp(p, "target.xml", len) == 0) { if (!process->target_xml) { - GDBRegisterState *r; g_autoptr(GPtrArray) xml = g_ptr_array_new_with_free_func(g_free); g_ptr_array_add( @@ -380,18 +380,12 @@ static const char *get_feature_xml(const char *p, const char **newp, g_markup_printf_escaped("%s", cc->gdb_arch_name(cpu))); } - g_ptr_array_add( - xml, - g_markup_printf_escaped("", - cc->gdb_core_xml_file)); - if (cpu->gdb_regs) { - for (guint i = 0; i < cpu->gdb_regs->len; i++) { - r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); - g_ptr_array_add( - xml, - g_markup_printf_escaped("", - r->feature->xmlname)); - } + for (guint i = 0; i < cpu->gdb_regs->len; i++) { + r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); + g_ptr_array_add( + xml, + g_markup_printf_escaped("", + r->feature->xmlname)); } g_ptr_array_add(xml, g_strdup("")); g_ptr_array_add(xml, NULL); @@ -400,20 +394,11 @@ static const char *get_feature_xml(const char *p, const char **newp, } return process->target_xml; } - /* Is it dynamically generated by the target? */ - if (cc->gdb_get_dynamic_xml) { - g_autofree char *xmlname = g_strndup(p, len); - const char *xml = cc->gdb_get_dynamic_xml(cpu, xmlname); - if (xml) { - return xml; - } - } - /* Is it one of the encoded gdb-xml/ files? */ - for (int i = 0; gdb_static_features[i].xmlname; i++) { - const char *name = gdb_static_features[i].xmlname; - if ((strncmp(name, p, len) == 0) && - strlen(name) == len) { - return gdb_static_features[i].xml; + /* Is it one of the features? */ + for (guint i = 0; i < cpu->gdb_regs->len; i++) { + r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); + if (strncmp(p, r->feature->xmlname, len) == 0) { + return r->feature->xml; } } @@ -508,12 +493,10 @@ static int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) return cc->gdb_read_register(cpu, buf, reg); } - if (cpu->gdb_regs) { - for (guint i = 0; i < cpu->gdb_regs->len; i++) { - r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); - if (r->base_reg <= reg && reg < r->base_reg + r->feature->num_regs) { - return r->get_reg(cpu, buf, reg - r->base_reg); - } + for (guint i = 0; i < cpu->gdb_regs->len; i++) { + r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); + if (r->base_reg <= reg && reg < r->base_reg + r->feature->num_regs) { + return r->get_reg(cpu, buf, reg - r->base_reg); } } return 0; @@ -528,51 +511,70 @@ static int gdb_write_register(CPUState *cpu, uint8_t *mem_buf, int reg) return cc->gdb_write_register(cpu, mem_buf, reg); } - if (cpu->gdb_regs) { - for (guint i = 0; i < cpu->gdb_regs->len; i++) { - r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); - if (r->base_reg <= reg && reg < r->base_reg + r->feature->num_regs) { - return r->set_reg(cpu, mem_buf, reg - r->base_reg); - } + for (guint i = 0; i < cpu->gdb_regs->len; i++) { + r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); + if (r->base_reg <= reg && reg < r->base_reg + r->feature->num_regs) { + return r->set_reg(cpu, mem_buf, reg - r->base_reg); } } return 0; } +static void gdb_register_feature(CPUState *cpu, int base_reg, + gdb_get_reg_cb get_reg, gdb_set_reg_cb set_reg, + const GDBFeature *feature) +{ + GDBRegisterState s = { + .base_reg = base_reg, + .get_reg = get_reg, + .set_reg = set_reg, + .feature = feature + }; + + g_array_append_val(cpu->gdb_regs, s); +} + +void gdb_init_cpu(CPUState *cpu) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); + const GDBFeature *feature; + + cpu->gdb_regs = g_array_new(false, false, sizeof(GDBRegisterState)); + + if (cc->gdb_core_xml_file) { + feature = gdb_find_static_feature(cc->gdb_core_xml_file); + gdb_register_feature(cpu, 0, + cc->gdb_read_register, cc->gdb_write_register, + feature); + } + + cpu->gdb_num_regs = cpu->gdb_num_g_regs = cc->gdb_num_core_regs; +} + void gdb_register_coprocessor(CPUState *cpu, gdb_get_reg_cb get_reg, gdb_set_reg_cb set_reg, const GDBFeature *feature, int g_pos) { GDBRegisterState *s; guint i; + int base_reg = cpu->gdb_num_regs; - if (cpu->gdb_regs) { - for (i = 0; i < cpu->gdb_regs->len; i++) { - /* Check for duplicates. */ - s = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); - if (s->feature == feature) { - return; - } + for (i = 0; i < cpu->gdb_regs->len; i++) { + /* Check for duplicates. */ + s = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); + if (s->feature == feature) { + return; } - } else { - cpu->gdb_regs = g_array_new(false, false, sizeof(GDBRegisterState)); - i = 0; } - g_array_set_size(cpu->gdb_regs, i + 1); - s = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); - s->base_reg = cpu->gdb_num_regs; - s->get_reg = get_reg; - s->set_reg = set_reg; - s->feature = feature; + gdb_register_feature(cpu, base_reg, get_reg, set_reg, feature); /* Add to end of list. */ cpu->gdb_num_regs += feature->num_regs; if (g_pos) { - if (g_pos != s->base_reg) { + if (g_pos != base_reg) { error_report("Error: Bad gdb register numbering for '%s', " - "expected %d got %d", feature->xml, - g_pos, s->base_reg); + "expected %d got %d", feature->xml, g_pos, base_reg); } else { cpu->gdb_num_g_regs = cpu->gdb_num_regs; } diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 82dae51a550..cd7903ba6e7 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -27,6 +27,7 @@ #include "qemu/main-loop.h" #include "exec/log.h" #include "exec/cpu-common.h" +#include "exec/gdbstub.h" #include "qemu/error-report.h" #include "qemu/qemu-print.h" #include "sysemu/tcg.h" @@ -238,11 +239,10 @@ static void cpu_common_unrealizefn(DeviceState *dev) static void cpu_common_initfn(Object *obj) { CPUState *cpu = CPU(obj); - CPUClass *cc = CPU_GET_CLASS(obj); + gdb_init_cpu(cpu); cpu->cpu_index = UNASSIGNED_CPU_INDEX; cpu->cluster_index = UNASSIGNED_CLUSTER_INDEX; - cpu->gdb_num_regs = cpu->gdb_num_g_regs = cc->gdb_num_core_regs; /* user-mode doesn't have configurable SMP topology */ /* the default value is changed by qemu_init_vcpu() for system-mode */ cpu->nr_cores = 1; @@ -262,6 +262,7 @@ static void cpu_common_finalize(Object *obj) { CPUState *cpu = CPU(obj); + g_array_free(cpu->gdb_regs, TRUE); qemu_lockcnt_destroy(&cpu->in_ioctl_lock); qemu_mutex_destroy(&cpu->work_mutex); } From patchwork Wed Jan 3 17:33:39 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: 759652 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6615935wrw; Wed, 3 Jan 2024 09:50:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVFX9AqecmD4jPngV8SgLjQ+XyEMWkGH0xyoeePRWyHaOCW+clQ/Mi7bO56id3LH2QqCIs X-Received: by 2002:ac8:5d12:0:b0:428:1f17:da3f with SMTP id f18-20020ac85d12000000b004281f17da3fmr7296921qtx.64.1704304235060; Wed, 03 Jan 2024 09:50:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704304235; cv=none; d=google.com; s=arc-20160816; b=oFsdBCB3IlLiqxMY52OQPbdX+xZ6ljeSFHqubVqL9WSXVfcLFio+I0T2qSg5xdeo2f ff1EgtKhs/vLg/b4Kblx6ouXQf9l+tjgHzQQ+j1GLhitn/SS5ANtrtCVGNxj09XBlUOG 2+Xz7ErBUov9l8rXTNbwHphhAXk0lrURXZMEdvwADb4llrz6fdEWERkqEy+a37r/j1UK yWyMqKXtgBlOaxASDjAi2ha8laUXla1bHbMLoyfMcyy6P738uyzSsX39UI+TNbyCvehW UdcX/Wyduq1uVgI6vpzEVDBcmZ9gsbMmQTZv+RZaB1kSpgsbS9KkJsLIcX5O2i1Eb40L CUlA== 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=IoPhlDtSpkqOBAkbXg7Jomw9H+X+ji4M7szqhxwl60s=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=lH+dnkoFdSnYZyz0b0Ucny02CJg0owLYV7CcWIoGoSk7EpSNG5GCvtVS94UP1li1fy PuR3SqLnuxuS3gacSv4FQ5d/LsYrTKKj1NZosDwnHm6Kw1L1gt3DLfwGkmij47LhaVvV k+6K3O6DlGeX82rkCJQnkpdRSXrECRNERy1RFmH+pyRkKTUlN2TrKCLxJejeQvMxBpLA yMpn7nFjCsIErwjvPyXppJnmBJSbAA070oyIlwMvt1g0nL7/80mbLdqCthc/MeJVc45t VLmQtZ5MuCFjL1Csx29oarQpTxUAcwpq1/jv+VbevADbVu2xVOvUC5IUHwXsBUuSIFU9 HjXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X9Pc2cDX; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g16-20020ac87d10000000b004282639384csi5713716qtb.53.2024.01.03.09.50.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:50:35 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X9Pc2cDX; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5Mt-0001qg-EY; Wed, 03 Jan 2024 12:49:27 -0500 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 1rL5Mk-0000uo-Jo for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:49:18 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5Mb-0000OX-K7 for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:49:18 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40d88fff7faso25006905e9.3 for ; Wed, 03 Jan 2024 09:49:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704304148; x=1704908948; 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=IoPhlDtSpkqOBAkbXg7Jomw9H+X+ji4M7szqhxwl60s=; b=X9Pc2cDXz1jnKecmeHYhD9I+cSF4N8ih+rxMLYjfQY8yUbcWiUjwH9mSvGNLS3yS6Z 9ozgCrtSDlFUTcPpxugIhXgwPXcxHN8PhWH6KG+z4iLav4QQo06P0OshShqtvezqEpgz 7RhCr1MtxuzzZOWvURM/adQZl2qYJMJL+YYSIGp4AeF/DQ8RRZl5LSNM4CH+KPVoZg4e sHl2Cgowv2Nl081oPwXNOh+UMoS1sl2NVP+d4q0WRluSgi0ppKau3c3qs1nKqzytWpVr W2kCHGFZ2gHa6gSkMlLerJ+fN8WJot+NagAUhfGNOZYsGhPs8BurNYMz3g2zDGHZY4zc hrsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704304148; x=1704908948; 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=IoPhlDtSpkqOBAkbXg7Jomw9H+X+ji4M7szqhxwl60s=; b=GT0Xv39WRipguo3WBpXGyYO9Dsa9ChCBZhk0qIS7Jamt7uVS8WRrVhINOTI7lpvX/L yw5wJ8OXqXRTO6bLj5N6/3v3GYCE7Hs/leoH8m2jB/yxLrjHOtXdO2GKWjMt+zm4gwg2 iriMENoUEf8XP6OWYuq5BH6cuCrHZy+SmfrTWsf3IAiILGvrgj+DYHK/CtMs0mmfvSWs bgyMR9frkNSt+W8W+5J61b32KEhgV3Prl/1EYd+oYxdjIU1M34X9GSWvZ5J4fbgnpovF fq2HGdqB/rLI6TnaLPM/OrjbkXNLDYic7Mx1KnWe93n46+ffegAzmXhwH6kUHvUJA5jh D9Vw== X-Gm-Message-State: AOJu0YwdKASar4+XsdV0W5X6miRhG+YxDjxIC/KFqaaNpcrv3U8vBDHI 9FyIG/L5PEOIKPbctY0v1Vs2VkG7UcSBtA== X-Received: by 2002:a05:600c:548a:b0:40d:8759:e409 with SMTP id iv10-20020a05600c548a00b0040d8759e409mr1590122wmb.331.1704304148084; Wed, 03 Jan 2024 09:49:08 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q8-20020a05600c46c800b0040d2d33312csm3030777wmo.2.2024.01.03.09.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:49:07 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id A465C5F9CF; Wed, 3 Jan 2024 17:33:52 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 33/43] gdbstub: Infer number of core registers from XML Date: Wed, 3 Jan 2024 17:33:39 +0000 Message-Id: <20240103173349.398526-34-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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=unavailable 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: Akihiko Odaki GDBFeature has the num_regs member so use it where applicable to remove magic numbers. Signed-off-by: Akihiko Odaki Message-Id: <20231213-gdb-v17-8-777047380591@daynix.com> Signed-off-by: Alex Bennée --- include/hw/core/cpu.h | 3 ++- target/s390x/cpu.h | 2 -- gdbstub/gdbstub.c | 5 ++++- target/arm/cpu.c | 1 - target/arm/cpu64.c | 1 - target/avr/cpu.c | 1 - target/hexagon/cpu.c | 1 - target/i386/cpu.c | 2 -- target/loongarch/cpu.c | 2 -- target/m68k/cpu.c | 1 - target/microblaze/cpu.c | 1 - target/riscv/cpu.c | 1 - target/rx/cpu.c | 1 - target/s390x/cpu.c | 1 - 14 files changed, 6 insertions(+), 17 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index c0c8320413e..a6214610603 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -127,7 +127,8 @@ struct SysemuCPUOps; * @gdb_adjust_breakpoint: Callback for adjusting the address of a * breakpoint. Used by AVR to handle a gdb mis-feature with * its Harvard architecture split code and data. - * @gdb_num_core_regs: Number of core registers accessible to GDB. + * @gdb_num_core_regs: Number of core registers accessible to GDB or 0 to infer + * from @gdb_core_xml_file. * @gdb_core_xml_file: File name for core registers GDB XML description. * @gdb_stop_before_watchpoint: Indicates whether GDB expects the CPU to stop * before the insn which triggers a watchpoint rather than after it. diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index fa3aac4f973..2d81fbfea5c 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -491,8 +491,6 @@ static inline void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *pc, #define S390_R13_REGNUM 15 #define S390_R14_REGNUM 16 #define S390_R15_REGNUM 17 -/* Total Core Registers. */ -#define S390_NUM_CORE_REGS 18 static inline void setcc(S390CPU *cpu, uint64_t cc) { diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 1d5c1da1b24..801eba9a0b0 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -546,9 +546,12 @@ void gdb_init_cpu(CPUState *cpu) gdb_register_feature(cpu, 0, cc->gdb_read_register, cc->gdb_write_register, feature); + cpu->gdb_num_regs = cpu->gdb_num_g_regs = feature->num_regs; } - cpu->gdb_num_regs = cpu->gdb_num_g_regs = cc->gdb_num_core_regs; + if (cc->gdb_num_core_regs) { + cpu->gdb_num_regs = cpu->gdb_num_g_regs = cc->gdb_num_core_regs; + } } void gdb_register_coprocessor(CPUState *cpu, diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 650e09b29c5..0a02d16220b 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2498,7 +2498,6 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) #ifndef CONFIG_USER_ONLY cc->sysemu_ops = &arm_sysemu_ops; #endif - cc->gdb_num_core_regs = 26; cc->gdb_arch_name = arm_gdb_arch_name; cc->gdb_get_dynamic_xml = arm_gdb_get_dynamic_xml; cc->gdb_stop_before_watchpoint = true; diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 8e30a7993ea..869d8dd24ee 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -793,7 +793,6 @@ static void aarch64_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_read_register = aarch64_cpu_gdb_read_register; cc->gdb_write_register = aarch64_cpu_gdb_write_register; - cc->gdb_num_core_regs = 34; cc->gdb_core_xml_file = "aarch64-core.xml"; cc->gdb_arch_name = aarch64_gdb_arch_name; diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 999c010dedb..4bab9e22728 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -251,7 +251,6 @@ static void avr_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_read_register = avr_cpu_gdb_read_register; cc->gdb_write_register = avr_cpu_gdb_write_register; cc->gdb_adjust_breakpoint = avr_cpu_gdb_adjust_breakpoint; - cc->gdb_num_core_regs = 35; cc->gdb_core_xml_file = "avr-cpu.xml"; cc->tcg_ops = &avr_tcg_ops; } diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index 65ac9c75ad0..71678ef9c67 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -384,7 +384,6 @@ static void hexagon_cpu_class_init(ObjectClass *c, void *data) cc->get_pc = hexagon_cpu_get_pc; cc->gdb_read_register = hexagon_gdb_read_register; cc->gdb_write_register = hexagon_gdb_write_register; - cc->gdb_num_core_regs = TOTAL_PER_THREAD_REGS; cc->gdb_stop_before_watchpoint = true; cc->gdb_core_xml_file = "hexagon-core.xml"; cc->disas_set_info = hexagon_cpu_disas_set_info; diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 95d5f16cd5e..b14c97169cd 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -7969,10 +7969,8 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) cc->gdb_arch_name = x86_gdb_arch_name; #ifdef TARGET_X86_64 cc->gdb_core_xml_file = "i386-64bit.xml"; - cc->gdb_num_core_regs = 66; #else cc->gdb_core_xml_file = "i386-32bit.xml"; - cc->gdb_num_core_regs = 50; #endif cc->disas_set_info = x86_disas_set_info; diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 07319d6fb97..dfac51a7f60 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -851,7 +851,6 @@ static void loongarch32_cpu_class_init(ObjectClass *c, void *data) { CPUClass *cc = CPU_CLASS(c); - cc->gdb_num_core_regs = 35; cc->gdb_core_xml_file = "loongarch-base32.xml"; cc->gdb_arch_name = loongarch32_gdb_arch_name; } @@ -865,7 +864,6 @@ static void loongarch64_cpu_class_init(ObjectClass *c, void *data) { CPUClass *cc = CPU_CLASS(c); - cc->gdb_num_core_regs = 35; cc->gdb_core_xml_file = "loongarch-base64.xml"; cc->gdb_arch_name = loongarch64_gdb_arch_name; } diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 11c7e0a7902..a27194b2a59 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -564,7 +564,6 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data) #endif cc->disas_set_info = m68k_cpu_disas_set_info; - cc->gdb_num_core_regs = 18; cc->tcg_ops = &m68k_tcg_ops; } diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 1998f69828f..9d3fbfe1592 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -428,7 +428,6 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) cc->sysemu_ops = &mb_sysemu_ops; #endif device_class_set_props(dc, mb_properties); - cc->gdb_num_core_regs = 32 + 25; cc->gdb_core_xml_file = "microblaze-core.xml"; cc->disas_set_info = mb_disas_set_info; diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 673e937a5d8..a3a98230ca8 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1688,7 +1688,6 @@ static void riscv_cpu_common_class_init(ObjectClass *c, void *data) cc->get_pc = riscv_cpu_get_pc; cc->gdb_read_register = riscv_cpu_gdb_read_register; cc->gdb_write_register = riscv_cpu_gdb_write_register; - cc->gdb_num_core_regs = 33; cc->gdb_stop_before_watchpoint = true; cc->disas_set_info = riscv_cpu_disas_set_info; #ifndef CONFIG_USER_ONLY diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 9cc9d9d15ec..cf11b189116 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -231,7 +231,6 @@ static void rx_cpu_class_init(ObjectClass *klass, void *data) cc->gdb_write_register = rx_cpu_gdb_write_register; cc->disas_set_info = rx_cpu_disas_set_info; - cc->gdb_num_core_regs = 26; cc->gdb_core_xml_file = "rx-core.xml"; cc->tcg_ops = &rx_tcg_ops; } diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 6acfa1c91b2..6fba9497295 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -362,7 +362,6 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) s390_cpu_class_init_sysemu(cc); #endif cc->disas_set_info = s390_cpu_disas_set_info; - cc->gdb_num_core_regs = S390_NUM_CORE_REGS; cc->gdb_core_xml_file = "s390x-core64.xml"; cc->gdb_arch_name = s390_gdb_arch_name; From patchwork Wed Jan 3 17:33:40 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: 759643 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6613493wrw; Wed, 3 Jan 2024 09:43:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IFZyefmYrJlpHNvby/P5FNV9bqDdZ+N4TGvO9v8M1k32CcsR7/KwkfCJnf4N3LY6nsiMCRM X-Received: by 2002:ac8:7dcf:0:b0:428:1f60:5dce with SMTP id c15-20020ac87dcf000000b004281f605dcemr7554070qte.86.1704303814732; Wed, 03 Jan 2024 09:43:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303814; cv=none; d=google.com; s=arc-20160816; b=UxxDqrYKAJ49npXf9AFIV2Aucnjd8AGsGPxy9Lkv/VWgj1AkW/l3Q/Y0Ndr5vImker e6RxN9H6+iWurwIosDZkkOBWw7dfeniuXm4sj+jlGOoZYEA7yWKPxXeeSfG+y8qxzBI0 C1EQHH/5vdb38nljHcr8UJBegXqC9+/1C/IHzes1fe1lf7a5R3A1s3EZwaHuAqe4eLw6 6dug41BjLhC7leKKynnTwWuJktFo5DVpyLWiGDqv77Z8FTvYKAsN32kjDmRIfGgAqPqn NRmzw6GMCCgLxLm+jvnYaL6BjJBx2CAv0+kya5L1mCMvYLZvG9kF28iRhT1E8gJKR+jN yGxQ== 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=j5PGmkkL/PhNktzCzA9/ck6zIPH9FB5CIkJrjOgUxHc=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=OBQ4Ky9B8oZmAS4DmIZfV39iHUdox9O/KA7HC5O+yVIwFMiHIf0BaoF9mlKGLUKILW fPSHgl3ookpqOwEQMemvxsJaQHeArMaLQqqCpIY6b/OL9+XYajO/5ttS5UT+Mtb/aNXk BMY8/HMcZrqPS7+pUfhmwIy9EZayD6AB1iS1itPJGSB3qlrRrABIQpkhZWb6X8sv/Doh YSHwAHoNWYE01r4GFKKfSCRKQC3kqg7BTaqGj6ngRygpqdjPQfQtAWG+g/mZVZjbUqpJ BsapnvNWGiqdK1+xn4DKRMSlmp4rXz/KJUn89AyBEY7IdSb6TbaYMM2TtEf1brlJ6qfL DX7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D9fdY4Pm; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i20-20020ac85c14000000b004281f19401esi7038974qti.317.2024.01.03.09.43.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:43:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D9fdY4Pm; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5Dh-0008RS-7M; Wed, 03 Jan 2024 12:39:57 -0500 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 1rL5DY-00081K-D6 for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:48 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5D4-0000nh-Rv for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:48 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40d2376db79so95820565e9.0 for ; Wed, 03 Jan 2024 09:39:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303557; x=1704908357; 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=j5PGmkkL/PhNktzCzA9/ck6zIPH9FB5CIkJrjOgUxHc=; b=D9fdY4Pmx0GB21XuLqoROjFjhLY1P20xbr2dlZYHzMflvvD9eU3H3u4ZA7vT5r0Mm7 ZPjQDVQ5JWSkClAEMMgcU4EEv/gm9ApdtgAsTThMTcgrvzeB+IWnxd+UTgdmBchZ1xEF Lmjamrc0B4RiJc/HCMR+HdOLMFIIES6VDJH22J6Zkrh8VnXEM5/Xk92Hx9lSY+i3SuQq UtQaOQta91yex4ZhvJByTKthdQ/xqZTqMTc6Dar0BL99Ci/HUqF9BGC/7MPwXW0zBLKa a1/696zJ6vZPOYRRHN7qHmi1onFdvkr+dRVXu2Eqn5vMtJBPb6C11ZBeWVUmeSfdYl4E a34g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303557; x=1704908357; 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=j5PGmkkL/PhNktzCzA9/ck6zIPH9FB5CIkJrjOgUxHc=; b=YudGEwlRxlROCeZSGscJBPnl7nYU7eN8EnsCsWIs34jF6ERTCS7R9b85D5vvbk/kNz VjG4mo9JsWr4h1iGRYl30thIQZY09FR4rU4RHZIXnMNSVnkuvgP8tBCklUhsAIy28iYz DqwWlaznrU1YS/XTLIIr5+YqcXBruJ//SwC09jaL1X7x3jqrL+DLLGLOo/96lDoi1OAs 84+2prIvW7B+k1mzNGdzQh4p8qoAVEDT1UsskYnbVhUY7IX2ZRBrlyuTpu3+O2+LZWvz g68vUpjuvM2VVv+BnNHFwqz0VUrxwNUkLdqjmLx6iJDATwxtP8JUfrK79V/UOHFAEmlJ equA== X-Gm-Message-State: AOJu0Yx806EsCDD3hiNBQBBMC73dFn/Oi9zmzX/M/LrqWA8+z4OTxYXB 0GSXPU8/HVuLalT35XVFtwRJ1lE7Ft+u/w== X-Received: by 2002:a05:600c:1992:b0:40d:5fed:eecf with SMTP id t18-20020a05600c199200b0040d5fedeecfmr6209855wmq.101.1704303556896; Wed, 03 Jan 2024 09:39:16 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id bl13-20020adfe24d000000b003365fcc1846sm31132628wrb.52.2024.01.03.09.39.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:39:13 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id C478B5F9D0; Wed, 3 Jan 2024 17:33:52 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 34/43] hw/core/cpu: Remove gdb_get_dynamic_xml member Date: Wed, 3 Jan 2024 17:33:40 +0000 Message-Id: <20240103173349.398526-35-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.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=unavailable 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: Akihiko Odaki This function is no longer used. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée Message-Id: <20231213-gdb-v17-9-777047380591@daynix.com> Signed-off-by: Alex Bennée --- include/hw/core/cpu.h | 4 ---- target/arm/cpu.h | 6 ------ target/ppc/cpu.h | 1 - target/arm/cpu.c | 1 - target/arm/gdbstub.c | 18 ------------------ target/ppc/cpu_init.c | 3 --- target/ppc/gdbstub.c | 10 ---------- target/riscv/cpu.c | 14 -------------- 8 files changed, 57 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index a6214610603..17f99adc0f4 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -134,9 +134,6 @@ struct SysemuCPUOps; * before the insn which triggers a watchpoint rather than after it. * @gdb_arch_name: Optional callback that returns the architecture name known * to GDB. The caller must free the returned string with g_free. - * @gdb_get_dynamic_xml: Callback to return dynamically generated XML for the - * gdb stub. Returns a pointer to the XML contents for the specified XML file - * or NULL if the CPU doesn't have a dynamically generated content for it. * @disas_set_info: Setup architecture specific components of disassembly info * @adjust_watchpoint_address: Perform a target-specific adjustment to an * address before attempting to match it against watchpoints. @@ -167,7 +164,6 @@ struct CPUClass { const char *gdb_core_xml_file; const gchar * (*gdb_arch_name)(CPUState *cpu); - const char * (*gdb_get_dynamic_xml)(CPUState *cpu, const char *xmlname); void (*disas_set_info)(CPUState *cpu, disassemble_info *info); diff --git a/target/arm/cpu.h b/target/arm/cpu.h index b2f8ac81f06..c8e77440f0f 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1182,12 +1182,6 @@ hwaddr arm_cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr, int arm_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int arm_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); -/* Returns the dynamically generated XML for the gdb stub. - * Returns a pointer to the XML contents for the specified XML file or NULL - * if the XML name doesn't match the predefined one. - */ -const char *arm_gdb_get_dynamic_xml(CPUState *cpu, const char *xmlname); - int arm_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, int cpuid, DumpState *s); int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index f87c26f98a6..9f94282e13e 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1524,7 +1524,6 @@ int ppc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); int ppc_cpu_gdb_write_register_apple(CPUState *cpu, uint8_t *buf, int reg); #ifndef CONFIG_USER_ONLY hwaddr ppc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); -const char *ppc_gdb_get_dynamic_xml(CPUState *cs, const char *xml_name); #endif int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, int cpuid, DumpState *s); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 0a02d16220b..9514edaf041 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2499,7 +2499,6 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->sysemu_ops = &arm_sysemu_ops; #endif cc->gdb_arch_name = arm_gdb_arch_name; - cc->gdb_get_dynamic_xml = arm_gdb_get_dynamic_xml; cc->gdb_stop_before_watchpoint = true; cc->disas_set_info = arm_disas_set_info; diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c index 059d84f98e5..a3bb73cfa7c 100644 --- a/target/arm/gdbstub.c +++ b/target/arm/gdbstub.c @@ -474,24 +474,6 @@ static GDBFeature *arm_gen_dynamic_m_secextreg_feature(CPUState *cs, #endif #endif /* CONFIG_TCG */ -const char *arm_gdb_get_dynamic_xml(CPUState *cs, const char *xmlname) -{ - ARMCPU *cpu = ARM_CPU(cs); - - if (strcmp(xmlname, "system-registers.xml") == 0) { - return cpu->dyn_sysreg_feature.desc.xml; - } else if (strcmp(xmlname, "sve-registers.xml") == 0) { - return cpu->dyn_svereg_feature.desc.xml; - } else if (strcmp(xmlname, "arm-m-system.xml") == 0) { - return cpu->dyn_m_systemreg_feature.desc.xml; -#ifndef CONFIG_USER_ONLY - } else if (strcmp(xmlname, "arm-m-secext.xml") == 0) { - return cpu->dyn_m_secextreg_feature.desc.xml; -#endif - } - return NULL; -} - void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu) { CPUState *cs = CPU(cpu); diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index a0178c3ce80..909d753b022 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7380,9 +7380,6 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) #endif cc->gdb_num_core_regs = 71; -#ifndef CONFIG_USER_ONLY - cc->gdb_get_dynamic_xml = ppc_gdb_get_dynamic_xml; -#endif #ifdef USE_APPLE_GDB cc->gdb_read_register = ppc_cpu_gdb_read_register_apple; cc->gdb_write_register = ppc_cpu_gdb_write_register_apple; diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c index 8ca37b6bf95..f47878a67bd 100644 --- a/target/ppc/gdbstub.c +++ b/target/ppc/gdbstub.c @@ -342,16 +342,6 @@ static void gdb_gen_spr_feature(CPUState *cs) gdb_feature_builder_end(&builder); } - -const char *ppc_gdb_get_dynamic_xml(CPUState *cs, const char *xml_name) -{ - PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cs); - - if (strcmp(xml_name, "power-spr.xml") == 0) { - return pcc->gdb_spr.xml; - } - return NULL; -} #endif #if !defined(CONFIG_USER_ONLY) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index a3a98230ca8..1e3ac556b33 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1529,19 +1529,6 @@ static const gchar *riscv_gdb_arch_name(CPUState *cs) } } -static const char *riscv_gdb_get_dynamic_xml(CPUState *cs, const char *xmlname) -{ - RISCVCPU *cpu = RISCV_CPU(cs); - - if (strcmp(xmlname, "riscv-csr.xml") == 0) { - return cpu->dyn_csr_feature.xml; - } else if (strcmp(xmlname, "riscv-vector.xml") == 0) { - return cpu->dyn_vreg_feature.xml; - } - - return NULL; -} - #ifndef CONFIG_USER_ONLY static int64_t riscv_get_arch_id(CPUState *cs) { @@ -1695,7 +1682,6 @@ static void riscv_cpu_common_class_init(ObjectClass *c, void *data) cc->get_arch_id = riscv_get_arch_id; #endif cc->gdb_arch_name = riscv_gdb_arch_name; - cc->gdb_get_dynamic_xml = riscv_gdb_get_dynamic_xml; object_class_property_add(c, "mvendorid", "uint32", cpu_get_mvendorid, cpu_set_mvendorid, NULL, NULL); From patchwork Wed Jan 3 17:33:41 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: 759649 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6615645wrw; Wed, 3 Jan 2024 09:49:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IEPz4xUKWLNwppyVavyXvv0AAJYn/YCRz4//m4uGxdFz5UjCiTRogI4baJie8JQKO6S5OIk X-Received: by 2002:a05:620a:1670:b0:77e:fba3:a7bb with SMTP id d16-20020a05620a167000b0077efba3a7bbmr16975822qko.153.1704304178965; Wed, 03 Jan 2024 09:49:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704304178; cv=none; d=google.com; s=arc-20160816; b=yGaZzQT2VOkl971PScrSfCDYSlK5nQ4z+jA9I6qcqsGr7FgU2bxWWbgGeyqb4BL8PL VRPvgiALtkeZLA4KkrtQy2KIrKrnyvSy8yAYHpVNTUMx1uO7F/IPsK7Fff7k9pfuhVUa l+65RI60v1f+95FxpCbkpKcmKg6LKDF6z+1sDmEUIUaBY7qhs+CR9j3qla8oJnFHFSyf ahqvxkhWAlVIiHtUTT0b68x8HfbR1Dyny+4Ahn383sotVOvNQ/3e2cYmOkE489E0l/HM +fsyH7WA6xgWl4iC1LU3Ptvgz/HtX0R7ZH/GipEZHyNHiQCQtkrI5QaAeV6kSW+EexY1 Xf/Q== 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=iz4XjWcI1n0170OiHCw9kC1AKAhw4u9LezlV3t4Jyjw=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=MLvLgLSg+k4dzf1KXBXd6LguxuvdVwPIxOSgaCcdd2BCPOCH5GVkNzJl0GMxyUKFOd MEYc3v25GczGAYbJtW9XfC5MSLRB8LL/52i0kvZn59o4eSJFZMQSnDKKWovqirUlQgtA YszDKRPUIqaLxIARJIqNf6xE8jnDLzYAVvMI0i+As9ZttxohktCPhrmj5tXMsBu/t+sv oYu1Yk5/h+lrbbAPaMZK9RAy7jB75j+R57KH2g3gSg/M/7plcQrSc8u4/cQFfOLEMgWG yDBXejhVci9ygbiknGu3vnRX7hsVkM7Ig/l1enPX76SeIF3VnahilV+hZfdhSqozUT3L RJkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LILrE4u+; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z3-20020a05620a08c300b00781711c066csi14068749qkz.514.2024.01.03.09.49.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:49:38 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LILrE4u+; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5Mi-0000kV-Rw; Wed, 03 Jan 2024 12:49:16 -0500 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 1rL5Mf-0000To-HW for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:49:13 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5Ma-0000Io-7S for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:49:13 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40d88fff7faso25006585e9.3 for ; Wed, 03 Jan 2024 09:49:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704304146; x=1704908946; 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=iz4XjWcI1n0170OiHCw9kC1AKAhw4u9LezlV3t4Jyjw=; b=LILrE4u+5KDcp5xNCD3jhTp6XtnhoIplAwTQRWfT6iBy/COOP8/rL7NBGBdg4zJGvI 1ReBBlMD7mbQ3+NEKH1zRiG1WRcGpsuBmWO174/5wu2NWunG0xuR5zLW0QnK55i4KrMw ulV493HGHWFJ2PBLKLt2vE9I1hxQCG5Lfmr06E9hYItIx9wu+JlLVPSNw91ty1T623Hk Ex+BPk6eLNFsnYGSrO1LUvG/ka8rdtAWLU5MilUPCKsB1mGrtn0vEZAvt5aLf5ktQRlv RBNZz5NGLLdKB0Z1fDhLE0D9aLSZtRELi27qEeI4Qe6RBydtncDbrYmHOam913EXJxoe uIng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704304146; x=1704908946; 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=iz4XjWcI1n0170OiHCw9kC1AKAhw4u9LezlV3t4Jyjw=; b=pAJzjihsJ4Dx7Oj/mQBbtdRUr1Fs8Kc12pz+LVjZzih6ezezzwxbiNL6spIE5VyoXP B7XZ+DaLOU7pcWfIWKKEyrVtKeEFsB4GBCCWIKTGoQj7qHwEXbIfUhDhQGDIEpWhdJ7d k0t6k2hGCVukb+6xtJQSTnVEDV3RuJNAyZQ0JOlCYHoXs/sQ+d3sBj6rF3MUyfA1F/Fs atLYxiSN9EXtQqqi9v9lswdQ163kvx37L38U2ZpSCpq0PqcDs1k3ZgTbwdcuMBZZmqeX /PvB1YoVCB6u9UaquOxBszT4jOat7S7fOJ5+DdsbUB03Wf1u2ow8L79e4s3g79dEiy3p QyWg== X-Gm-Message-State: AOJu0YyN9aBs67ATfoXKNR6aS+QAYbpLB28LPq9HO1E4YFvxZ8FEKTGu ezIeguq1xAtglwL56ckX6pkLFNqsc5dAtQ== X-Received: by 2002:a05:600c:22c3:b0:40d:6085:b90 with SMTP id 3-20020a05600c22c300b0040d60850b90mr2707802wmg.363.1704304146473; Wed, 03 Jan 2024 09:49:06 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id iw13-20020a05600c54cd00b0040c11fbe581sm2950995wmb.27.2024.01.03.09.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:49:05 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id E20355F9D1; Wed, 3 Jan 2024 17:33:52 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 35/43] gdbstub: Add members to identify registers to GDBFeature Date: Wed, 3 Jan 2024 17:33:41 +0000 Message-Id: <20240103173349.398526-36-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.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=unavailable 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: Akihiko Odaki These members will be used to help plugins to identify registers. The added members in instances of GDBFeature dynamically generated by CPUs will be filled in later changes. Signed-off-by: Akihiko Odaki Message-Id: <20231213-gdb-v17-10-777047380591@daynix.com> Signed-off-by: Alex Bennée --- include/exec/gdbstub.h | 3 +++ gdbstub/gdbstub.c | 12 +++++++++--- target/riscv/gdbstub.c | 4 +--- scripts/feature_to_c.py | 14 +++++++++++++- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index 82a8afa237f..da9ddfe54c5 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -13,12 +13,15 @@ typedef struct GDBFeature { const char *xmlname; const char *xml; + const char *name; + const char * const *regs; int num_regs; } GDBFeature; typedef struct GDBFeatureBuilder { GDBFeature *feature; GPtrArray *xml; + GPtrArray *regs; int base_reg; } GDBFeatureBuilder; diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 801eba9a0b0..420ab2a3766 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -419,9 +419,10 @@ void gdb_feature_builder_init(GDBFeatureBuilder *builder, GDBFeature *feature, builder->feature = feature; builder->xml = g_ptr_array_new(); g_ptr_array_add(builder->xml, header); + builder->regs = g_ptr_array_new(); builder->base_reg = base_reg; feature->xmlname = xmlname; - feature->num_regs = 0; + feature->name = name; } void gdb_feature_builder_append_tag(const GDBFeatureBuilder *builder, @@ -440,10 +441,12 @@ void gdb_feature_builder_append_reg(const GDBFeatureBuilder *builder, const char *type, const char *group) { - if (builder->feature->num_regs < regnum) { - builder->feature->num_regs = regnum; + if (builder->regs->len <= regnum) { + g_ptr_array_set_size(builder->regs, regnum + 1); } + builder->regs->pdata[regnum] = (gpointer *)name; + if (group) { gdb_feature_builder_append_tag( builder, @@ -469,6 +472,9 @@ void gdb_feature_builder_end(const GDBFeatureBuilder *builder) } g_ptr_array_free(builder->xml, TRUE); + + builder->feature->num_regs = builder->regs->len; + builder->feature->regs = (void *)g_ptr_array_free(builder->regs, FALSE); } const GDBFeature *gdb_find_static_feature(const char *xmlname) diff --git a/target/riscv/gdbstub.c b/target/riscv/gdbstub.c index 68d0fdc1fd6..d9b52ffd09b 100644 --- a/target/riscv/gdbstub.c +++ b/target/riscv/gdbstub.c @@ -266,11 +266,9 @@ static GDBFeature *riscv_gen_dynamic_csr_feature(CPUState *cs, int base_reg) } predicate = csr_ops[i].predicate; if (predicate && (predicate(env, i) == RISCV_EXCP_NONE)) { - g_autofree char *dynamic_name = NULL; name = csr_ops[i].name; if (!name) { - dynamic_name = g_strdup_printf("csr%03x", i); - name = dynamic_name; + name = g_strdup_printf("csr%03x", i); } gdb_feature_builder_append_reg(&builder, name, bitsize, i, diff --git a/scripts/feature_to_c.py b/scripts/feature_to_c.py index e04d6b2df7f..807af0e685c 100644 --- a/scripts/feature_to_c.py +++ b/scripts/feature_to_c.py @@ -50,7 +50,9 @@ def writeliteral(indent, bytes): sys.stderr.write(f'unexpected start tag: {element.tag}\n') exit(1) + feature_name = element.attrib['name'] regnum = 0 + regnames = [] regnums = [] tags = ['feature'] for event, element in events: @@ -67,6 +69,7 @@ def writeliteral(indent, bytes): if 'regnum' in element.attrib: regnum = int(element.attrib['regnum']) + regnames.append(element.attrib['name']) regnums.append(regnum) regnum += 1 @@ -85,6 +88,15 @@ def writeliteral(indent, bytes): writeliteral(8, bytes(os.path.basename(input), 'utf-8')) sys.stdout.write(',\n') writeliteral(8, read) - sys.stdout.write(f',\n {num_regs},\n }},\n') + sys.stdout.write(',\n') + writeliteral(8, bytes(feature_name, 'utf-8')) + sys.stdout.write(',\n (const char * const []) {\n') + + for index, regname in enumerate(regnames): + sys.stdout.write(f' [{regnums[index] - base_reg}] =\n') + writeliteral(16, bytes(regname, 'utf-8')) + sys.stdout.write(',\n') + + sys.stdout.write(f' }},\n {num_regs},\n }},\n') sys.stdout.write(' { NULL }\n};\n') From patchwork Wed Jan 3 17:33:42 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: 759618 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6610928wrw; Wed, 3 Jan 2024 09:37:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJ8xQD7bHuLlnDA7VWPJ/8ySnitWaR9FDPhrvy7wKW0nGGBNIPh0bBvqHRiaxHisVgKkSa X-Received: by 2002:a05:620a:17a9:b0:781:18e1:613d with SMTP id ay41-20020a05620a17a900b0078118e1613dmr24117488qkb.101.1704303422093; Wed, 03 Jan 2024 09:37:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303422; cv=none; d=google.com; s=arc-20160816; b=h8+AF/KtSul8VpD0d8egDpE6+DQs8jzLSUbBCd6drwte5+JjYVZOeNomFn+XVMtdmz qubQB0r76xt2a7zchC3xXTOIQx6braxpdo/slCdqXCLhRZm95muELsTAWOk4e2joXVx4 SxO6oyI1xuDKRfktWBT1tkl6bHwRGwalzn4mG5yMuBrZUixGa5OTFeCcq5NjFeDfaKl+ ko7N2jXOfEOvvsY0WkTr/AsOcUAgyHTpRZd9ft1/JoZWbQDcilwglcWFmT1ZGuJNhksf hA4JRt65FwtDnTgOuCtilRR7XgaqN/OEIi0eXZWmORUbovXD5wkbLqODp6UiupNq2f+w Ob1w== 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=yeLMVf2eHHsXh0O15q4pkBIw3KoK3wQ6PmZ1CrbEex8=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=pf4FmocXFOnxPjM3aYdAXX5yNwgxXtFoLSbrbi2J7wpJ6RC/Gqe6N5IW9DlDMG8VmN 9qpqimgOx6ZxMQ0ky5UYGkDAgp/CMsn9iHCXBWuXQOKhtT0t+S9wREtS2pk8KNhexjh6 mjgLeHpxLd2s+JWfmk4jozELTrAeRgV2XMYntoxS6xDc6h7XucMsdNla4hl3eUjUzuFV NqO7Juc9mHS17ay/oVqlrzE8xYcLWNPZZ3GXY04aSqRjbIgC8HotAfZYd3AHjFYtdT5a 8I9iD/nFQMHpGMv73NEU/8UCaeP4StTUnDWpngkCHrULOIpIckH5B7x/Kb+jCtJuIWV6 Zncw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JqUOyFxL; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bl19-20020a05620a1a9300b007817083c49asi15749609qkb.575.2024.01.03.09.37.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:37:02 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JqUOyFxL; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL59J-0005Sy-1q; Wed, 03 Jan 2024 12:35:25 -0500 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 1rL58g-0004FI-2p for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:48 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL586-0002aB-1d for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:42 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40d560818b8so79336595e9.1 for ; Wed, 03 Jan 2024 09:34:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303248; x=1704908048; 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=yeLMVf2eHHsXh0O15q4pkBIw3KoK3wQ6PmZ1CrbEex8=; b=JqUOyFxL7rDpc/7X3JA7lmsJHTScg8veFFmTK/Ziqllmq9qOVy6Ahw8yqSrmNMdriQ BkFBJwbcJtNZR5NRx3QhML6fdPY/kPSI1z7vNTP3Cod7mzC3OcJGF1FPN7ltMpjJ2gzv SLH7HKaDFIJA5Aj2+Z9KMmjNvUNbLOZV382tWYeXx86sy9O6fxuNoWTORjpfiwJvEZbj fSoOLY4rwMBpAO3z6kHollATZdOAmWosoqp0XWlHHs+EMtWKxUtmyGXLLj6PQYtUb3R2 AFByACCtqNm3GaqWvoLBUi8dIysHlKbsMCB1D9PLCrnPm9LDg45xi6ZaTKrEwk6Q0JfM dOJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303248; x=1704908048; 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=yeLMVf2eHHsXh0O15q4pkBIw3KoK3wQ6PmZ1CrbEex8=; b=J8pJkkO8i/uRNW6zykSxV8suTcgh9wG8z7zkLVI8kNhrJR0eSl78e2OikfPQ/h8IDI UEfq/C21X9UomAd8XyZA4cnF+XQU+5hpcZK8GrDFKaVh8k4+WXyPEgHnfIQpcdYHuKPM l/hCYn0TN79e4ofbjqipIIGdzSxaL33oLns0eklr2XrrE7PY1n898+47VNJy9PoO2RtP +AloDc0oO6xtTl3qCDs8xiGoeYb13B4ZD4ltJBOBM9wVG2qWueG8udGrBYWjbwSDUkm3 EJ94rZv6VUTa8LqxpO8R6wPT3TbOJTlzZbkeR7EqT0P7+vjFmAmIbP81m2KqR81gh2y2 uLxg== X-Gm-Message-State: AOJu0YzENHa+X9clH6xFYLhUYuxERgUx0ep3hRj3UFVfg7yMyEqG0IEn x30RjYqI4TTX/qwnUGhBnVKV72JsBjRsjw== X-Received: by 2002:a05:600c:ac6:b0:40c:2c6d:a810 with SMTP id c6-20020a05600c0ac600b0040c2c6da810mr10276642wmr.32.1704303248659; Wed, 03 Jan 2024 09:34:08 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id k39-20020a05600c1ca700b0040d8af75e19sm2948860wms.24.2024.01.03.09.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:34:03 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 06C1B5F9D2; Wed, 3 Jan 2024 17:33:53 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 36/43] plugins: Use different helpers when reading registers Date: Wed, 3 Jan 2024 17:33:42 +0000 Message-Id: <20240103173349.398526-37-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.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=unavailable 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: Akihiko Odaki This avoids optimizations incompatible when reading registers. Signed-off-by: Akihiko Odaki Message-Id: <20231213-gdb-v17-12-777047380591@daynix.com> Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- accel/tcg/plugin-helpers.h | 3 ++- include/qemu/plugin.h | 1 + accel/tcg/plugin-gen.c | 43 ++++++++++++++++++++++++++++++++++---- plugins/api.c | 12 +++++++++-- 4 files changed, 52 insertions(+), 7 deletions(-) diff --git a/accel/tcg/plugin-helpers.h b/accel/tcg/plugin-helpers.h index 8e685e06545..11796436f35 100644 --- a/accel/tcg/plugin-helpers.h +++ b/accel/tcg/plugin-helpers.h @@ -1,4 +1,5 @@ #ifdef CONFIG_PLUGIN -DEF_HELPER_FLAGS_2(plugin_vcpu_udata_cb, TCG_CALL_NO_RWG | TCG_CALL_PLUGIN, void, i32, ptr) +DEF_HELPER_FLAGS_2(plugin_vcpu_udata_cb_no_wg, TCG_CALL_NO_WG | TCG_CALL_PLUGIN, void, i32, ptr) +DEF_HELPER_FLAGS_2(plugin_vcpu_udata_cb_no_rwg, TCG_CALL_NO_RWG | TCG_CALL_PLUGIN, void, i32, ptr) DEF_HELPER_FLAGS_4(plugin_vcpu_mem_cb, TCG_CALL_NO_RWG | TCG_CALL_PLUGIN, void, i32, i32, i64, ptr) #endif diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index 7fdc3a4849f..b0c5ac68293 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -73,6 +73,7 @@ enum plugin_dyn_cb_type { enum plugin_dyn_cb_subtype { PLUGIN_CB_REGULAR, + PLUGIN_CB_REGULAR_R, PLUGIN_CB_INLINE, PLUGIN_N_CB_SUBTYPES, }; diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 78b331b2510..b37ce7683e6 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -79,6 +79,7 @@ enum plugin_gen_from { enum plugin_gen_cb { PLUGIN_GEN_CB_UDATA, + PLUGIN_GEN_CB_UDATA_R, PLUGIN_GEN_CB_INLINE, PLUGIN_GEN_CB_MEM, PLUGIN_GEN_ENABLE_MEM_HELPER, @@ -90,7 +91,10 @@ enum plugin_gen_cb { * These helpers are stubs that get dynamically switched out for calls * direct to the plugin if they are subscribed to. */ -void HELPER(plugin_vcpu_udata_cb)(uint32_t cpu_index, void *udata) +void HELPER(plugin_vcpu_udata_cb_no_wg)(uint32_t cpu_index, void *udata) +{ } + +void HELPER(plugin_vcpu_udata_cb_no_rwg)(uint32_t cpu_index, void *udata) { } void HELPER(plugin_vcpu_mem_cb)(unsigned int vcpu_index, @@ -98,7 +102,7 @@ void HELPER(plugin_vcpu_mem_cb)(unsigned int vcpu_index, void *userdata) { } -static void gen_empty_udata_cb(void) +static void gen_empty_udata_cb(void (*gen_helper)(TCGv_i32, TCGv_ptr)) { TCGv_i32 cpu_index = tcg_temp_ebb_new_i32(); TCGv_ptr udata = tcg_temp_ebb_new_ptr(); @@ -106,12 +110,22 @@ static void gen_empty_udata_cb(void) tcg_gen_movi_ptr(udata, 0); tcg_gen_ld_i32(cpu_index, tcg_env, -offsetof(ArchCPU, env) + offsetof(CPUState, cpu_index)); - gen_helper_plugin_vcpu_udata_cb(cpu_index, udata); + gen_helper(cpu_index, udata); tcg_temp_free_ptr(udata); tcg_temp_free_i32(cpu_index); } +static void gen_empty_udata_cb_no_wg(void) +{ + gen_empty_udata_cb(gen_helper_plugin_vcpu_udata_cb_no_wg); +} + +static void gen_empty_udata_cb_no_rwg(void) +{ + gen_empty_udata_cb(gen_helper_plugin_vcpu_udata_cb_no_rwg); +} + /* * For now we only support addi_i64. * When we support more ops, we can generate one empty inline cb for each. @@ -192,7 +206,8 @@ static void plugin_gen_empty_callback(enum plugin_gen_from from) gen_empty_mem_helper); /* fall through */ case PLUGIN_GEN_FROM_TB: - gen_wrapped(from, PLUGIN_GEN_CB_UDATA, gen_empty_udata_cb); + gen_wrapped(from, PLUGIN_GEN_CB_UDATA, gen_empty_udata_cb_no_rwg); + gen_wrapped(from, PLUGIN_GEN_CB_UDATA_R, gen_empty_udata_cb_no_wg); gen_wrapped(from, PLUGIN_GEN_CB_INLINE, gen_empty_inline_cb); break; default: @@ -588,6 +603,12 @@ static void plugin_gen_tb_udata(const struct qemu_plugin_tb *ptb, inject_udata_cb(ptb->cbs[PLUGIN_CB_REGULAR], begin_op); } +static void plugin_gen_tb_udata_r(const struct qemu_plugin_tb *ptb, + TCGOp *begin_op) +{ + inject_udata_cb(ptb->cbs[PLUGIN_CB_REGULAR_R], begin_op); +} + static void plugin_gen_tb_inline(const struct qemu_plugin_tb *ptb, TCGOp *begin_op) { @@ -602,6 +623,14 @@ static void plugin_gen_insn_udata(const struct qemu_plugin_tb *ptb, inject_udata_cb(insn->cbs[PLUGIN_CB_INSN][PLUGIN_CB_REGULAR], begin_op); } +static void plugin_gen_insn_udata_r(const struct qemu_plugin_tb *ptb, + TCGOp *begin_op, int insn_idx) +{ + struct qemu_plugin_insn *insn = g_ptr_array_index(ptb->insns, insn_idx); + + inject_udata_cb(insn->cbs[PLUGIN_CB_INSN][PLUGIN_CB_REGULAR_R], begin_op); +} + static void plugin_gen_insn_inline(const struct qemu_plugin_tb *ptb, TCGOp *begin_op, int insn_idx) { @@ -721,6 +750,9 @@ static void plugin_gen_inject(struct qemu_plugin_tb *plugin_tb) case PLUGIN_GEN_CB_UDATA: plugin_gen_tb_udata(plugin_tb, op); break; + case PLUGIN_GEN_CB_UDATA_R: + plugin_gen_tb_udata_r(plugin_tb, op); + break; case PLUGIN_GEN_CB_INLINE: plugin_gen_tb_inline(plugin_tb, op); break; @@ -737,6 +769,9 @@ static void plugin_gen_inject(struct qemu_plugin_tb *plugin_tb) case PLUGIN_GEN_CB_UDATA: plugin_gen_insn_udata(plugin_tb, op, insn_idx); break; + case PLUGIN_GEN_CB_UDATA_R: + plugin_gen_insn_udata_r(plugin_tb, op, insn_idx); + break; case PLUGIN_GEN_CB_INLINE: plugin_gen_insn_inline(plugin_tb, op, insn_idx); break; diff --git a/plugins/api.c b/plugins/api.c index 5521b0ad36c..ac39cdea0b3 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -89,7 +89,11 @@ void qemu_plugin_register_vcpu_tb_exec_cb(struct qemu_plugin_tb *tb, void *udata) { if (!tb->mem_only) { - plugin_register_dyn_cb__udata(&tb->cbs[PLUGIN_CB_REGULAR], + int index = flags == QEMU_PLUGIN_CB_R_REGS || + flags == QEMU_PLUGIN_CB_RW_REGS ? + PLUGIN_CB_REGULAR_R : PLUGIN_CB_REGULAR; + + plugin_register_dyn_cb__udata(&tb->cbs[index], cb, flags, udata); } } @@ -109,7 +113,11 @@ void qemu_plugin_register_vcpu_insn_exec_cb(struct qemu_plugin_insn *insn, void *udata) { if (!insn->mem_only) { - plugin_register_dyn_cb__udata(&insn->cbs[PLUGIN_CB_INSN][PLUGIN_CB_REGULAR], + int index = flags == QEMU_PLUGIN_CB_R_REGS || + flags == QEMU_PLUGIN_CB_RW_REGS ? + PLUGIN_CB_REGULAR_R : PLUGIN_CB_REGULAR; + + plugin_register_dyn_cb__udata(&insn->cbs[PLUGIN_CB_INSN][index], cb, flags, udata); } } From patchwork Wed Jan 3 17:33:43 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: 759648 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6615470wrw; Wed, 3 Jan 2024 09:49:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDYbpDGmaWOANFHd1DQX2DeVDSAyI0NFeco2T9SkvzySQXB2qKK6tecC3+YfAx/HrZBPIK X-Received: by 2002:a25:688d:0:b0:dbd:4883:44ce with SMTP id d135-20020a25688d000000b00dbd488344cemr10891111ybc.32.1704304146741; Wed, 03 Jan 2024 09:49:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704304146; cv=none; d=google.com; s=arc-20160816; b=yJjvGMnSDE7Ufm6JrVElaJoRkcBa/qfU5+H3YAGsude89lFgYxDZw97upfTJqxbwlB qbN99WhMptk/2usK3d5rHbSioWq3J+XRz/X97c0xBXgy0R3yQxtMe8FQ+uDa8+/k/AQy Ag3p2nFNvuHJsMQGFOn0rSR8kIWIWFvDsoY8fmQJityoY2zV8Nvbr/4LN0sirxkIl1w5 /zUXhC/7BLq5XKPwhtJp09LX9DS8r7QNBGApP5iqo5QOqReHafLolnlATTNq2XB9bHvK ziHV7z39400Te6cwxOF9w5HQmf8phSumLZJdteThFauGg5PG7/cZz6Euw1laUbdI07Hp AAlQ== 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=s7b3xpykHeaHl4suIRJtcydNJ+7RVLNIDOZxUbbJygc=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=WaPac2XBqSQyB44yr8q+GLIpvgEJEr+AJyfbyHYVp1iXsDbIaQ5ctqhCt6tuJ++gzC bZ3ojabSK8zeqlpRsH7jnr+dcyky5nqxkEd1u1e7/jkpKc/pbq0krmmSxMirkWyVvOti M65kHtnQG4ve2E1e/MmGpGCgXu29VIRsYjZYm4Uc5smOnwjBcVE/7VXbEH0b6wRkEguJ n6sNUZ1t5up9IcdD0/46ZCiu25wxPqdCEvJ3Kr12RHOx7kqH6ptwY6XKyql5/YKBqlBK rUkS6XlrHOkJw9hvNEvNJvhmAKc0mxw2V95rv7nYQmCdbFMSOOBhoiVo0ldYciOrMnKB PwZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YzclKS91; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n19-20020a05622a11d300b004281a12a0d8si8242257qtk.280.2024.01.03.09.49.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:49:06 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YzclKS91; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5DP-0007fH-IQ; Wed, 03 Jan 2024 12:39:39 -0500 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 1rL5DB-0006Ys-Re for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:26 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5Cx-0000fe-RY for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:24 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3367632ce7bso9142545f8f.2 for ; Wed, 03 Jan 2024 09:39:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303550; x=1704908350; 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=s7b3xpykHeaHl4suIRJtcydNJ+7RVLNIDOZxUbbJygc=; b=YzclKS91ROCiEUliPREbJ5vhRAlB73+Wjwf5IUCj09NEb4igPTjVwdzZtGqYJyNB0j pKngCV8XMGc+JaptJLXYKK5bfZ9EcjbIiza2IvHSZILsb9t8PUjGDnYYGfoWDntAQwy8 leW35p4ZsWi+18Ui7IF7BaxMSF18azdmtbT2FhYyjGNLTq9dXRBwKxH8eRrYWuREFdgt iTfKDQ6sxNCEIfvqPLaxXZztRpUBafpsmJXIhi3PjaqApHPscXEvhGfNOEcmTVWYvwCN 5WY2qMZX+NwIxFpC3l43/WT+S0zQUES/hc/kteddsPrrrTkVdG80dZrg6wlnf692WfyC 1Qcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303550; x=1704908350; 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=s7b3xpykHeaHl4suIRJtcydNJ+7RVLNIDOZxUbbJygc=; b=IlIuhKZIX0ye5aLntQtt65MzicjHda5E9oaWShT3KijD0q4d5w6+TH5uJECagl7Y4h TLE10MYk7lr9SGHA+ym8ZTxqQ7SHBHJ/V/c6LIzH5nSAx5AOIa1nUG3PtF7r60nreKBC Ya1Td+XUQignLXKu/Brfgw9PyHD7W8oZB68091gxhQKj8l2xgbn4+PXOfcEWMRgr2+HD nF+vZrHusnkApKux8P3sjAoshm7ygMtp+4dsQfOh5hWzUDvR0qxMe55k08nz6d8hsXTN Nm2st89xwjZjlfsD0MupAHd4ByKzKeabunjEHedvV+CyTKmjX/TAZgIVRv5HaHtkiEn9 PNyw== X-Gm-Message-State: AOJu0YzAXqCIhyutvJspSbCRMQnMQ3tI/HBERnXWUSKYheNhferxG0p7 VZ90Kvh7jTvDAINMrhd8ye8lH4YxAUpO8Q== X-Received: by 2002:a05:6000:1845:b0:337:39ee:2b85 with SMTP id c5-20020a056000184500b0033739ee2b85mr3828333wri.104.1704303550198; Wed, 03 Jan 2024 09:39:10 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id j18-20020a5d5652000000b00336ca349bdesm21896679wrw.47.2024.01.03.09.39.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:39:08 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 1FA005F9D3; Wed, 3 Jan 2024 17:33:53 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 37/43] gdbstub: expose api to find registers Date: Wed, 3 Jan 2024 17:33:43 +0000 Message-Id: <20240103173349.398526-38-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.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=unavailable 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 Expose an internal API to QEMU to return all the registers for a vCPU. The list containing the details required to called gdb_read_register(). Based-on: <20231025093128.33116-15-akihiko.odaki@daynix.com> Cc: Akihiko Odaki Signed-off-by: Alex Bennée --- v2 - just make gdb_get_register_list return everything for a vCPU vAJB: This principle difference is the find registers is a single call which can return a) multiple registers and b) is agnostic to the gdb feature. This is because I haven't so far found any duplicate registers in the system so I thing the regname by itself should be enough. However I do expose the gdb feature name in case the caller wants to do some additional filtering. --- include/exec/gdbstub.h | 47 +++++++++++++++++++++++++++++++++++ gdbstub/gdbstub.c | 56 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 102 insertions(+), 1 deletion(-) diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index da9ddfe54c5..7bddea8259e 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -111,6 +111,53 @@ void gdb_feature_builder_end(const GDBFeatureBuilder *builder); */ const GDBFeature *gdb_find_static_feature(const char *xmlname); +/** + * gdb_find_feature() - Find a feature associated with a CPU. + * @cpu: The CPU associated with the feature. + * @name: The feature's name. + * + * Return: The feature's number. + */ +int gdb_find_feature(CPUState *cpu, const char *name); + +/** + * gdb_find_feature_register() - Find a register associated with a CPU. + * @cpu: The CPU associated with the register. + * @feature: The feature's number returned by gdb_find_feature(). + * @name: The register's name. + * + * Return: The register's number. + */ +int gdb_find_feature_register(CPUState *cpu, int feature, const char *name); + +/** + * gdb_read_register() - Read a register associated with a CPU. + * @cpu: The CPU associated with the register. + * @buf: The buffer that the read register will be appended to. + * @reg: The register's number returned by gdb_find_feature_register(). + * + * Return: The number of read bytes. + */ +int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); + +/** + * typedef GDBRegDesc - a register description from gdbstub + */ +typedef struct { + int gdb_reg; + const char *name; + const char *feature_name; +} GDBRegDesc; + +/** + * gdb_get_register_list() - Return list of all registers for CPU + * @cpu: The CPU being searched + * + * Returns a GArray of GDBRegDesc, caller frees array but not the + * const strings. + */ +GArray *gdb_get_register_list(CPUState *cpu); + void gdb_set_stop_cpu(CPUState *cpu); /* in gdbstub-xml.c, generated by scripts/feature_to_c.py */ diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 420ab2a3766..b0230138246 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -490,7 +490,61 @@ const GDBFeature *gdb_find_static_feature(const char *xmlname) g_assert_not_reached(); } -static int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) +int gdb_find_feature(CPUState *cpu, const char *name) +{ + GDBRegisterState *r; + + for (guint i = 0; i < cpu->gdb_regs->len; i++) { + r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); + if (!strcmp(name, r->feature->name)) { + return i; + } + } + + return -1; +} + +int gdb_find_feature_register(CPUState *cpu, int feature, const char *name) +{ + GDBRegisterState *r; + + r = &g_array_index(cpu->gdb_regs, GDBRegisterState, feature); + + for (int i = 0; i < r->feature->num_regs; i++) { + if (r->feature->regs[i] && !strcmp(name, r->feature->regs[i])) { + return r->base_reg + i; + } + } + + return -1; +} + +GArray *gdb_get_register_list(CPUState *cpu) +{ + GArray *results = g_array_new(true, true, sizeof(GDBRegDesc)); + + /* registers are only available once the CPU is initialised */ + if (!cpu->gdb_regs) { + return results; + } + + for (int f = 0; f < cpu->gdb_regs->len; f++) { + GDBRegisterState *r = &g_array_index(cpu->gdb_regs, GDBRegisterState, f); + for (int i = 0; i < r->feature->num_regs; i++) { + const char *name = r->feature->regs[i]; + GDBRegDesc desc = { + r->base_reg + i, + name, + r->feature->name + }; + g_array_append_val(results, desc); + } + } + + return results; +} + +int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) { CPUClass *cc = CPU_GET_CLASS(cpu); GDBRegisterState *r; From patchwork Wed Jan 3 17:33:44 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: 759640 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6612926wrw; Wed, 3 Jan 2024 09:42:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCtQkYsXnBHApVlfc8KFLQ4VNo9v2OGdi+oNXmrNqYuj0UywvzqNgx4fgcpXwvxNCzalDt X-Received: by 2002:a05:6808:1303:b0:3b8:b063:6665 with SMTP id y3-20020a056808130300b003b8b0636665mr16583067oiv.92.1704303720056; Wed, 03 Jan 2024 09:42:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303720; cv=none; d=google.com; s=arc-20160816; b=CiQ6HZ78c0P0WPAYg0L2nYc39lKtMH8LcZl3EojgRRjY74dbMunxXivavOwllZHThK eEJfaJSYMENZAnCQN8Enc63VAj87/iD4g7+sHtEO1NdC8wHga+NSq9xzfTSSEskuaL2I nTNTFdvC1HnKxHyAh8Cg132Oj+tGCkq4OH/I/XLntHVYOUNoqAp48zrEapdT8voRwBpw 1i/plf4LTMCcsWeG4t/W7JJvyT1mD1DnvZZWF/YXTN2RwwBXgencdy8H95eP9fp0375x p/HibfmIPBzN6OZvTT1o7c2n0z6c2JzwupfLkgpY3TsIJqIp0r8Gvh4nniu0Lokiu8bD 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=lT3w4azBfzDEu1VsOKbVUIApuL3l4Y+VxFlcwm2LC0s=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=tAp1r5APqqAii1YO2cayDjKay4payK6HbuUE5VYY4WvAWJVrjjYIg3cmIwQmzEr/GH pqaZtPIR9Knhd2cHjZZKu2CvyQ5Nmem09IxqN7IlsqCnQBxpdoFZw71K/5355MfEXtZ8 tm2rp4g7Tv+W+9hSGr2n1qNtGksvrLRN53zr3V7aLDA+yLwZC9kq2dOwf/Bmz2HlDbE1 o/ov7SIUfPiDs8ezr99ZamlfMutuecvKY538EwlbUC+s4S0UmZ/09MBsOdpyhZ4rgLxj UUevdlFap8n1zgLSxZyKLC/KfvXTcvYajE0z5U7lBm1GZF1mbNdwAi34g0OL3wFbFi7f y6QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ntRvzuBR; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s15-20020a0c8d4f000000b0067f4a6eca31si5498352qvb.65.2024.01.03.09.41.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:42:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ntRvzuBR; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5DT-0007pV-Tx; Wed, 03 Jan 2024 12:39:43 -0500 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 1rL5DR-0007jz-Tw for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:41 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5D2-0000m3-Bu for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:41 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40d5a41143fso67909825e9.3 for ; Wed, 03 Jan 2024 09:39:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303555; x=1704908355; 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=lT3w4azBfzDEu1VsOKbVUIApuL3l4Y+VxFlcwm2LC0s=; b=ntRvzuBRHm1nrfodMmCL7pUimLgHdVGjo2iqqFzMXfbYOeiovf40ZJtZnxMmctCW0C WO39VHwsI9F1J+YfsfqNYfVRzq6cvTUqvxr4FtjkYu6VjJknkx3HO+y/XLJM94Q5i64W cx3mzkpMCAFEg4dUexvSzTBE9Gfa91w+KggK9QuiT+JseC5Q4SLcsrtz0YruTU9qDFi5 Lir5V3NHXxg8AqcynapZZnJ7gjcbBOWWUPA6E/1nOx7c+4ZBv4hj9hD58n3eYHazMYXh hcN/Q3q9ELJJhdB21/ghuoOBTgvIFVUEndpV2ABU5SC7rNFO9JLWVPbdmoRip1TLdW0s DSOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303555; x=1704908355; 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=lT3w4azBfzDEu1VsOKbVUIApuL3l4Y+VxFlcwm2LC0s=; b=Wi/cl6Yh1qjqCgnvhlb8WWKt83nHyCYBcoSzBu5FOSeBt7hd2qE1dLXrmW8kLzO59e kbhwfVgPAOh4vFRf+t9ArQq5S/bKuUSD6TIntC5jRZOYkoQ/ac22mYEMkPYOHdiSbN/M kOUJ986AxXdOvqprT2XeZHE4OYNkXw3/L4k6+MajuGhHSpqwHAIKeCArskYdeoc1pY3b ed/7c4ivCEADEBMA2l7CHe7sT7A72/nHr+pmBfYs/1/P+Z34oZ7djHwd1O+o26C9YJXB FP7JSJIwv7/7FuG9aAO+zlvctOSuOd3YFG9MdpnwI8IPaHt21Y3Ub00o30blp29mCgqK fsNw== X-Gm-Message-State: AOJu0YyJH2q5xW9qv4gZ3N5j7zBNTg+TbJTbRzil4BhYL7I1toDkp6HV nKsB8PW591FiEW7qqw9rvbcTM1WnGNNpoA== X-Received: by 2002:a05:600c:4e03:b0:40d:91a2:7133 with SMTP id b3-20020a05600c4e0300b0040d91a27133mr514787wmq.100.1704303554843; Wed, 03 Jan 2024 09:39:14 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id df2-20020a5d5b82000000b00336be33649csm23840746wrb.9.2024.01.03.09.39.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:39:13 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 3ABB35F92F; Wed, 3 Jan 2024 17:33:53 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 38/43] plugins: add an API to read registers Date: Wed, 3 Jan 2024 17:33:44 +0000 Message-Id: <20240103173349.398526-39-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.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 We can only request a list of registers once the vCPU has been initialised so the user needs to use either call the get function on vCPU initialisation or during the translation phase. We don't expose the reg number to the plugin instead hiding it behind an opaque handle. This allows for a bit of future proofing should the internals need to be changed while also being hashed against the CPUClass so we can handle different register sets per-vCPU in hetrogenous situations. Having an internal state within the plugins also allows us to expand the interface in future (for example providing callbacks on register change if the translator can track changes). Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1706 Cc: Akihiko Odaki Based-on: <20231025093128.33116-18-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- v3 - also g_intern_string the register name - make get_registers documentation a bit less verbose v2 - use new get whole list api, and expose upwards vAJB: The main difference to Akikio's version is hiding the gdb register detail from the plugin for the reasons described above. --- include/qemu/qemu-plugin.h | 51 +++++++++++++++++- plugins/api.c | 102 +++++++++++++++++++++++++++++++++++ plugins/qemu-plugins.symbols | 2 + 3 files changed, 153 insertions(+), 2 deletions(-) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 4daab6efd29..95380895f81 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -11,6 +11,7 @@ #ifndef QEMU_QEMU_PLUGIN_H #define QEMU_QEMU_PLUGIN_H +#include #include #include #include @@ -227,8 +228,8 @@ struct qemu_plugin_insn; * @QEMU_PLUGIN_CB_R_REGS: callback reads the CPU's regs * @QEMU_PLUGIN_CB_RW_REGS: callback reads and writes the CPU's regs * - * Note: currently unused, plugins cannot read or change system - * register state. + * Note: currently QEMU_PLUGIN_CB_RW_REGS is unused, plugins cannot change + * system register state. */ enum qemu_plugin_cb_flags { QEMU_PLUGIN_CB_NO_REGS, @@ -708,4 +709,50 @@ uint64_t qemu_plugin_end_code(void); QEMU_PLUGIN_API uint64_t qemu_plugin_entry_code(void); +/** struct qemu_plugin_register - Opaque handle for register access */ +struct qemu_plugin_register; + +/** + * typedef qemu_plugin_reg_descriptor - register descriptions + * + * @handle: opaque handle for retrieving value with qemu_plugin_read_register + * @name: register name + * @feature: optional feature descriptor, can be NULL + */ +typedef struct { + struct qemu_plugin_register *handle; + const char *name; + const char *feature; +} qemu_plugin_reg_descriptor; + +/** + * qemu_plugin_get_registers() - return register list for vCPU + * @vcpu_index: vcpu to query + * + * Returns a GArray of qemu_plugin_reg_descriptor or NULL. Caller + * frees the array (but not the const strings). + * + * Should be used from a qemu_plugin_register_vcpu_init_cb() callback + * after the vCPU is initialised. + */ +GArray * qemu_plugin_get_registers(unsigned int vcpu_index); + +/** + * qemu_plugin_read_register() - read register + * + * @vcpu: vcpu index + * @handle: a @qemu_plugin_reg_handle handle + * @buf: A GByteArray for the data owned by the plugin + * + * This function is only available in a context that register read access is + * explicitly requested. + * + * Returns the size of the read register. The content of @buf is in target byte + * order. On failure returns -1 + */ +int qemu_plugin_read_register(unsigned int vcpu, + struct qemu_plugin_register *handle, + GByteArray *buf); + + #endif /* QEMU_QEMU_PLUGIN_H */ diff --git a/plugins/api.c b/plugins/api.c index ac39cdea0b3..f8905325c43 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -8,6 +8,7 @@ * * qemu_plugin_tb * qemu_plugin_insn + * qemu_plugin_register * * Which can then be passed back into the API to do additional things. * As such all the public functions in here are exported in @@ -35,10 +36,12 @@ */ #include "qemu/osdep.h" +#include "qemu/main-loop.h" #include "qemu/plugin.h" #include "qemu/log.h" #include "tcg/tcg.h" #include "exec/exec-all.h" +#include "exec/gdbstub.h" #include "exec/ram_addr.h" #include "disas/disas.h" #include "plugin.h" @@ -435,3 +438,102 @@ uint64_t qemu_plugin_entry_code(void) #endif return entry; } + +/* + * Register handles + * + * The plugin infrastructure keeps hold of these internal data + * structures which are presented to plugins as opaque handles. They + * are global to the system and therefor additions to the hash table + * must be protected by the @reg_handle_lock. + * + * In order to future proof for up-coming heterogeneous work we want + * different entries for each CPU type while sharing them in the + * common case of multiple cores of the same type. + */ + +static QemuMutex reg_handle_lock; + +struct qemu_plugin_register { + const char *name; + int gdb_reg_num; +}; + +static GHashTable *reg_handles; /* hash table of PluginReg */ + +/* Generate a stable key - would xxhash be overkill? */ +static gpointer cpu_plus_reg_to_key(CPUState *cs, int gdb_regnum) +{ + uintptr_t key = (uintptr_t) cs->cc; + key ^= gdb_regnum; + return GUINT_TO_POINTER(key); +} + +/* + * Create register handles. + * + * We need to create a handle for each register so the plugin + * infrastructure can call gdbstub to read a register. We also + * construct a result array with those handles and some ancillary data + * the plugin might find useful. + */ + +static GArray * create_register_handles(CPUState *cs, GArray *gdbstub_regs) { + GArray *find_data = g_array_new(true, true, sizeof(qemu_plugin_reg_descriptor)); + + WITH_QEMU_LOCK_GUARD(®_handle_lock) { + + if (!reg_handles) { + reg_handles = g_hash_table_new(g_direct_hash, g_direct_equal); + } + + for (int i=0; i < gdbstub_regs->len; i++) { + GDBRegDesc *grd = &g_array_index(gdbstub_regs, GDBRegDesc, i); + gpointer key = cpu_plus_reg_to_key(cs, grd->gdb_reg); + struct qemu_plugin_register *val = g_hash_table_lookup(reg_handles, key); + + /* Doesn't exist, create one */ + if (!val) { + val = g_new0(struct qemu_plugin_register, 1); + val->gdb_reg_num = grd->gdb_reg; + val->name = g_intern_string(grd->name); + + g_hash_table_insert(reg_handles, key, val); + } + + /* Create a record for the plugin */ + qemu_plugin_reg_descriptor desc = { + .handle = val, + .name = val->name, + .feature = g_intern_string(grd->feature_name) + }; + g_array_append_val(find_data, desc); + } + } + + return find_data; +} + +GArray * qemu_plugin_get_registers(unsigned int vcpu) +{ + CPUState *cs = qemu_get_cpu(vcpu); + if (cs) { + g_autoptr(GArray) regs = gdb_get_register_list(cs); + return regs->len ? create_register_handles(cs, regs) : NULL; + } else { + return NULL; + } +} + +int qemu_plugin_read_register(unsigned int vcpu, struct qemu_plugin_register *reg, GByteArray *buf) +{ + CPUState *cs = qemu_get_cpu(vcpu); + /* assert with debugging on? */ + return gdb_read_register(cs, buf, reg->gdb_reg_num); +} + +static void __attribute__((__constructor__)) qemu_api_init(void) +{ + qemu_mutex_init(®_handle_lock); + +} diff --git a/plugins/qemu-plugins.symbols b/plugins/qemu-plugins.symbols index 71f6c90549d..6963585c1ea 100644 --- a/plugins/qemu-plugins.symbols +++ b/plugins/qemu-plugins.symbols @@ -3,6 +3,7 @@ qemu_plugin_end_code; qemu_plugin_entry_code; qemu_plugin_get_hwaddr; + qemu_plugin_get_registers; qemu_plugin_hwaddr_device_name; qemu_plugin_hwaddr_is_io; qemu_plugin_hwaddr_phys_addr; @@ -20,6 +21,7 @@ qemu_plugin_n_vcpus; qemu_plugin_outs; qemu_plugin_path_to_binary; + qemu_plugin_read_register; qemu_plugin_register_atexit_cb; qemu_plugin_register_flush_cb; qemu_plugin_register_vcpu_exit_cb; From patchwork Wed Jan 3 17:33:45 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: 759646 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6615023wrw; Wed, 3 Jan 2024 09:47:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMhoICaqmWjiFhil8b9jd4UBwRRI/yiV5CFnIwkx1v7h7CWuFx3aAIG35WGd1SuFNS2a+F X-Received: by 2002:a05:622a:409:b0:428:31a1:e35b with SMTP id n9-20020a05622a040900b0042831a1e35bmr1941409qtx.60.1704304075761; Wed, 03 Jan 2024 09:47:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704304075; cv=none; d=google.com; s=arc-20160816; b=sxQE3eVjMmtbN7eAsaW6nno1K77Q8LdZbQsYZJSrzJydOX6Xy54GO5+fDlWz22nSzD QVF18HeRbnirR52qgkGe+RJXyPdGb+3gpsxZmu3NLcJL0iz/VyihfDxLr11ipGwQWcPU TW41dhx2DGGA9+k/V901vAyfUReNcAAnwwoWc3+yoJJ61zk02NpaFb+9xymIdjdSNLxg pCdYw9Prbz0V1cPlBSW3b5CVmB80O0vVFfzWd3kohmzEIp2cJlB7mTqRCs4cVwrOlDSi vqwUHhhYcmTuPwo0i4C5XnWF4lthfh5wH5opT737iSVA1RhwAj97zqInQYKHCzY8Lo6f BePA== 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=TjgnYFLBOv5uB2tWkg/kIZdJs8xT0wOiNJtUez299cQ=; fh=5s6F1VpUg/LkqHSyTlr7gneXArwgJkl0qAfGr3eFpAs=; b=ZaUVsomtrCgV61AjhvuFmHCJqdynU6m5A0tBSdYNHvutybp28W4BKlW3uh24XiaUq+ W2NfGRA39zUOFKLjWvSC+As39Da9SLr2AlIROs0Vf58+hS2Yt2kIX4zQXUYZzs4wt06a o6PO7gq7v+MqnPh4u4p2R/MHjzUetZuBHk7yfEjSDWhOzmv/18bCEpBCGR18bsOEmYk9 2gFXocCUbVCNhUDdubvVnavVxr4OPoqY8OIBKfCc+NTc9M4aP7plOrlvPMhMhRDzgQvk b0+wnXqnml0uq5FVUdiTMPkmfNVLCxrxfxL6f5BZgmIwvVHr9qrDgWuJxYWgrqYy5gQ3 Me5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W1qQNInE; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v18-20020a05622a145200b004280c8f25c6si10867878qtx.772.2024.01.03.09.47.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:47:55 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W1qQNInE; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5DN-0007Z2-I7; Wed, 03 Jan 2024 12:39:37 -0500 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 1rL5D5-0006FT-4O for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:20 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5Cw-0000dg-AY for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:18 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40d6b4e2945so55524895e9.0 for ; Wed, 03 Jan 2024 09:39:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303548; x=1704908348; 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=TjgnYFLBOv5uB2tWkg/kIZdJs8xT0wOiNJtUez299cQ=; b=W1qQNInEuA+Z2I8CU38mZRcMQ9lAXxekImthC6KfNg6T9pmsUqW591gAacpTuJc8dr /zs+EvWQy0Qu3cquBHgyFbpdgHcXe1G5YAFjPJgHPSCS5fLkPAei/+OBXo3UItHtG28l /gTFjebnnuO1J4+14JXiJDOaPgWVU7EOi7xjluJvN5GoETSNoGKh8q1jYn5oeoOXAZtw GabI1dRvoFzrQZEdWryPajahZNb6MnQyeTq7r2MyoOfu/65QRNgil9O7INVzDcBONGX4 tIfkr+roUYtCBB0L7lZ/DVd4knWGI2ScoP/bcolVteT+nTLDOiBREUwbPk7cTXjCha6l PHog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303548; x=1704908348; 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=TjgnYFLBOv5uB2tWkg/kIZdJs8xT0wOiNJtUez299cQ=; b=wTOmbAm3sPNDrdwkn7fI6GomJ7/+IL8FwSI9Cnu7wFLcZnUzYvX2DgM7L21sMk1u1r IRAOPEVMsO06DnlNjcKHrlqpNblN9lhHKHhwUvM7X7TxwZnNs7HUgdsfllV9sG4nDIwB F4VyN8Oz4cT/teSm4pxCuF9q5lJ9INJaPPNPRu6Q3khTaEyUlm/uvyxkVBYNHCKia3XV fgYTdk2405HFvcR2Doi43Pxanibyp16w2S9qhH5TF/igPB+MEZxwiIOmUPpHaqq31o63 cLudpZtL/aLOXhe6nufVu5JJx34+wFIOcsnX6VH3kivfQDCuZWYvbZGaYNVn9/539WQz 9HoA== X-Gm-Message-State: AOJu0YxWT2udRknkZbEA+UAMYEvA0OqV2DCopj9tcKoSM6Yk4MQXV/BR fhh17c9Y1WIljYp38ttdgmbDkb6OprWnyQ== X-Received: by 2002:a7b:cb92:0:b0:40d:38cd:ad5c with SMTP id m18-20020a7bcb92000000b0040d38cdad5cmr6656970wmi.263.1704303548411; Wed, 03 Jan 2024 09:39:08 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id i15-20020a05600c354f00b0040d604dea3bsm2972869wmq.4.2024.01.03.09.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:39:05 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 542725F9D4; Wed, 3 Jan 2024 17:33:53 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis Subject: [PATCH v2 39/43] contrib/plugins: fix imatch Date: Wed, 3 Jan 2024 17:33:45 +0000 Message-Id: <20240103173349.398526-40-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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=unavailable 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 We can't directly save the ephemeral imatch from argv as that memory will get recycled. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- contrib/plugins/execlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c index 82dc2f584e2..f262e5555eb 100644 --- a/contrib/plugins/execlog.c +++ b/contrib/plugins/execlog.c @@ -199,7 +199,7 @@ static void parse_insn_match(char *match) if (!imatches) { imatches = g_ptr_array_new(); } - g_ptr_array_add(imatches, match); + g_ptr_array_add(imatches, g_strdup(match)); } static void parse_vaddr_match(char *match) From patchwork Wed Jan 3 17:33:46 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: 759641 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6612960wrw; Wed, 3 Jan 2024 09:42:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGFn3De5MtAv6I7P0R5nHLQuFDndo3rJynFB5gw7XacSVRsHDTZMFftbGj7RRAOANj46Y6p X-Received: by 2002:a05:620a:2456:b0:781:c13c:9ad4 with SMTP id h22-20020a05620a245600b00781c13c9ad4mr6815383qkn.142.1704303725795; Wed, 03 Jan 2024 09:42:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303725; cv=none; d=google.com; s=arc-20160816; b=uaV/Hf/MS1v7Lpe5SbsU7FIpqZ+PiGcrYNV2UjulRaX5g8TTRrcfobHAyOvteBE2lh qYKHFoi6MPEYHtDcSS4icuTQFB6CjR/Eok3Gosk/qL/L3PxAMBCbjjZTpBVnkeL/RxZ/ 77mvgtzD8QPjXKcAjVLurLgcA9GlQ6iCgTHV7F9ng2j2tqxPoo55ING+GkTEiwOyTQht kzmp/5GgMquG8VOOKakVEs0zEnP2KjTwQtcUpwkqDMiRdSROedDXz8waBoBIA10+18jl BKPGUlJrExioBNPHl+Q4rZZttF3s8uV68OMLdWmC9rE/M9rNQAz7guG9Qfu7pH3M3qJa 1nag== 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=6qYxYpnr0vzCXiIKNDoO95XioKhgHwYSQEn7vMTXP0k=; fh=MptfaR+7adpcaME/63X0fm8Oaab8Ri8YJu2OQMap89k=; b=JmabVlw9DNBW+ewktgQ+zkLIfRsqzNdAvolUIzWvrvb7sxmQyNXAQR+UF+abP51kiL QJBaOp6f+EhI+qWKJDvnfH0PHegEy2yZ4HWtg5JTdLJbkFXGeVozqec//Zcit6tp2A0P sKn1fBfQWuDNFydNLQ0hFiTGo3z3VZbKQ/4uSNBic4xXJ093raDyWMkzYUZ9YJSZ7ZPf elJBCr9QDoWZxCQwc4tcIC5KeavZZyzR/LZykjbT7odtEl8QASXJkeA9JlcKFUlWHl5l J2MF4f/JPiMtuQ2YOL+/mMM1JoDwdJxSvy0LXq/rX/0bY/zzGndIFld3Rj9lZsRO/2VB VMnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dmj9yqBH; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x12-20020a05620a258c00b00781714576e9si15458634qko.201.2024.01.03.09.42.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:42:05 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dmj9yqBH; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5DX-0007yt-D9; Wed, 03 Jan 2024 12:39:47 -0500 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 1rL5DV-0007uN-KP for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:45 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5D4-0000nJ-29 for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:45 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-32f8441dfb5so10215749f8f.0 for ; Wed, 03 Jan 2024 09:39:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303556; x=1704908356; 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=6qYxYpnr0vzCXiIKNDoO95XioKhgHwYSQEn7vMTXP0k=; b=Dmj9yqBH0R9BNNEJZQN+FNhibX59WBNR3Code1eBTJenUa25jXSHbtf/Mf0IKX8MZe 6XCrym3EOptamH3G/VRfvXTab4yOa7VfOiXHr2c4D86w/Dk19JaYmvLP5DkFpdlfUcBd n5zQxqRocv+qN4aStvKE8zYkwPUe5zUueok/eZB4lKjPDGSvLFnyUQSXYhoKlivHHA3Y zLBt0Arf3oDaXQMU3/8DkBk624NJzpje9MfCfhPvvp3cCcMX2DTZ0kKtiipMNFsR232F tl4q5leS2u6C2kEDIuTDbmYVR04GPG0bXNy9IAoXKc3eLbdH75SJXNqgQChsM1dmRDOM dxvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303556; x=1704908356; 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=6qYxYpnr0vzCXiIKNDoO95XioKhgHwYSQEn7vMTXP0k=; b=KiPtBdpRKp3+Q04iYjl98o2I1A8Q+UvBXVbgdHwAjaN7fPV3kxttUZuH0D9a5rQpCi OZH8lRqLLlGF5YhWEybJqYnIeqcyTZ/qC1AIXHHh0Xk9RYIOQxSPU+AlFEgDBT+Atz+r HMGGAkVbNTE6LidZlcGEpao2fHvawB3TyV6D019NyiGHOJbxFaHcTZXWm70QDIAhb30p DmFG8Pn7ATamWMHeqwDNnIMq0hVnPVlL+Bj5tY8/NSbBhx4nRuSZAi6d63y3mgC7JqQV BxsrAsHnhMZ5+ehfz9ThrB7RU7Ek7FQiFFyNiv1db8A/OCqMTtrXIzju5op2KLzyXDb2 5asw== X-Gm-Message-State: AOJu0Yx9xvjnrjKWIbutZPdJ785TITLTcaa7mx4TZXTeSdehL7B+s7F8 OPxhTcHABALb6YF3FrP0OpS+T/+2y1914A== X-Received: by 2002:adf:e747:0:b0:336:6722:19f with SMTP id c7-20020adfe747000000b003366722019fmr10341379wrn.29.1704303556598; Wed, 03 Jan 2024 09:39:16 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a16-20020a056000101000b003366a9cb0d1sm31080983wrx.92.2024.01.03.09.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:39:13 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6B2135F9D5; Wed, 3 Jan 2024 17:33:53 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 40/43] contrib/plugins: extend execlog to track register changes Date: Wed, 3 Jan 2024 17:33:46 +0000 Message-Id: <20240103173349.398526-41-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.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 With the new plugin register API we can now track changes to register values. Currently the implementation is fairly dumb which will slow down if a large number of register values are being tracked. This could be improved by only instrumenting instructions which mention registers we are interested in tracking. Example usage: ./qemu-aarch64 -D plugin.log -d plugin \ -cpu max,sve256=on \ -plugin contrib/plugins/libexeclog.so,reg=sp,reg=z\* \ ./tests/tcg/aarch64-linux-user/sha512-sve will display in the execlog any changes to the stack pointer (sp) and the SVE Z registers. Signed-off-by: Alex Bennée Cc: Akihiko Odaki Based-On: <20231025093128.33116-19-akihiko.odaki@daynix.com> --- v3 - prefix 0x to register value v2 - we now do the glob-like search in the plugin itself. - fix some erroneous cpus->cpu vAJB: Changes for the new API with a simpler glob based "reg" specifier which can be specified multiple times. --- docs/devel/tcg-plugins.rst | 9 +- contrib/plugins/execlog.c | 189 ++++++++++++++++++++++++++++--------- 2 files changed, 153 insertions(+), 45 deletions(-) diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 81dcd43a612..3a0962723d7 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -497,6 +497,14 @@ arguments if required:: $ qemu-system-arm $(QEMU_ARGS) \ -plugin ./contrib/plugins/libexeclog.so,ifilter=st1w,afilter=0x40001808 -d plugin +This plugin can also dump registers when they change value. Specify the name of the +registers with multiple ``reg`` options. You can also use glob style matching if you wish:: + + $ qemu-system-arm $(QEMU_ARGS) \ + -plugin ./contrib/plugins/libexeclog.so,reg=\*_el2,reg=sp -d plugin + +Be aware that each additional register to check will slow down execution quite considerably. + - contrib/plugins/cache.c Cache modelling plugin that measures the performance of a given L1 cache @@ -583,4 +591,3 @@ The following API is generated from the inline documentation in include the full kernel-doc annotations. .. kernel-doc:: include/qemu/qemu-plugin.h - diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c index f262e5555eb..c20e88a6941 100644 --- a/contrib/plugins/execlog.c +++ b/contrib/plugins/execlog.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2021, Alexandre Iooss * - * Log instruction execution with memory access. + * Log instruction execution with memory access and register changes * * License: GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. @@ -15,30 +15,29 @@ #include +typedef struct { + struct qemu_plugin_register *handle; + GByteArray *last; + GByteArray *new; + const char *name; +} Register; + +typedef struct CPU { + /* Store last executed instruction on each vCPU as a GString */ + GString *last_exec; + /* Ptr array of Register */ + GPtrArray *registers; +} CPU; + QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; -/* Store last executed instruction on each vCPU as a GString */ -static GPtrArray *last_exec; +static CPU *cpus; +static int num_cpus; static GRWLock expand_array_lock; static GPtrArray *imatches; static GArray *amatches; - -/* - * Expand last_exec array. - * - * As we could have multiple threads trying to do this we need to - * serialise the expansion under a lock. - */ -static void expand_last_exec(int cpu_index) -{ - g_rw_lock_writer_lock(&expand_array_lock); - while (cpu_index >= last_exec->len) { - GString *s = g_string_new(NULL); - g_ptr_array_add(last_exec, s); - } - g_rw_lock_writer_unlock(&expand_array_lock); -} +static GPtrArray *rmatches; /** * Add memory read or write information to current instruction log @@ -50,8 +49,8 @@ static void vcpu_mem(unsigned int cpu_index, qemu_plugin_meminfo_t info, /* Find vCPU in array */ g_rw_lock_reader_lock(&expand_array_lock); - g_assert(cpu_index < last_exec->len); - s = g_ptr_array_index(last_exec, cpu_index); + g_assert(cpu_index < num_cpus); + s = cpus[cpu_index].last_exec; g_rw_lock_reader_unlock(&expand_array_lock); /* Indicate type of memory access */ @@ -77,28 +76,46 @@ static void vcpu_mem(unsigned int cpu_index, qemu_plugin_meminfo_t info, */ static void vcpu_insn_exec(unsigned int cpu_index, void *udata) { - GString *s; + CPU *cpu; - /* Find or create vCPU in array */ g_rw_lock_reader_lock(&expand_array_lock); - if (cpu_index >= last_exec->len) { - g_rw_lock_reader_unlock(&expand_array_lock); - expand_last_exec(cpu_index); - g_rw_lock_reader_lock(&expand_array_lock); - } - s = g_ptr_array_index(last_exec, cpu_index); + g_assert(cpu_index < num_cpus); + cpu = &cpus[cpu_index]; g_rw_lock_reader_unlock(&expand_array_lock); /* Print previous instruction in cache */ - if (s->len) { - qemu_plugin_outs(s->str); + if (cpu->last_exec->len) { + if (cpu->registers) { + for (int n = 0; n < cpu->registers->len; n++) { + Register *reg = cpu->registers->pdata[n]; + int sz; + + g_byte_array_set_size(reg->new, 0); + sz = qemu_plugin_read_register(cpu_index, reg->handle, reg->new); + g_assert(sz == reg->last->len); + + if (memcmp(reg->last->data, reg->new->data, sz)) { + GByteArray *temp = reg->last; + g_string_append_printf(cpu->last_exec, ", %s -> 0x", reg->name); + /* TODO: handle BE properly */ + for (int i = sz; i >= 0; i--) { + g_string_append_printf(cpu->last_exec, "%02x", + reg->new->data[i]); + } + reg->last = reg->new; + reg->new = temp; + } + } + } + + qemu_plugin_outs(cpu->last_exec->str); qemu_plugin_outs("\n"); } /* Store new instruction in cache */ /* vcpu_mem will add memory access information to last_exec */ - g_string_printf(s, "%u, ", cpu_index); - g_string_append(s, (char *)udata); + g_string_printf(cpus[cpu_index].last_exec, "%u, ", cpu_index); + g_string_append(cpus[cpu_index].last_exec, (char *)udata); } /** @@ -167,8 +184,10 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) QEMU_PLUGIN_MEM_RW, NULL); /* Register callback on instruction */ - qemu_plugin_register_vcpu_insn_exec_cb(insn, vcpu_insn_exec, - QEMU_PLUGIN_CB_NO_REGS, output); + qemu_plugin_register_vcpu_insn_exec_cb( + insn, vcpu_insn_exec, + rmatches ? QEMU_PLUGIN_CB_R_REGS : QEMU_PLUGIN_CB_NO_REGS, + output); /* reset skip */ skip = (imatches || amatches); @@ -177,17 +196,86 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) } } +static Register *init_vcpu_register(int vcpu_index, + qemu_plugin_reg_descriptor *desc) +{ + Register *reg = g_new0(Register, 1); + int r; + + reg->handle = desc->handle; + reg->name = g_strdup(desc->name); + reg->last = g_byte_array_new(); + reg->new = g_byte_array_new(); + + /* read the initial value */ + r = qemu_plugin_read_register(vcpu_index, reg->handle, reg->last); + g_assert(r > 0); + return reg; +} + +static registers_init(int vcpu_index) +{ + GPtrArray *registers = g_ptr_array_new(); + g_autoptr(GArray) reg_list = qemu_plugin_get_registers(vcpu_index); + + if (reg_list && reg_list->len) { + /* + * Go through each register in the complete list and + * see if we want to track it. + */ + for (int r = 0; r < reg_list->len; r++) { + qemu_plugin_reg_descriptor *rd = &g_array_index( + reg_list, qemu_plugin_reg_descriptor, r); + for (int p = 0; p < rmatches->len; p++) { + g_autoptr(GPatternSpec) pat = g_pattern_spec_new(rmatches->pdata[p]); + if (g_pattern_match_string(pat, rd->name)) { + Register *reg = init_vcpu_register(vcpu_index, rd); + g_ptr_array_add(registers, reg); + } + } + } + } + cpus[num_cpus].registers = registers; +} + +/* + * Initialise a new vcpu/thread with: + * - last_exec tracking data + * - list of tracked registers + * - initial value of registers + * + * As we could have multiple threads trying to do this we need to + * serialise the expansion under a lock. + */ +static void vcpu_init(qemu_plugin_id_t id, unsigned int vcpu_index) +{ + g_rw_lock_writer_lock(&expand_array_lock); + + if (vcpu_index >= num_cpus) { + cpus = g_realloc_n(cpus, vcpu_index + 1, sizeof(*cpus)); + while (vcpu_index >= num_cpus) { + cpus[num_cpus].last_exec = g_string_new(NULL); + + /* Any registers to track? */ + if (rmatches && rmatches->len) { + registers_init(vcpu_index); + } + num_cpus++; + } + } + + g_rw_lock_writer_unlock(&expand_array_lock); +} + /** * On plugin exit, print last instruction in cache */ static void plugin_exit(qemu_plugin_id_t id, void *p) { guint i; - GString *s; - for (i = 0; i < last_exec->len; i++) { - s = g_ptr_array_index(last_exec, i); - if (s->str) { - qemu_plugin_outs(s->str); + for (i = 0; i < num_cpus; i++) { + if (cpus[i].last_exec->str) { + qemu_plugin_outs(cpus[i].last_exec->str); qemu_plugin_outs("\n"); } } @@ -212,6 +300,18 @@ static void parse_vaddr_match(char *match) g_array_append_val(amatches, v); } +/* + * We have to wait until vCPUs are started before we can check the + * patterns find anything. + */ +static void add_regpat(char *regpat) +{ + if (!rmatches) { + rmatches = g_ptr_array_new(); + } + g_ptr_array_add(rmatches, g_strdup(regpat)); +} + /** * Install the plugin */ @@ -224,9 +324,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, * we don't know the size before emulation. */ if (info->system_emulation) { - last_exec = g_ptr_array_sized_new(info->system.max_vcpus); - } else { - last_exec = g_ptr_array_new(); + cpus = g_new(CPU, info->system.max_vcpus); } for (int i = 0; i < argc; i++) { @@ -236,13 +334,16 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, parse_insn_match(tokens[1]); } else if (g_strcmp0(tokens[0], "afilter") == 0) { parse_vaddr_match(tokens[1]); + } else if (g_strcmp0(tokens[0], "reg") == 0) { + add_regpat(tokens[1]); } else { fprintf(stderr, "option parsing failed: %s\n", opt); return -1; } } - /* Register translation block and exit callbacks */ + /* Register init, translation block and exit callbacks */ + qemu_plugin_register_vcpu_init_cb(id, vcpu_init); qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); From patchwork Wed Jan 3 17:33:47 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: 759645 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6615002wrw; Wed, 3 Jan 2024 09:47:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEqQpIjvebILIHc4xPCBJPs+bk6Lj2rLVho5FkypAkgnw5gwuRdSXDNttP+nxGqwchHvlV/ X-Received: by 2002:ac8:5d88:0:b0:421:b909:de9e with SMTP id d8-20020ac85d88000000b00421b909de9emr25361826qtx.2.1704304071448; Wed, 03 Jan 2024 09:47:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704304071; cv=none; d=google.com; s=arc-20160816; b=HhsKoWWq8q2RdCpqnxsBlA0cJuFUBwkGHrhsuUUq3NdlKwaTwepvd96xqKpQkkTA+6 hlsRDEbjX0tsgNcWYYFASQ7IpSxWiO2PF0AvEIuzXZufJWJdfBGoaCE20DEJGdRT7S7/ yKppILTWtIUDBojjKTG2Tk4FBNM4VosDlNwMx66aSES03C8Nzp/N023/UEbe578pHRuj 3zaJjiV04id4dSs83T0JIuZ346h86CPpHr1PMujzi5w11g/mKZM5XshDRsEDsbj05b99 AQ7wNRlk7fb/lZhiomJS7HqBH6fd1rsyPdYkXo0q7qmdAFlpm6Rc1iEHfRe86jgnSPOk i+6g== 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=ctlsx5qTTsFuiHpWia+LYNCfPNohh0GYQvm+lOAMVvc=; fh=5s6F1VpUg/LkqHSyTlr7gneXArwgJkl0qAfGr3eFpAs=; b=Fv3lgN2l5vkKJE2oMqgZIKOs2eV0bN6anWakkBPyW5Bm66kV3XiVZJuL8Pg13lEzHK l8iJ0ZUN6FsjmuMMOJqDFx8UcOfX2Z1cG9ryExtpvgYTGMpakNmDLMUZtAMSi/Axzx7w x9e+yxmXrbgIQBeXDrrIYvRIDTA2zp0g+98/dXJO7nlYfFMW+0oCMFKVAobV2ElrZ5ki +sNiLAsrnwslgffKXVWxHbbcYl2DgedAyrSKOuGmeexIAjPEAOBMamUsPXupKmLetI81 915NJoY5f12agybrTZ//JHQ3FMcNLvFlltRPKI23w6xNZyabwzP7dk1Sl68Fw0EB1bMs aPig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d3AYzN6E; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c5-20020ac85a85000000b004237660db14si29599346qtc.338.2024.01.03.09.47.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:47:51 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d3AYzN6E; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5DN-0007VN-1D; Wed, 03 Jan 2024 12:39:37 -0500 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 1rL5DG-0006xs-Ve for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:31 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5D0-0000hj-3g for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:30 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40d2e56f3a6so4406075e9.1 for ; Wed, 03 Jan 2024 09:39:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303552; x=1704908352; 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=ctlsx5qTTsFuiHpWia+LYNCfPNohh0GYQvm+lOAMVvc=; b=d3AYzN6Ekg+phIcyH9LAeWmm94jZkKA0VOxQN0j5ix3CEpG3rkx4fMD/uqxQbAYFbW cY3cCufJnyBYDYuYdM59I9gSV+6AsWiGLUYqJGpHvCY4HN3/9Tg5Sic0AH+odkx+S2gj HvFRNwEkrwr60K4hVI1DSwyoW+re6TP1pGvEIAQMeztSo+ezBwIWsTephN7hgFmYnT7V PvY5ujZbbUcijbtNtVQYxrvSV0qiw8r1yZYPakQtRZN7e6259s0y4kInRFzFxGs6Io2r vPzu96sfKDWEEZhJHw2eefUc66l+eQRRivr7RNsk4AZeiDJJMX8OUEUTEATQ+C/DI8Hq Db0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303552; x=1704908352; 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=ctlsx5qTTsFuiHpWia+LYNCfPNohh0GYQvm+lOAMVvc=; b=wZX8zhLfSqgtTKW9hACZBLzWFYN6ksCOZXIXxuCg5bWVJQZwdhDVxOiFnbWZLr3dJI 6gj3tcrtIlwfYrEUV/B2fyhygwcXNSeF9Py86GlJIUnYq4xo3SYYJlA63OcnjMtmX+Vo jnTAAvybg9sIbibEpudOUYAG+ncHdvyWcoCJIMb+00eWZ2BQ6rHn8/0Xpqhf9nZ2ZYk5 CKeisuDosLFEHdY5xtLUzn/JJXTydQSHEDrQP13LKTnXSoE3QThEO9NlTk0I0DAgkiY6 jxK2x9qYjXel74YvlsHE0aNWHxaJfsmu4/pZIiD+f8YVf7pKyIIdKnGLBYSh5s6J6xNO 8sIg== X-Gm-Message-State: AOJu0YzVkIcoPXZkH1CnspSOPBckYrEg5YVA3nJh0+Il57uyxA/kuI7W eRi52LFq0GhuijCMbieaetNh/yQdZk6hUQ== X-Received: by 2002:a05:600c:3b08:b0:40d:8586:82c5 with SMTP id m8-20020a05600c3b0800b0040d858682c5mr706985wms.12.1704303552097; Wed, 03 Jan 2024 09:39:12 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z1-20020a05600c0a0100b0040c3953cda5sm2984624wmp.45.2024.01.03.09.39.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:39:08 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 83FBF5F9D6; Wed, 3 Jan 2024 17:33:53 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis Subject: [PATCH v2 41/43] contrib/plugins: optimise the register value tracking Date: Wed, 3 Jan 2024 17:33:47 +0000 Message-Id: <20240103173349.398526-42-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.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_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=unavailable 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 This adds an additional flag which attempts to optimise the register tracking by only instrumenting instructions which are likely to change its value. This relies on the disassembler showing up the register names in disassembly so is only enabled when asked for. Signed-off-by: Alex Bennée --- docs/devel/tcg-plugins.rst | 10 +- contrib/plugins/execlog.c | 189 ++++++++++++++++++++++++++++++------- 2 files changed, 165 insertions(+), 34 deletions(-) diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 3a0962723d7..fa7421279f5 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -503,7 +503,15 @@ registers with multiple ``reg`` options. You can also use glob style matching if $ qemu-system-arm $(QEMU_ARGS) \ -plugin ./contrib/plugins/libexeclog.so,reg=\*_el2,reg=sp -d plugin -Be aware that each additional register to check will slow down execution quite considerably. +Be aware that each additional register to check will slow down +execution quite considerably. You can optimise the number of register +checks done by using the rdisas option. This will only instrument +instructions that mention the registers in question in disassembly. +This is not foolproof as some instructions implicitly change +instructions. You can use the ifilter to catch these cases: + + $ qemu-system-arm $(QEMU_ARGS) \ + -plugin ./contrib/plugins/libexeclog.so,ifilter=msr,ifilter=blr,reg=x30,reg=\*_el1,rdisas=on - contrib/plugins/cache.c diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c index c20e88a6941..a5269baf067 100644 --- a/contrib/plugins/execlog.c +++ b/contrib/plugins/execlog.c @@ -27,6 +27,7 @@ typedef struct CPU { GString *last_exec; /* Ptr array of Register */ GPtrArray *registers; + int index; } CPU; QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; @@ -38,6 +39,9 @@ static GRWLock expand_array_lock; static GPtrArray *imatches; static GArray *amatches; static GPtrArray *rmatches; +static bool disas_assist; +static GMutex add_reg_name_lock; +static GPtrArray *all_reg_names; /** * Add memory read or write information to current instruction log @@ -72,9 +76,14 @@ static void vcpu_mem(unsigned int cpu_index, qemu_plugin_meminfo_t info, } /** - * Log instruction execution + * Log instruction execution, outputting the last one. + * + * vcpu_insn_exec() is a copy and paste of vcpu_insn_exec_with_regs() + * without the checking of register values when we've attempted to + * optimise with disas_assist. */ -static void vcpu_insn_exec(unsigned int cpu_index, void *udata) + +static CPU *get_cpu(int cpu_index) { CPU *cpu; @@ -83,39 +92,87 @@ static void vcpu_insn_exec(unsigned int cpu_index, void *udata) cpu = &cpus[cpu_index]; g_rw_lock_reader_unlock(&expand_array_lock); + return cpu; +} + +static void insn_check_regs(CPU *cpu) { + for (int n = 0; n < cpu->registers->len; n++) { + Register *reg = cpu->registers->pdata[n]; + int sz; + + g_byte_array_set_size(reg->new, 0); + sz = qemu_plugin_read_register(cpu->index, reg->handle, reg->new); + g_assert(sz == reg->last->len); + + if (memcmp(reg->last->data, reg->new->data, sz)) { + GByteArray *temp = reg->last; + g_string_append_printf(cpu->last_exec, ", %s -> 0x", reg->name); + /* TODO: handle BE properly */ + for (int i = sz; i >= 0; i--) { + g_string_append_printf(cpu->last_exec, "%02x", + reg->new->data[i]); + } + reg->last = reg->new; + reg->new = temp; + } + } +} + +/* Log last instruction while checking registers */ +static void vcpu_insn_exec_with_regs(unsigned int cpu_index, void *udata) +{ + CPU *cpu = get_cpu(cpu_index); + /* Print previous instruction in cache */ if (cpu->last_exec->len) { if (cpu->registers) { - for (int n = 0; n < cpu->registers->len; n++) { - Register *reg = cpu->registers->pdata[n]; - int sz; - - g_byte_array_set_size(reg->new, 0); - sz = qemu_plugin_read_register(cpu_index, reg->handle, reg->new); - g_assert(sz == reg->last->len); - - if (memcmp(reg->last->data, reg->new->data, sz)) { - GByteArray *temp = reg->last; - g_string_append_printf(cpu->last_exec, ", %s -> 0x", reg->name); - /* TODO: handle BE properly */ - for (int i = sz; i >= 0; i--) { - g_string_append_printf(cpu->last_exec, "%02x", - reg->new->data[i]); - } - reg->last = reg->new; - reg->new = temp; - } - } + insn_check_regs(cpu); + } + + qemu_plugin_outs(cpu->last_exec->str); + qemu_plugin_outs("\n"); + } + + /* Store new instruction in cache */ + /* vcpu_mem will add memory access information to last_exec */ + g_string_printf(cpu->last_exec, "%u, ", cpu_index); + g_string_append(cpu->last_exec, (char *)udata); +} + +/* Log last instruction while checking registers, ignore next */ +static void vcpu_insn_exec_only_regs(unsigned int cpu_index, void *udata) +{ + CPU *cpu = get_cpu(cpu_index); + + /* Print previous instruction in cache */ + if (cpu->last_exec->len) { + if (cpu->registers) { + insn_check_regs(cpu); } qemu_plugin_outs(cpu->last_exec->str); qemu_plugin_outs("\n"); } + /* reset */ + cpu->last_exec->len = 0; +} + +/* Log last instruction without checking regs, setup next */ +static void vcpu_insn_exec(unsigned int cpu_index, void *udata) +{ + CPU *cpu = get_cpu(cpu_index); + + /* Print previous instruction in cache */ + if (cpu->last_exec->len) { + qemu_plugin_outs(cpu->last_exec->str); + qemu_plugin_outs("\n"); + } + /* Store new instruction in cache */ /* vcpu_mem will add memory access information to last_exec */ - g_string_printf(cpus[cpu_index].last_exec, "%u, ", cpu_index); - g_string_append(cpus[cpu_index].last_exec, (char *)udata); + g_string_printf(cpu->last_exec, "%u, ", cpu_index); + g_string_append(cpu->last_exec, (char *)udata); } /** @@ -128,6 +185,8 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) { struct qemu_plugin_insn *insn; bool skip = (imatches || amatches); + bool check_regs_this = rmatches; + bool check_regs_next = false; size_t n = qemu_plugin_tb_n_insns(tb); for (size_t i = 0; i < n; i++) { @@ -148,7 +207,8 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) /* * If we are filtering we better check out if we have any * hits. The skip "latches" so we can track memory accesses - * after the instruction we care about. + * after the instruction we care about. Also enable register + * checking on the next instruction. */ if (skip && imatches) { int j; @@ -156,6 +216,7 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) char *m = g_ptr_array_index(imatches, j); if (g_str_has_prefix(insn_disas, m)) { skip = false; + check_regs_next = rmatches; } } } @@ -170,8 +231,38 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) } } + /* + * Check the disassembly to see if a register we care about + * will be affected by this instruction. This relies on the + * dissembler doing something sensible for the registers we + * care about. + */ + if (disas_assist && rmatches) { + check_regs_next = false; + gchar *args = g_strstr_len(insn_disas, -1, " "); + for (int n = 0; n < all_reg_names->len; n++) { + gchar *reg = g_ptr_array_index(all_reg_names, n); + if (g_strrstr(args, reg)) { + check_regs_next = true; + skip = false; + } + } + } + + /* + * We now have 3 choices: + * + * Log this instruction normally + * Log this instruction checking for register changes + * Don't log this instruction but check for register changes from the last one + */ + if (skip) { - g_free(insn_disas); + if (check_regs_this) { + qemu_plugin_register_vcpu_insn_exec_cb(insn, + vcpu_insn_exec_only_regs, + QEMU_PLUGIN_CB_R_REGS, NULL); + } } else { uint32_t insn_opcode; insn_opcode = *((uint32_t *)qemu_plugin_insn_data(insn)); @@ -184,15 +275,28 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) QEMU_PLUGIN_MEM_RW, NULL); /* Register callback on instruction */ - qemu_plugin_register_vcpu_insn_exec_cb( - insn, vcpu_insn_exec, - rmatches ? QEMU_PLUGIN_CB_R_REGS : QEMU_PLUGIN_CB_NO_REGS, - output); + if (check_regs_this) { + qemu_plugin_register_vcpu_insn_exec_cb( + insn, vcpu_insn_exec_with_regs, + QEMU_PLUGIN_CB_R_REGS, + output); + } else { + qemu_plugin_register_vcpu_insn_exec_cb( + insn, vcpu_insn_exec, + QEMU_PLUGIN_CB_NO_REGS, + output); + } /* reset skip */ skip = (imatches || amatches); } + /* set regs for next */ + if (disas_assist && rmatches) { + check_regs_this = check_regs_next; + } + + g_free(insn_disas); } } @@ -200,10 +304,11 @@ static Register *init_vcpu_register(int vcpu_index, qemu_plugin_reg_descriptor *desc) { Register *reg = g_new0(Register, 1); + g_autofree gchar *lower = g_utf8_strdown(desc->name, -1); int r; reg->handle = desc->handle; - reg->name = g_strdup(desc->name); + reg->name = g_intern_string(lower); reg->last = g_byte_array_new(); reg->new = g_byte_array_new(); @@ -213,7 +318,7 @@ static Register *init_vcpu_register(int vcpu_index, return reg; } -static registers_init(int vcpu_index) +static void registers_init(int vcpu_index) { GPtrArray *registers = g_ptr_array_new(); g_autoptr(GArray) reg_list = qemu_plugin_get_registers(vcpu_index); @@ -228,9 +333,20 @@ static registers_init(int vcpu_index) reg_list, qemu_plugin_reg_descriptor, r); for (int p = 0; p < rmatches->len; p++) { g_autoptr(GPatternSpec) pat = g_pattern_spec_new(rmatches->pdata[p]); - if (g_pattern_match_string(pat, rd->name)) { + g_autofree gchar *rd_lower = g_utf8_strdown(rd->name, -1); + if (g_pattern_match_string(pat, rd->name) || + g_pattern_match_string(pat, rd_lower)) { Register *reg = init_vcpu_register(vcpu_index, rd); g_ptr_array_add(registers, reg); + + /* we need a list of regnames at TB translation time */ + if (disas_assist) { + g_mutex_lock(&add_reg_name_lock); + if (!g_ptr_array_find(all_reg_names, reg->name, NULL)) { + g_ptr_array_add(all_reg_names, reg->name); + } + g_mutex_unlock(&add_reg_name_lock); + } } } } @@ -254,6 +370,7 @@ static void vcpu_init(qemu_plugin_id_t id, unsigned int vcpu_index) if (vcpu_index >= num_cpus) { cpus = g_realloc_n(cpus, vcpu_index + 1, sizeof(*cpus)); while (vcpu_index >= num_cpus) { + cpus[num_cpus].index = vcpu_index; cpus[num_cpus].last_exec = g_string_new(NULL); /* Any registers to track? */ @@ -336,6 +453,12 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, parse_vaddr_match(tokens[1]); } else if (g_strcmp0(tokens[0], "reg") == 0) { add_regpat(tokens[1]); + } else if (g_strcmp0(tokens[0], "rdisas") == 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &disas_assist)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", opt); + return -1; + } + all_reg_names = g_ptr_array_new(); } else { fprintf(stderr, "option parsing failed: %s\n", opt); return -1; From patchwork Wed Jan 3 17:33:48 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: 759637 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6612487wrw; Wed, 3 Jan 2024 09:40:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZlEQPwTtcW3OGc3e/a3Q9NMSieTAPaaaopNWf4+rNGq/B0RMCKYcJMBMAq9u6rBXoU7kP X-Received: by 2002:a05:6214:5193:b0:67f:458f:bd57 with SMTP id kl19-20020a056214519300b0067f458fbd57mr1706029qvb.26.1704303655006; Wed, 03 Jan 2024 09:40:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704303654; cv=none; d=google.com; s=arc-20160816; b=0Z02dPq+Oy8DdiU8PAQTbyWNwUuuDfFvKZfoGHyR47WkPMPul4T08WgPiCm0sPW+SP stVxo1WE/YhMHzIyivirl21cSsIbzOAlOXZ7OiPmlp0UtQgNHxIDkx5R7JGyGok1ctf3 Y6ZWCbiu4+Uz7Q0xATnypxDgTWNzYSDUiuL5tvQtwMlkH9sa+ZlFfGydgQ6gFfZgVef0 44QpIOxhyYP0k9n9PHbfNdEjX3rrwxVuLlk/pmA1Fo7fiPFcQp8d3PugQiyxRTQN86lf AJbj8Himoy9b6kEffRm9vgEdnrj3Mgflb7P0Uaqgux5reD6Xfg7alhWHGVmt/aH605TV IX3w== 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=8xNYPWzXiJVejiOzH0lqPZBPc9FMUdMG5VHkvS57+tg=; fh=5s6F1VpUg/LkqHSyTlr7gneXArwgJkl0qAfGr3eFpAs=; b=Rme4jtAlUIAIRiorg8PXZTAmsq2ZrpzFe/Zr/p5QPwFCnwmCSYGQXfXHNY75PtzfeL lW46EKkDylUbEfOE5bu8XwWRLg4ceW34ooIan4ISw4TLR5zQviPtpRRuY3jkQ/bfieSz Kv58DP4pl9V/H8ZK+8IQXpqKeQsnyYoKJ7fbxUwd2bj19/Qfko6aM9XqZ3YL/jJPYSO8 xDL+fs5d2FzLlPJk46FA3wuoE9fs4f5wfPEvQiBpfc1fuMa8La9eydshdYZ48tfJXKY6 qPQZQvDK9kJPP/KgxMDnrlrQElG84kT4+LZYA+I1d3uWg49dEVhBGbwFF0I5Tucv5wVu uSYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Z9nVS/fu"; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bp7-20020a05620a458700b007811c55e1efsi29772684qkb.111.2024.01.03.09.40.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:40:54 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Z9nVS/fu"; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5DA-0006V8-Na; Wed, 03 Jan 2024 12:39:26 -0500 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 1rL5Cz-00066c-Sp for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:13 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5Cu-0000cP-2E for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:39:13 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40d3c4bfe45so111751175e9.1 for ; Wed, 03 Jan 2024 09:39:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303546; x=1704908346; 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=8xNYPWzXiJVejiOzH0lqPZBPc9FMUdMG5VHkvS57+tg=; b=Z9nVS/fuQrMwOMZmcwNXTWVwCEVCyGjYTmiFMZ54JNeASEuZsHNj/QuU5UpN8zOkKJ EXy0//ppW7dhGwHJGsySpz98Z+egBL0P8K9/CG4ooV+BBddON/PyuG87SCECslaXAC2Y FXLEIK8IZZlh5VDO3sxSLj3YGShgH3s574Lx6CXwZvpRfesVsvwvV9XVEXBSRBvgOQfC UiX125raqTvx52hiVysjCzMPMInmUSyHdJZmfM90rTGTUcjWh9nxssSbsdkODoTUjY32 exncFpPY/8FpS1bfKidCsx2Tp/E15+I4hMmb34lYCCYwzSqPgCK+AA2MUta88rXaqkR2 4/6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303546; x=1704908346; 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=8xNYPWzXiJVejiOzH0lqPZBPc9FMUdMG5VHkvS57+tg=; b=ubYUDM1IM1qlJFm29qwUtEMvxXKKlKjR/HrwxyADggWG+fal88tO8MkZrha6WVz9uM K8DyJ85VzoNa6xmApvk7YrLltYNBtiOqP8tIUqE6HYX18q1T3b7QCsq0FWLkSlyRDA5H l4C73VlQQELD8dFr47Poh/c63KYOHoJVW9LBvOdkhj/crpNCv5VKEOLWmk83nkbWGYMA DjIRgsuhEFgdznYa7Vi3rtw5vXhwOXxQLMbZVFiwoFb88TK/ntmCPQDjOYn+Vf/c8rUo rVI1v6padyxsvXepDoqUMMYaRIK/jgIBLmhkq/UeMIJmaME6VrYnRPMjsC91cqeTZ6xc 2tnw== X-Gm-Message-State: AOJu0YwswBSQU7R4r9Wccf3vyAtW7ZoZC0wklnV4Ghe8ryNlSzhvJQ0d h+jbFOvcPM7tuJXKqLv+ywDnP4Pmo5T7hQ== X-Received: by 2002:a05:600c:2988:b0:40c:657d:cf12 with SMTP id r8-20020a05600c298800b0040c657dcf12mr5061241wmd.111.1704303546516; Wed, 03 Jan 2024 09:39:06 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id fj7-20020a05600c0c8700b0040d77ebd55csm2974446wmb.13.2024.01.03.09.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:39:05 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 9C6095F9D7; Wed, 3 Jan 2024 17:33:53 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis Subject: [PATCH v2 42/43] docs/devel: lift example and plugin API sections up Date: Wed, 3 Jan 2024 17:33:48 +0000 Message-Id: <20240103173349.398526-43-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.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=unavailable 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 This makes them a bit more visible in the TCG emulation menu rather than hiding them away bellow the ToC limit. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé --- docs/devel/tcg-plugins.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index fa7421279f5..535a74684c5 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -143,7 +143,7 @@ requested. The plugin isn't completely uninstalled until the safe work has executed while all vCPUs are quiescent. Example Plugins ---------------- +=============== There are a number of plugins included with QEMU and you are encouraged to contribute your own plugins plugins upstream. There is a @@ -591,8 +591,8 @@ The plugin has a number of arguments, all of them are optional: configuration arguments implies ``l2=on``. (default: N = 2097152 (2MB), B = 64, A = 16) -API ---- +Plugin API +========== The following API is generated from the inline documentation in ``include/qemu/qemu-plugin.h``. Please ensure any updates to the API From patchwork Wed Jan 3 17:33:49 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: 759650 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp6615803wrw; Wed, 3 Jan 2024 09:50:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IE0oMXo1zCzcPmH8OOK9jVkr3IzGh1L23vrnjp155piTAJ0bpq1sD6RJWmD2PBjxV1T8FSX X-Received: by 2002:a05:622a:1c1:b0:428:34a7:4b89 with SMTP id t1-20020a05622a01c100b0042834a74b89mr2130666qtw.14.1704304210262; Wed, 03 Jan 2024 09:50:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704304210; cv=none; d=google.com; s=arc-20160816; b=k0FqhOQBAJhzKIylKCg5++6QzQmQlDH/hpLSsIHE4/fZ4X6IOwbxEJdijONC4yj5UW eriHU0zaa4bVK+F9GUOG4af/z7fz9sRETTdkJMjBAPE0a/OHisXYKwUzsI0NOcA5MwGp Dvvmcn+EEzKpMkFNDYcY4ZV94MWxrntOID6HZ1QxTa8uNZimmTHyvV5l+qDedylWncAj /95zB50uJzDCZIzy8drZplLmN80vmMqCz/bUelljcEjIDv4aLcMsGraKPhjtudOz16c0 ygYIbz2D1QVvC2saHcLbZVqMCCHA+Sk1w34qs1oI0VVP/wqYi4GLBoIPUGnTKzF9RKz2 gRwQ== 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=6SqdFcQlAJfCo/zD79U6TVq3bxpUqFYpwmC4QorajEA=; fh=5s6F1VpUg/LkqHSyTlr7gneXArwgJkl0qAfGr3eFpAs=; b=Log3Og0lTJDldcDCHRIUnICuho5t51dU8PmqWK3OeLo+gkvTDCOYc9IUxwpS4mrRvC spM9NuXkB1D35+peoU3E+iYiaJARhkDr/NdsCcVteX2trLV2NadxYgqsHAKdSA74ZZD8 lHWpjrxLUvpyW0/4eLQp7/Bx34uDTHKV5zILqeWx6lJjHf95t0rnPHLxJSpdGRvDR8Rv vDDefIedEulghDuJzXFLBRXEkEG/vFmhZJt6h4TNVc6Hmy8LsM1CTqyhPSq8BTUWDbT+ RPE9J3eKUgsefFgUVXik8ojLYZAvzqSXbtGIDtUVqvSIIg/fkz4FRxWSneQ1vEWuJgUt RiBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="M/XA8ZIV"; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p18-20020a05622a049200b00423b49a1487si29490256qtx.670.2024.01.03.09.50.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2024 09:50:10 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="M/XA8ZIV"; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL5Mj-0000h8-CD; Wed, 03 Jan 2024 12:49:17 -0500 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 1rL5Md-0000KM-QB for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:49:11 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL5Ma-0000IZ-6l for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:49:11 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3373a30af67so3036290f8f.0 for ; Wed, 03 Jan 2024 09:49:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704304146; x=1704908946; 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=6SqdFcQlAJfCo/zD79U6TVq3bxpUqFYpwmC4QorajEA=; b=M/XA8ZIVIl14/b5CEJdCIXEuiu9WWFr7yyJ7VejV+OwPyHgrqOPwxA1yHj5LZFP8U9 vanrbIrQhs1v43XvkERSpOMFFP/aCctmfSMSnrPdyTqhhiHFbNq3vw3o4zxFUW9CN3R/ XAuYWA8WzGjxFXoPKX4AvhkuD74AvrxSiNAxUeDIdTFErja0S2wMNCgg2IaQpibz7F04 quB1X5cQh0j0xk1P9kuito8bXIMTMByW16s+lXoE589hixjIY2489RaDg8n+gA6zOonj BAA07XX+RWqoUgyLleuSO+N8bJcx7R5iG9HLe885GxoxCDfvho/k0LphcmvleZxyTx5h gwxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704304146; x=1704908946; 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=6SqdFcQlAJfCo/zD79U6TVq3bxpUqFYpwmC4QorajEA=; b=MrvhE3XXhwbGakqMVTdfJDTIYiOA+HBXb1IOQdBQrszS6GT1POr4ZqAn+I5I33Dtac sC6Q/CgZ3ULGpUHLNAcGedvin1MJzryqDIsFTebaW500pb+1ABSXgMrnofLMToWSTgXF uawK6sv7oB/TmxrPqSgAlHbpljqItk0+VZktvPWVhPijaVZTVdEGhpuRDQh+UE/iww5p OW1zubaXEqhs1FkZguRdSviYYtKySc6+goiDmxEMeKhMmy0WLIsR6F5J7vIoCQovOOkH Vk9bgsA4CTRqHssHg/AoA8c4y5IeftH6r6eA+nAwM95wa3jBnJPsjlvj6MCEJrnh0Eas Fynw== X-Gm-Message-State: AOJu0Ywg97ACiTpCJeOHNwrqYgxkJNNEieuGBa8UA+Pc79Jke2suJxZ+ 7N02nmz4pnltK59dzpFCrxo6hZLtKVeLQg== X-Received: by 2002:a5d:47ac:0:b0:337:4a09:b7d8 with SMTP id 12-20020a5d47ac000000b003374a09b7d8mr916886wrb.211.1704304146266; Wed, 03 Jan 2024 09:49:06 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id b15-20020a5d4b8f000000b00336a0c083easm26789106wrt.53.2024.01.03.09.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:49:05 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B41EC5F9D8; Wed, 3 Jan 2024 17:33:53 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis Subject: [PATCH v2 43/43] docs/devel: document some plugin assumptions Date: Wed, 3 Jan 2024 17:33:49 +0000 Message-Id: <20240103173349.398526-44-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.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=unavailable 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 While we attempt to hide implementation details from the plugin we shouldn't be totally obtuse. Let the user know what they can and can't expect with the various instrumentation options. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- docs/devel/tcg-plugins.rst | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 535a74684c5..9cc09d8c3da 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -112,6 +112,55 @@ details are opaque to plugins. The plugin is able to query select details of instructions and system configuration only through the exported *qemu_plugin* functions. +However the following assumptions can be made: + +Translation Blocks +++++++++++++++++++ + +All code will go through a translation phase although not all +translations will be necessarily be executed. You need to instrument +actual executions to track what is happening. + +It is quite normal to see the same address translated multiple times. +If you want to track the code in system emulation you should examine +the underlying physical address (``qemu_plugin_insn_haddr``) to take +into account the effects of virtual memory although if the system does +paging this will change too. + +Not all instructions in a block will always execute so if its +important to track individual instruction execution you need to +instrument them directly. However asynchronous interrupts will not +change control flow mid-block. + +Instructions +++++++++++++ + +Instruction instrumentation runs before the instruction executes. You +can be can be sure the instruction will be dispatched, but you can't +be sure it will complete. Generally this will be because of a +synchronous exception (e.g. SIGILL) triggered by the instruction +attempting to execute. If you want to be sure you will need to +instrument the next instruction as well. See the ``execlog.c`` plugin +for examples of how to track this and finalise details after execution. + +Memory Accesses ++++++++++++++++ + +Memory callbacks are called after a successful load or store. +Unsuccessful operations (i.e. faults) will not be visible to memory +instrumentation although the execution side effects can be observed +(e.g. entering a exception handler). + +System Idle and Resume States ++++++++++++++++++++++++++++++ + +The ``qemu_plugin_register_vcpu_idle_cb`` and +``qemu_plugin_register_vcpu_resume_cb`` functions can be used to track +when CPUs go into and return from sleep states when waiting for +external I/O. Be aware though that these may occur less frequently +than in real HW due to the inefficiencies of emulation giving less +chance for the CPU to idle. + Internals ---------