From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753103; cv=none; d=zohomail.com; s=zohoarc; b=KiYUvGllE0YUGk54mVNvjEK07sEWN0Fpg4p4WNn6q1GMwnTy+xdLP8HhgWKecZB69OgpgKWZ+ogVuznNEDL721+rZ+NYT2DolikAxg7885f7+yynfGyTcHTKqhxqDZQ5faURw9ocoZmNdn6qiV8XRt7Aevs0/5m3up2UYFi/BQM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753103; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Wg6+PT/hZIx0xGwf6Sxgv7SpSjwIGao1Eq5ccApyXa8=; b=AAsr+tPt3xRqF3y3/23GqDuLV0xBj8R1VDebM+8T9jQfdjcpOKwB3p9BE4fa3ntefn/ZP6aDo3i/A1YDldp7QNJWSA5nO8AsSepXqmEf2FNNvt0xq2DEpu+6LmbqCGjOv+RdBOwzO7LR/EhU2NBbhHS6xkzNNpRk5lO6vZfRZzA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 176175310376385.32998634168473; Wed, 29 Oct 2025 08:51:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8S0-00040T-SQ; Wed, 29 Oct 2025 11:51:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8Ry-0003zE-Pp for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:02 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8Rp-0002rm-Fl for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:02 -0400 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-b6d53684cfdso6934966b.0 for ; Wed, 29 Oct 2025 08:50:50 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6dad195456sm929565466b.72.2025.10.29.08.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:46 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id EFD905F909; Wed, 29 Oct 2025 15:50:45 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753048; x=1762357848; 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=Wg6+PT/hZIx0xGwf6Sxgv7SpSjwIGao1Eq5ccApyXa8=; b=N+FfwyUwIdrv8CW571T0zdaa/ARmKsWWq51S4AmR2uoB+zil001DzKRewTIZVPv5J+ qBvK+BLQS9yQj2LQ5HToz67hiCqkYuaa3AhfyxsrwjlbvD/0SCpUCQKX91JDk/cewAGV mxAu0qlxA6hNlJMGg5t7LsR/uJEUFCmoVZHdiJ6ZyV1lpsuoGSwe6397FQfx8bYAsPx1 vOW9Jk64uz042a9ZQmVzngYOaWrb8exwEHo+mxsezwDtNdC4VNxwkLXwZKqJIM3SqTil pdlOWKzyfCymsiYdTPqrAjDC+FlXN2pOxR24iN+W1Q1wS9DiSx4c4nHN+WJZIGEnloS4 2oGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753048; x=1762357848; 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=Wg6+PT/hZIx0xGwf6Sxgv7SpSjwIGao1Eq5ccApyXa8=; b=FJ0ow9DU/Lf1eb919wMN3v8PHQUe2iu95HG78eL3OvmNuyedObEi1v1xWLJZRJo50J Mch63GKjHTtdCyR7e2cz9m40vugC6wd0OGM0Sxkn0zzdMttyo1KbhQ54n6lgkh79nwu4 PCNcOKqeWGEMPPbGIUDHWbKsVOgKwSKXJxDT+7w+Dmly8ZZzcKCoJGddnUeCckL9/BWj F8f9BEcKMaXP21dN4gn32dawnWYL5G8Tw3ZhjRTnLligX0DnA/kpFn4GhbtXIyOqnHg3 0KNuBtDRbdz+j7hZGLF+ndVOVQUUBnWJvZ63Dbovbmp9/BvFlrbCaV68NtDYdVithPwH l6mQ== X-Gm-Message-State: AOJu0YxSDAyukYEyWV7wV5u9j4AdFD7gDTot3Dsrzq4TqxrydprObeNA 3EsAA/ELI3yuVT116NV3ABS7SOKtFvdIgDJOqRaFcxYLELGqpkbylEv5VlXzT/G3zss= X-Gm-Gg: ASbGnctzstxN3R8O9a/M1zWAyd2nKKaOztNSObFWfoeccdHP3uzmaMkW3XzD7pPxQLd lFjeyA2r1qsdjkLTv3zGxYD/JqxLSdlfPd+Lq7XlYQQfvGsL+U3fuXUpe5wL1xMGJuEydC57J7X x1Zbrj6z81ncKKmvZV3SQ+lAb3QFFA1N+gTORaVD78xlg0mQi9FNWAWLtu/vBTXddtUlEr9ELjN tHWEY15dAI+Vx/QFfRen3ASTwWwcNm++3IMTsjqMawuVyOvqkcN18ZHys67RMzqfECiOlYaTWYb jGmZmO1Z0AJX3G7YIvlpiUCI4gkKH9p9pPmRHnZLEXOLrNGv8aivpOB4jK23X8xmt3DIuEpihty YWtXNKPVORRVwOXFaj7Rs2+Fob8iZz+7pVtLWvLnlENsihe2vEFFRgVkB6gZ8GTyBEtUELHWb6q JX X-Google-Smtp-Source: AGHT+IETFUh2d3vD8OThvnMjx1hIP5HdZnugjt/d0SGX5H7cOvGE1K4zsZCRLkc9B6M5hMN7xsP63g== X-Received: by 2002:a17:906:6a0e:b0:b6d:5f52:eee8 with SMTP id a640c23a62f3a-b703d33aa3fmr332009966b.29.1761753047799; Wed, 29 Oct 2025 08:50:47 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Thomas Huth Subject: [PULL 01/35] ci: clean-up remaining bits of armhf builds. Date: Wed, 29 Oct 2025 15:50:10 +0000 Message-ID: <20251029155045.257802-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753108395158500 We no longer need to support 32 bit builds and we missed this while cleaning up. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-ID: <20251027110344.2289945-2-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/docs/devel/testing/ci-jobs.rst.inc b/docs/devel/testing/ci-job= s.rst.inc index f1c541cc25b..b92d372a0a9 100644 --- a/docs/devel/testing/ci-jobs.rst.inc +++ b/docs/devel/testing/ci-jobs.rst.inc @@ -168,13 +168,6 @@ If you've got access to an aarch64 host that can be us= ed as a gitlab-CI runner, you can set this variable to enable the tests that require this kind of host. The runner should be tagged with "aarch64". =20 -AARCH32_RUNNER_AVAILABLE -~~~~~~~~~~~~~~~~~~~~~~~~ -If you've got access to an armhf host or an arch64 host that can run -aarch32 EL0 code to be used as a gitlab-CI runner, you can set this -variable to enable the tests that require this kind of host. The -runner should be tagged with "aarch32". - S390X_RUNNER_AVAILABLE ~~~~~~~~~~~~~~~~~~~~~~ If you've got access to an IBM Z host that can be used as a gitlab-CI diff --git a/scripts/ci/setup/ubuntu/build-environment.yml b/scripts/ci/set= up/ubuntu/build-environment.yml index 0f8ec5fab04..1c517c74f74 100644 --- a/scripts/ci/setup/ubuntu/build-environment.yml +++ b/scripts/ci/setup/ubuntu/build-environment.yml @@ -19,12 +19,6 @@ - '((ansible_version.major =3D=3D 2) and (ansible_version.minor = >=3D 8)) or (ansible_version.major >=3D 3)' msg: "Unsuitable ansible version, please use version 2.8.0 or late= r" =20 - - name: Add armhf foreign architecture to aarch64 hosts - command: dpkg --add-architecture armhf - when: - - ansible_facts['distribution'] =3D=3D 'Ubuntu' - - ansible_facts['architecture'] =3D=3D 'aarch64' - - name: Update apt cache / upgrade packages via apt apt: update_cache: yes --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753103; cv=none; d=zohomail.com; s=zohoarc; b=cpY385Chl/Z3AiSWQWZ4eWZC+kmF6s56i5HU8tHueKc5FtwrLNJ0FFBpuRJ3M1Jtq4+VGhBCINOz2NpDNk1jOF14cFFRW76kLK96zIgWsK+bS+lfYrgb6yX4NHqclvo7eewyUMF+QLOHY6vmZpxocCSNqmXEfTmnr35cmTenzsc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753103; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=csF8Zps1zGkSY9AlSeNCixo/R7NZrugkFKozd2LXLyQ=; b=YcnqvpPFl0HAzX5MNg9ueCrY2KbJ5lJwmMOkuSfO+zye5fSnEUP5OF54iBBLnXMZbUH3YaY6nZyHE16iywnXcs8meGOOpwm0sTyutjf6SG28R9p5jI6pEjgon4bpMWuvqrHQbvcvaDVWb2c+n12GPnJmcnIiOMukVxZ3kEilwXA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753103573403.7445219669436; Wed, 29 Oct 2025 08:51:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8Rz-0003ze-En; Wed, 29 Oct 2025 11:51:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8Ru-0003yj-6E for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:50:58 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8Rq-0002rh-Em for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:50:57 -0400 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-6399328ff1fso12649795a12.0 for ; Wed, 29 Oct 2025 08:50:50 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-63e7ef6be28sm12298752a12.2.2025.10.29.08.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:46 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 136115F929; Wed, 29 Oct 2025 15:50:46 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753047; x=1762357847; 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=csF8Zps1zGkSY9AlSeNCixo/R7NZrugkFKozd2LXLyQ=; b=ZfnH7BQZKGcXrRtczi1C4KZPbxGZMsSU4EoHq7FQuaUl7J9r05joTIxNBYzPlcN3D5 CeGG9mA/FE0qi44IJKa4B6qptXwvBoxO26cQtPgeq6qow33cIYWoWQsVx4o/3E6c50MN r9+xS0wJwPf3brKAD9huPWqt6NQ5JStTGtIZX8r7IbGdHv1yiFctiFEAr6IemmzvWzHi D60ZEHCzcMkDP0Z4LEr/B+PzgFwTZHlswayPh6gxbTeo4W81NE1QykFKl5KnLbqgSme0 nTDVfLpE1oQSdw7nEJgUzpaRmFDuhkJtd7uzA7svJ7SXo2DAFgWo5t0GWCcelpkQbKCi isYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753047; x=1762357847; 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=csF8Zps1zGkSY9AlSeNCixo/R7NZrugkFKozd2LXLyQ=; b=FLpVJ0BaDmOJmFw3ijJBIXYbO54J6BP68GkyE46MSjtfFVnTi0Vt27yWZrTKeENiat LoIGX1rNo7dSn3TLzpDOscqzsw8mbumi6zI0HZM/rkEDXNAaBds3qIubxA4xFkIWxrek PZ609LhF3uKcNPt/k4mo6q4XzfnM2f8XbFEnScTZkzQfioQr14TGl8APvb75ePMIEHPu xAhqTrn7ibmUyPEnbpcClQOy7hForQ+YwkU0H+ka07z8dV9ij1E3PLbwdFiRo/P/q/1o mo+idd8VdpCgNCUkWKWkvxzcRPT9f6pQyNyMIAP2MmwRspwjZdOOjqhjNSXyGRCYHPUD UzEA== X-Gm-Message-State: AOJu0Yx74m2Jw8q6YhwDsu8DrBi7OgHmeHyWpQ1N5kqgAA/I+niMfSCE mZky8F63yoa8I4rJHks2izn4A73snOGo1TV//goBnbvvdqsXGpqdg+YwRxnBrEn3jM4= X-Gm-Gg: ASbGnctfd4RnN/uQWPBvw82YJC2AqOrhWY3svK5t+OvXUH+VRtE/DVZV62YLSdSkkIF 5hx0JRq5Bsc48tavll1gB1ic3yjMOb52RxtV72hd9xGawpUWFh5Q894xCs1TjNeEBm7WHt2Aln3 8Eq8/CxupaRA+OM0YbdPoOkS3t91mBON3l9ZEEr8C1LMzEM4Frx+xNkfbm5JdIx0799zt/2Yg5X xe26iWRc31wQOo9a0+BbaIEWZEz8gYnl23xmMD4/beLYWB2PdrFK3zDmETNDUnX2mHV8RLMYWPW mtTOZydLw1MtoPmP0eL4U9VwwIv+i4NcEBRGFmUyE6tt54nikIdgomn1gMU/UpRzVX6nDUcINzN SemjcNSogszRLoC1gPMNZeh71dRC8+HTiUrYH6pjJNhaf/EnswpBJjV0wTE8Y6I6TEk2JhFWj7k zV X-Google-Smtp-Source: AGHT+IG+KkX9ET7a6j+8q6rVA81D1eD8DmFC2ZsGDOJan6vuPoIPgM8zNyNO+79TaIPKTPZD+cTSzg== X-Received: by 2002:a05:6402:50ca:b0:63e:600b:bc86 with SMTP id 4fb4d7f45d1cf-640441a9b44mr2661907a12.14.1761753047423; Wed, 29 Oct 2025 08:50:47 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Manos Pitsidianakis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth Subject: [PULL 02/35] scripts/ci/setup: regenerate yaml Date: Wed, 29 Oct 2025 15:50:11 +0000 Message-ID: <20251029155045.257802-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753105056154100 We inadvertently updated the base libvirt-ci project which has resulted in changes. Make sure the output matches what we generate. Fixes: 0d4fb8f746d (configure: set the bindgen cross target) Reviewed-by: Manos Pitsidianakis Message-ID: <20251027110344.2289945-3-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/scripts/ci/setup/ubuntu/ubuntu-2404-aarch64.yaml b/scripts/ci/= setup/ubuntu/ubuntu-2404-aarch64.yaml index ce632d97108..70063db198e 100644 --- a/scripts/ci/setup/ubuntu/ubuntu-2404-aarch64.yaml +++ b/scripts/ci/setup/ubuntu/ubuntu-2404-aarch64.yaml @@ -26,7 +26,7 @@ packages: - git - hostname - libaio-dev - - libasan6 + - libasan8 - libasound2-dev - libattr1-dev - libbpf-dev @@ -37,7 +37,7 @@ packages: - libcap-ng-dev - libcapstone-dev - libcbor-dev - - libclang-dev + - libclang-rt-dev - libcmocka-dev - libcurl4-gnutls-dev - libdaxctl-dev diff --git a/scripts/ci/setup/ubuntu/ubuntu-2404-s390x.yaml b/scripts/ci/se= tup/ubuntu/ubuntu-2404-s390x.yaml index f45f75c9602..4f1a49be34a 100644 --- a/scripts/ci/setup/ubuntu/ubuntu-2404-s390x.yaml +++ b/scripts/ci/setup/ubuntu/ubuntu-2404-s390x.yaml @@ -26,7 +26,7 @@ packages: - git - hostname - libaio-dev - - libasan6 + - libasan8 - libasound2-dev - libattr1-dev - libbpf-dev @@ -37,7 +37,7 @@ packages: - libcap-ng-dev - libcapstone-dev - libcbor-dev - - libclang-dev + - libclang-rt-dev - libcmocka-dev - libcurl4-gnutls-dev - libdaxctl-dev --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753433; cv=none; d=zohomail.com; s=zohoarc; b=jm3ttNIJEmcgIaNPpOlTkFOct3Jbkxlpl299X0VUqoVLNkQEp4cU4K3xkvi46nikLZpiz2ZOUfD+OlskeHPcpRNyLjHmBFwTj/gIH7hgUw0uSiQW+UYatsuoQ7rNQYE2YGqIWxd3etUh6VkIe6E8v7+T7spbJY7Buoa/cQR/yMU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753433; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Tp9uc4NfmWDvr0PUctvJtnAF7CDE8AZuaPcb/KS1+g4=; b=EuxYaFceUPYMLiSdTbSV/HLnWG6NffbCN3HQHQPYQdFLqU8Sguyk2Cc3t/c3eC7npoEBPpG+pZOIye0I0RfQp847c4GMdreSpKk4hw6Xh3JZNW7KCpVe9l8Dvwh25oUvRwpdVQDQr8+Ku7QZ8XdRu6R2nVQwI0SyWb0wd1EnpJc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753433382932.6835114752806; Wed, 29 Oct 2025 08:57:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8S7-000446-3p; Wed, 29 Oct 2025 11:51:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8S3-00041A-Nb for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:09 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8Rs-0002sA-EN for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:05 -0400 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-b3d196b7eeeso6367366b.0 for ; Wed, 29 Oct 2025 08:50:53 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d853f98adsm1436225766b.49.2025.10.29.08.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:46 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 285045F92F; Wed, 29 Oct 2025 15:50:46 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753050; x=1762357850; 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=Tp9uc4NfmWDvr0PUctvJtnAF7CDE8AZuaPcb/KS1+g4=; b=UOy6phT9ZwlA5ct1uBN/iG+mhH38CL1tjw65+7ny1b8E6PXon1PI8hCOA0wqqsRntC zjYmulp5kEAbybdzVNCR3HE1oryrWkLVaRdwYLnFJ+/ZVxrXuT3rU5bUUkqoOoT/nD65 togRi287sFR6HfAObY72UftiWNgopcbU+CswuZk4+roLF7lL89F9l2wuLYPgu8jXqRrk jJc0icQqkkY01jyxJmwKBajHTacCReTOpFRhWxxItVJTqmYhKkqQwwI7n07TQLNA70lD 7bIusClVcT8SOqOZD6bZFU3UEvDWEct9fipM5DmAkzXx2K4kQXvrMAsKIATeouaQu+Zy pXBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753050; x=1762357850; 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=Tp9uc4NfmWDvr0PUctvJtnAF7CDE8AZuaPcb/KS1+g4=; b=Yi5g+vEAMimZCYdssWbY0fL6P4Czs3/qni2K/wjYun6PfSUNM/06LvZ/myAauFkhY3 KrodUv+N3Nv0ul/WrpepE8/dqaF4WsbEjmM90Uke85kHQecid1dJ7x7XkbHzLiuaTwAj wx8wDFevYYM4Z10v7gXo0Vc7Gou+ZtNNsyAyCArKmBdJc+2WOX9oHuToH/+DZOAjsG08 nRg7wLipRcdpzvJz5aae5FnDiujTLqBHcZJRrdnemnCusDw1dHgA6rIvYwHNV2QKsScv W5wrDqAigvGeT3AAfRPQzFny+K0CjitKUUTAgFFo7UPbYGjv3ZsT3DZRYvGqtaG7+GDw 74Cg== X-Gm-Message-State: AOJu0YxnHJJLaqFBNE+3PiO53rXfZ9PEZJIEPd9vNJtCmEcilVqPlnjI 8UUkLItb4o99//IC/dWvPZnPx+yZY9IQmVexwdz85IPvla59cVIOagJgtPjL1WkqAAs= X-Gm-Gg: ASbGncuoKFX1tlUTeynyVTurMqdT6AHQvSBDEkCB2QUUZ/F0qun9wAoPv+wR2OtpSnF DxjkETQt156UPRqLcfTId8UcxTEAXIO+h4X46Jw8xT/7UiDUXNJeGypK5eoLzJrQMwUtnZRIo2n MaJyjyhLERS+cw7kZ4H0u9b5ZslAADuH4XlFs3UN6f6X7DH8qBZhD0haFT1ZHu5jNw3ln9vrUm4 tgBVg/MFERQN9C/35A6EP5ljzTaatU7S6MxotFzS7/gmDOfnK1/4zPJnyDOdG6W520iem2doS7j 5bqQVvXQsnCR3E5Koo/U6TZgDlyftBlfuEQ2agq8df9/7mTmuVqN+WfS9ceOTNoT2yK0fjN/N31 qbXmjZe9jwyFd9ZnURH6nH26hOKD+k6Q42yjUcY7rFBWlv34CB7ahCt+NhCWfdD+aMWPfYspIJk Ud X-Google-Smtp-Source: AGHT+IEcoPm+8umaacXTGKLFAevzgxBC3rhPG/WhLN5vbSpUff4wkt4u0rmE29YP8Wn4gWRSTg+pJg== X-Received: by 2002:a17:907:728d:b0:b6d:5aac:5062 with SMTP id a640c23a62f3a-b703d31503dmr348378866b.14.1761753049865; Wed, 29 Oct 2025 08:50:49 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Manos Pitsidianakis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth Subject: [PULL 03/35] scripts/ci: move build-environment.yaml up a level Date: Wed, 29 Oct 2025 15:50:12 +0000 Message-ID: <20251029155045.257802-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753433656158500 We can share the setup of the build environment with multiple operating systems as we just need to check the YAML for each env is present in the directory structure. Reviewed-by: Manos Pitsidianakis Message-ID: <20251027110344.2289945-4-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/scripts/ci/setup/ubuntu/build-environment.yml b/scripts/ci/set= up/build-environment.yml similarity index 81% rename from scripts/ci/setup/ubuntu/build-environment.yml rename to scripts/ci/setup/build-environment.yml index 1c517c74f74..66bde188755 100644 --- a/scripts/ci/setup/ubuntu/build-environment.yml +++ b/scripts/ci/setup/build-environment.yml @@ -27,18 +27,24 @@ - ansible_facts['distribution'] =3D=3D 'Ubuntu' =20 # the package lists are updated by "make lcitool-refresh" - - name: Include package lists based on OS and architecture - include_vars: - file: "ubuntu-2404-{{ ansible_facts['architecture'] }}.yaml" + - name: Define package list file path + set_fact: + package_file: "ubuntu/ubuntu-2404-{{ ansible_facts['architecture']= }}.yaml" when: - ansible_facts['distribution'] =3D=3D 'Ubuntu' - ansible_facts['distribution_version'] =3D=3D '24.04' =20 + - name: Include package lists based on OS and architecture + include_vars: + file: "{{ package_file }}" + when: + - package_file is exists + - name: Install packages for QEMU on Ubuntu 24.04 package: name: "{{ packages }}" when: - - ansible_facts['distribution'] =3D=3D 'Ubuntu' - - ansible_facts['distribution_version'] =3D=3D '24.04' + - package_file is exists + - packages is defined =20 =20 --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753220; cv=none; d=zohomail.com; s=zohoarc; b=MR9UaDwu8p8sflDw34gsqWGKRSd5hgQjBuRDZDFdB3EL0pZTZC6LBAbwe0sK7c+9KKJNFZ1BGcl1/AYq9cCs4Bn7xFrGwJkADqKK8sPinmkhSDlolZdEAiNVuXcbG2W+Eg6vaRxnorDztXBpMSvaz8bGf87/zG7kmG6LnSbk/Jw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753220; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hu+xToBwuzqdEh5e7QygWn/gh6d7IcoBc8Yowdh0cMI=; b=l9rHpA62fi7mTIYNHEdW81JtxkqoMtPOVv8eAtCZFSLLrPifPcU9sJjeRo+6LumRGaHV88pgfqs+zvwk26uRrFa+fEStCO7gbMEF6/unfCbCarXG5clD0W88Gocvc7eIELJUOwH7YEZli9U5LtbxtPVgj2s8pq77zlhxBlW3TU0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753220946804.8404582762722; Wed, 29 Oct 2025 08:53:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8S5-00042v-SA; Wed, 29 Oct 2025 11:51:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8S0-00040i-SO for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:04 -0400 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8Rr-0002sN-Io for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:04 -0400 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-b4f323cf89bso2896966b.2 for ; Wed, 29 Oct 2025 08:50:52 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d8530905dsm1461341566b.6.2025.10.29.08.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:46 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 3EB1B5F9E0; Wed, 29 Oct 2025 15:50:46 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753050; x=1762357850; 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=hu+xToBwuzqdEh5e7QygWn/gh6d7IcoBc8Yowdh0cMI=; b=TUs6olxYW87ft+yZ0qCg4D1N6NVzwmaPZJ6j62qF3rHzb1iCBuFBHWafkjAPOEzgvH CxEM8tQlm1nsj+6IvE/oFm/jwoaZpOxxEe5W62mcMZ4tbbS/qnYy3B+hCEt5CAI69gYS IYlG9lzN17JPhf7r8/G10oxsPhYfylOwdEaLnJr2FIX68ZDLbm/nPuoaY5AW9uVqR0KT ZkC9HvIdxFzy1Mpzh9NoPBAUYQewBy6m+G/rWk1EyCfLwcvwSRwjllIkkpVm53j5uWRL vLMJx/ebOrU/FbS6m+EVn37ooyqaSkIVorPAn1N7ictzJJkYt5ERYAMb0edFYyN8QAa+ G6hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753050; x=1762357850; 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=hu+xToBwuzqdEh5e7QygWn/gh6d7IcoBc8Yowdh0cMI=; b=Jz1f3jrVwq1L1r4BB+9jgpFOVcL0YmgjgaZ5jxrB12sQizz/cGkawAcdxfy0enLLhY Yjbwgo49RvtMae21RF25QOSrPgyIIZNaI+/c842lANq3pFafzTmqlUH5g6MnXPoMFrUy VLdh7q4yOTa5SDuVJlYYayFVe0DBvuV0mVrrVgVgL9H77hrpCX9TEew9ECwidNe5utLE 7JCiqEWbb2HnYuNkV/nH2BaHjOtEDBPkFPwsb8NKSE6fE1GU8cLJCU6EqFvXTgsGqc/h m/NtsJlIIwexlO2226V42QScpQ4ssyOg348atWzg5/jlXHJtrM3p0S4rKIS/F8w6U464 kYDg== X-Gm-Message-State: AOJu0Yw3vHjexzxYGfBEjtG+XPTnI3ioDPgJCRuEKU83FKE0Dw9Vlb0w nlpMEzSqqaYKRmGTU1nZRXEcm615V3/E+FSWeJwZ4rHXqSjwp1gOZRohPxWPVGVkh4o= X-Gm-Gg: ASbGncviT/A3kGKMoMAn6toPxiheFfDp6Qyn9i6Ot4n/QR53C6a6PWPqI1HA2YDjywW R8vLwJ5igB60TQ2e7dDiql5sv1ckjiDTERv/t/xOCZhnaOi7JBa4Jwo009uSxC4j6lHn+TC/XJN Fwh/2IIterjIv+96EnKA8WyRpyHCoCnuub9UIVEkS0BPt3EI4+gfMR819SXSqmaNTrlElANfrvw IC3xYdDZnVTX8n7UJboOF6mgdK9A23ksbRVgp2wunkbj8FIkyI/4eExhfef4eEOWc/sYhruLmA6 p1ErAH+Ama1DWtB3U0cqmi/yRFJxRHR5yqbb5VfOt52gpypXmIDEb5Bin0StNJOPfMBT261N53B CTKlJ7wTvj7paNwmmZtty3D21tgCF5xEiyOMl31++HN27GYOPaEJiByoijgvKZhvsZ9mHYYhza1 iX X-Google-Smtp-Source: AGHT+IEoYqd6LgOTMjS+K4kXHYqappYM/LD/Cev18VsgsBQTKFQlotL9UEmjY6uQPSEG1WNjOgfprQ== X-Received: by 2002:a17:907:a03:b0:b2d:e514:5348 with SMTP id a640c23a62f3a-b703d4ae452mr340573266b.33.1761753050347; Wed, 29 Oct 2025 08:50:50 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Manos Pitsidianakis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth Subject: [PULL 04/35] scripts/ci: allow both Ubuntu or Debian to run upgrade Date: Wed, 29 Oct 2025 15:50:13 +0000 Message-ID: <20251029155045.257802-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753221969154100 There is no practical difference between the systems when it comes to updating the installed system. Reviewed-by: Manos Pitsidianakis Message-ID: <20251027110344.2289945-5-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/scripts/ci/setup/build-environment.yml b/scripts/ci/setup/buil= d-environment.yml index 66bde188755..253d0b759bc 100644 --- a/scripts/ci/setup/build-environment.yml +++ b/scripts/ci/setup/build-environment.yml @@ -24,7 +24,7 @@ update_cache: yes upgrade: yes when: - - ansible_facts['distribution'] =3D=3D 'Ubuntu' + - ansible_facts['distribution'] in ['Ubuntu', 'Debian'] =20 # the package lists are updated by "make lcitool-refresh" - name: Define package list file path --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753351; cv=none; d=zohomail.com; s=zohoarc; b=BiptVRgh4EswxsvTsWPu30q+aq+yqqrpqxS4FH5EMS77GgiyUMfGv795o07JtQVIYWAjwwnXamgRk8tj3I69l8dNm5xkiaC8ETKTGmyrF1cTyZhIOL//BPwld3sTqdMBe44VMtp3/V61Zk6xN5ZYQ8gVmNEBojXF8R4BdzBP39A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753351; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=USJvroAe4YWNpWWacUbn1WFtugDBkJmsxwDxe+5+ZlI=; b=BUiRrRYnVtr6shcKDGs/hOvL26B02N5D/bsGBJbdAgiOMEtABGCA8Wj0JyFzztbgukr3n6UEKFcQJ7CfrOAvYtk41FfKYOPNdDDk5VYiVDScjZvC4fYZ9BY8KMvpufL6EyfbkLlXVxnUHuQ6KnX4V8Kp96XpaBtPLPxUYci02Q4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753351012975.9821540569213; Wed, 29 Oct 2025 08:55:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8S7-000444-2C; Wed, 29 Oct 2025 11:51:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8S4-00042O-Hi for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:08 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8Rw-0002sm-9A for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:08 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-b6d3effe106so2709766b.2 for ; Wed, 29 Oct 2025 08:50:56 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d8544c9f5sm1491873866b.68.2025.10.29.08.50.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:50 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 55E885FA07; Wed, 29 Oct 2025 15:50:46 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753053; x=1762357853; 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=USJvroAe4YWNpWWacUbn1WFtugDBkJmsxwDxe+5+ZlI=; b=alE8cmqAm0y2zJ99Qm3OzX+ADub8/S481Xr1m6dvjLunFY9oJT7N/zBmr8NdkBtp9T xSHiyKPJjaTX86gepXhRmW1w50ghHaIbgbcBXycFcROyMzcDHS8scUj35SqbJMGX9Khf rRBOW9Nix5zHmJt54aJ0n4VctJsw7c8+gttfEiB0i8Y/YE4Uocf7gKXbjwzfo8YPZqyn CFHKdfoVVnPTyz1/LuCzvKXuOaUVorISHVWxVJyWJOVofsgkKBbP0+I35SXjTikjg1+O +8znR+S2Upg3ix8Ezzg6Ivv+VTzZTwX50ekhHRcg3grqI18chVHTGd/p5M0ky5+dz8Na GdKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753053; x=1762357853; 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=USJvroAe4YWNpWWacUbn1WFtugDBkJmsxwDxe+5+ZlI=; b=YTgOn/tXRMDUXyZ/WfRGYxAjF5FfxYK6pCXvrFQMMxrMnBN1UU1xABPR9oJF4QiFm4 XCt2mUnUmhOeMZ7MT1Mhkf/ZAZfRyFyk8sQAhaRG4YWlGsdajYzVcJhIU3nyOBlAE7vU DqU/SpYhsCQkEFNXbAEkhSM8DzmVWNNCZyFJvBqls4L91X6uWUGZDPlFuByyVhSdNhXJ BKgyoiM8BfWC2vcD313Q7+V2E723VOJyJy9QOX8RwTr1R47g6FeDAjHjms/rclohpd75 4b3KRREoXPQZo8yBZC4K03rLWdoUG+pfIptkRJHvUuqHWp9qsattwtDBDI7/nT03zakL Pu2w== X-Gm-Message-State: AOJu0YyZErc0Xtl1mLmnvWsIL4irGl2ojrG0LEQoPLpMNEOwRBzrCv9W 1T/uMTwwNNaJYHR0RxHaiNLMo4LsNWTE1P2JCtTn0Z2LwvVIetHTM7rQ9B/DSdC57pA= X-Gm-Gg: ASbGnctckmL5hFFNAxi5y9hzG18zmNW79WCT0x9xlfQ3iFGMZTOaSFstNY+/KlRmq3T J88rusq4bfW2D0M1NkJzFAKT/P7WpOD6wNq+qtoCOdzX15iE9yrviLaAFj4i+J9hdTf0iN7zXSY 76uZfWil72XC+GfsVMvKrcLvAeaCjrzmZzn1S6eSPwXCbGxu92kjM4yHP00SSJ2XBd8SE1UHPYz rTvmdf7CN/q5RvH8EPnI3axoW+IYlS43xKgGs3VDwII9+X1odwmplpVMPNiFxpbnyCyBl/S91qs udUXX1IybQmFCYOEcXckuiuHm3K1EsCjcN7XBPnYuGdVrmsPGUUGXrZT61MqnOwlGE2oW8MqxqT T5TupHnPsxczGRyuXD6Y2MFvyszoA5k725lIfNkW7ZSJtJhGireL4lSac/s4FoPRWeDExLcBHjN IR X-Google-Smtp-Source: AGHT+IGAqDWLjgWlwMFTIOzzzLbG1vlfcPUaNxsOWBLbs3eIDXXUKclPUj4i/E9pZlSgZUjCwAPJvg== X-Received: by 2002:a17:907:7292:b0:b33:a2ef:c7 with SMTP id a640c23a62f3a-b703d5cb7efmr387845066b.55.1761753053058; Wed, 29 Oct 2025 08:50:53 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Manos Pitsidianakis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth Subject: [PULL 05/35] tests/lcitool: generate a yaml file for the ppc64le runner Date: Wed, 29 Oct 2025 15:50:14 +0000 Message-ID: <20251029155045.257802-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753352789158500 Unlike the Aarch64 runners this comes with pure Debian out of the box. We need a minor tweak to build-environment to deal with the differences in naming convention. Reviewed-by: Manos Pitsidianakis Message-ID: <20251027110344.2289945-6-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/scripts/ci/setup/build-environment.yml b/scripts/ci/setup/buil= d-environment.yml index 253d0b759bc..528150dce78 100644 --- a/scripts/ci/setup/build-environment.yml +++ b/scripts/ci/setup/build-environment.yml @@ -27,20 +27,26 @@ - ansible_facts['distribution'] in ['Ubuntu', 'Debian'] =20 # the package lists are updated by "make lcitool-refresh" - - name: Define package list file path + - name: Define package list file path for Ubuntu set_fact: package_file: "ubuntu/ubuntu-2404-{{ ansible_facts['architecture']= }}.yaml" when: - ansible_facts['distribution'] =3D=3D 'Ubuntu' - ansible_facts['distribution_version'] =3D=3D '24.04' =20 + - name: Define package list file path for Debian + set_fact: + package_file: "debian/debian-{{ ansible_facts['distribution_major_= version'] }}-{{ ansible_facts['architecture'] }}.yaml" + when: + - ansible_facts['distribution'] =3D=3D 'Debian' + - name: Include package lists based on OS and architecture include_vars: file: "{{ package_file }}" when: - package_file is exists =20 - - name: Install packages for QEMU on Ubuntu 24.04 + - name: Install packages for QEMU on Ubuntu/Debian package: name: "{{ packages }}" when: diff --git a/scripts/ci/setup/debian/debian-13-ppc64le.yaml b/scripts/ci/se= tup/debian/debian-13-ppc64le.yaml new file mode 100644 index 00000000000..e29c9c18403 --- /dev/null +++ b/scripts/ci/setup/debian/debian-13-ppc64le.yaml @@ -0,0 +1,134 @@ +# THIS FILE WAS AUTO-GENERATED +# +# $ lcitool variables --host-arch ppc64le debian-13 qemu +# +# https://gitlab.com/libvirt/libvirt-ci + +packages: + - bash + - bc + - bindgen + - bison + - bsdextrautils + - bzip2 + - ca-certificates + - ccache + - clang + - dbus + - debianutils + - diffutils + - exuberant-ctags + - findutils + - flex + - gcc + - gcovr + - gettext + - git + - hostname + - libaio-dev + - libasan8 + - libasound2-dev + - libattr1-dev + - libbpf-dev + - libbrlapi-dev + - libbz2-dev + - libc6-dev + - libcacard-dev + - libcap-ng-dev + - libcapstone-dev + - libcbor-dev + - libclang-rt-dev + - libcmocka-dev + - libcurl4-gnutls-dev + - libdaxctl-dev + - libdrm-dev + - libepoxy-dev + - libfdt-dev + - libffi-dev + - libfuse3-dev + - libgbm-dev + - libgcrypt20-dev + - libglib2.0-dev + - libglusterfs-dev + - libgnutls28-dev + - libgtk-3-dev + - libgtk-vnc-2.0-dev + - libibverbs-dev + - libiscsi-dev + - libjemalloc-dev + - libjpeg62-turbo-dev + - libjson-c-dev + - liblttng-ust-dev + - liblzo2-dev + - libncursesw5-dev + - libnfs-dev + - libnuma-dev + - libpam0g-dev + - libpcre2-dev + - libpipewire-0.3-dev + - libpixman-1-dev + - libpng-dev + - libpulse-dev + - librbd-dev + - librdmacm-dev + - libsasl2-dev + - libsdl2-dev + - libsdl2-image-dev + - libseccomp-dev + - libselinux1-dev + - libslirp-dev + - libsnappy-dev + - libsndio-dev + - libspice-protocol-dev + - libspice-server-dev + - libssh-dev + - libstd-rust-dev + - libsystemd-dev + - libtasn1-6-dev + - libubsan1 + - libudev-dev + - liburing-dev + - libusb-1.0-0-dev + - libusbredirhost-dev + - libvdeplug-dev + - libvirglrenderer-dev + - libvte-2.91-dev + - libxdp-dev + - libzstd-dev + - llvm + - locales + - make + - mtools + - multipath-tools + - ncat + - nettle-dev + - ninja-build + - openssh-client + - pkgconf + - python3 + - python3-numpy + - python3-opencv + - python3-pillow + - python3-pip + - python3-setuptools + - python3-sphinx + - python3-sphinx-rtd-theme + - python3-tomli + - python3-venv + - python3-wheel + - python3-yaml + - rpm2cpio + - rustc + - sed + - socat + - sparse + - swtpm + - systemtap-sdt-dev + - tar + - tesseract-ocr + - tesseract-ocr-eng + - vulkan-tools + - xorriso + - zlib1g-dev + - zstd + diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh index 056cfb6e9d7..7fbdf6f340b 100755 --- a/tests/lcitool/refresh +++ b/tests/lcitool/refresh @@ -272,6 +272,7 @@ try: # generate_yaml("ubuntu", "ubuntu-2404", "aarch64") generate_yaml("ubuntu", "ubuntu-2404", "s390x") + generate_yaml("debian", "debian-13", "ppc64le") =20 =20 sys.exit(0) --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753110; cv=none; d=zohomail.com; s=zohoarc; b=S3r0o+tv/cyR0m76Er7R9Z/stiM2EanZjKcpZiDZhbgL3vJLETkB/Hvvw9a/5K+pn7mV1vGKeU4p6gTpB8qakrKXDC7EmO/a7d27xr4stCm39oGDU5BFuwHZ2xmhclKoN2724GbTHMVJlW764Qgihh7FGJlTSQ5FptCscNMyjgY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753110; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ni0YILoMYoLe4AZXToJB5KeJng+xXB0/01KeyPSPFl4=; b=KJuv0Hogjvk3msgYiBukGX1yntIRJd7FbG0hssAQzWUbb0N9VFY17vkQLAxuB6rBjHG4nuYaEgES3vVGXRgG0SSAOubhpNFSCUaPsDLadzh5BrD0b3GyzHiWi7VK5/I+mIDmEIDQwMskiPP3BWU3syh6xltDAMh7PHjKiQzZdkE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753110053500.4188782836105; Wed, 29 Oct 2025 08:51:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8S3-00041G-Es; Wed, 29 Oct 2025 11:51:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8S1-00040k-1G for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:05 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8Rs-0002sP-Aa for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:04 -0400 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-b3c2db014easo6765266b.0 for ; Wed, 29 Oct 2025 08:50:54 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6db1c84813sm822459366b.19.2025.10.29.08.50.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:50 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6D56C5FAA7; Wed, 29 Oct 2025 15:50:46 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753051; x=1762357851; 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=Ni0YILoMYoLe4AZXToJB5KeJng+xXB0/01KeyPSPFl4=; b=A5Da82Pnq6NBZIDcYVhrJ/fU4BWKWM0pkY8TRMOagPljIJXpRfbrfgR85qEEOP5tPB 8RnmbfTTqmQU2dgiGCZARK7vBAaBf9r/y0VeMs+1Y9edLUWRy7X+gt1lA0ZqqZQce7PK UwecWR1TIUp1QLSPyt4ULaDVuuPldXpFv0YQqGcoCevz8Lx7SR1BPqwVWKr95Xsbnpcr ygMWhT1FymjWL4FQ1hUW8hzaE0DFKHY3C/F6A/J2XUI0iRjwIiOPTxxPuue9ch4l85CB dBet9v49wXJHRhBuD3E3t1sPgLX0fN8VQQAaoENjv61fuIHXXbcNrzf1awXd4CUiL5MU DHyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753051; x=1762357851; 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=Ni0YILoMYoLe4AZXToJB5KeJng+xXB0/01KeyPSPFl4=; b=uADf2WKJEA/FXXGbzn44t798mhB7HZFejniZ1FLI6GCNM70Ijc6e66OIdL0FpTiPAg eU3aWUbtd2XO8I0yndldJlVs5jCIo4TM8TvlprFdxYXWfTipAu5/uXGa1KmI6lOeB6QI 7f0Yn/P0Od0EBq6jX/Z88xyQsVqdKuqp+TkVM5BZw9YhU++rUOxJuhDMB5f+5u8UDX+J QO3wzYvMGi9DjgJdYKX3J0BL65iCEOYQvBstgFCv0GVVXza2tvqKNnIa3dVC+bzTzbR9 bLJ6w3x3xWvF/kmPd9eYZ1ppF2e3vRFutfuEsFOGvpAPqfAvGSeNtwMT3B82HQjCdigg 3juA== X-Gm-Message-State: AOJu0YzZ5/P3plDt3UaZ6FhcrQx+zjDpDdm/xE9DTnH4V/CGI/k/MUJS pLtpYnVIRA+LUkXe1rOnZlwnqPTsSqPsceozKH3s04QeaOnKb65x+Kv1zaia8xs1zNw= X-Gm-Gg: ASbGncut7X8tpjoMAhb9xtIihXFM4pRe9rSkwKolyrGO3n93QCHhbPtuEkHkIEZz/0/ IN2bifzRO5JfwcS1KmjkkHsTo43ySqFJ+R28kXsXvdfRiiLscL4qW4kxF/nTwporMcBmuvFzb3X HnaP3SlTe70PIK5A4esCEZheGnv/73BGuc2o2YRM1BwXlbs8xsu53C27FVFvYwkRXCBmgEkkjPI kdgmCNL7KgIKcm9eRRYEtBN2iNlC7R9Fy3pDGjQn2gwT5rfb9bLiQcTLODxdRvuN639vBnLC7z+ eaYIfQwRoJt2/vwsgD/ofUBzOgafirdBE1om0hmNd4BZdCjn0P2pFzVG70abrWw2Co1slmxuivz 8lQOjmT1I0mYIegxcjYLFdcW1H2AXpkRfXKRq7gOuBag6IUkWBr5jN2wPnJsfEJFU2r+4t4RViN +JdDXOMx156W4= X-Google-Smtp-Source: AGHT+IEVmy9UpKdBnydzzuxl2QdAO2xRACEDuXrPGtCSO2QqWzKGsYxpnonRBugCiqBLgqmeuRJkqw== X-Received: by 2002:a17:907:869f:b0:b3c:896:abf5 with SMTP id a640c23a62f3a-b703d3929dcmr339212566b.25.1761753051223; Wed, 29 Oct 2025 08:50:51 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Manos Pitsidianakis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth Subject: [PULL 06/35] scripts/ci: modify gitlab runner deb setup Date: Wed, 29 Oct 2025 15:50:15 +0000 Message-ID: <20251029155045.257802-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753113995158500 Both Debian and Ubuntu are setup the same way. Reviewed-by: Manos Pitsidianakis Message-ID: <20251027110344.2289945-7-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/scripts/ci/setup/gitlab-runner.yml b/scripts/ci/setup/gitlab-r= unner.yml index 7025935487a..76aeaf4ee95 100644 --- a/scripts/ci/setup/gitlab-runner.yml +++ b/scripts/ci/setup/gitlab-runner.yml @@ -56,12 +56,12 @@ url: "https://packages.gitlab.com/install/repositories/runner/gitl= ab-runner/script.deb.sh" mode: 0755 when: - - ansible_facts['distribution'] =3D=3D 'Ubuntu' + - ansible_facts['distribution'] in ['Ubuntu', 'Debian'] =20 - name: Run gitlab-runner repo setup script (DEB) shell: "/root/script.deb.sh" when: - - ansible_facts['distribution'] =3D=3D 'Ubuntu' + - ansible_facts['distribution'] in ['Ubuntu', 'Debian'] =20 - name: Install gitlab-runner (DEB) ansible.builtin.apt: @@ -69,7 +69,7 @@ update_cache: yes state: present when: - - ansible_facts['distribution'] =3D=3D 'Ubuntu' + - ansible_facts['distribution'] in ['Ubuntu', 'Debian'] =20 # RPM setup - name: Get gitlab-runner repo setup script (RPM) --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753451; cv=none; d=zohomail.com; s=zohoarc; b=UwH8tH9K80n46N+Gf7IooGADcKBpyxXiBwgU9/BjfuYna00fQ6dMT72Rpe/PcWIVQfVUUXEcKMbTy8ZN7tCkadx+tx2lPXqgIPtpqytMpr5p7SCqKVhyZGhcgAjDnmp0x6jHDEVzK3bKlcyU8vwmCNCHBIo5jBfXnFWfJbA/clI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753451; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2Kd8waiEhdlSlAVSoCg9cTPL8dWN6kzQLSSEo6gGGq8=; b=lWUx7NXZ/OOWG943unZb/eWiWHS0lNh8NejGN4L8iPFqEl3PRIx39r9Qjgh9qDN7pIA7UkukEf/FNqJhIy7wGOGti7VR9htOzMBJHevLbHckk0jkZFSMtCqisizjdPMuJ+3HSB5MptM7iYAg0QHpZYqlC5JWoZEdx1hzNarjLoc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753451120664.6887187065353; Wed, 29 Oct 2025 08:57:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8SA-00044x-F0; Wed, 29 Oct 2025 11:51:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8S5-00041q-2T for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:09 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8Rs-0002sk-JG for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:05 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-b6d3effe106so2704866b.2 for ; Wed, 29 Oct 2025 08:50:55 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6da1e2226fsm1058027266b.20.2025.10.29.08.50.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:50 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 851835FAD0; Wed, 29 Oct 2025 15:50:46 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753053; x=1762357853; 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=2Kd8waiEhdlSlAVSoCg9cTPL8dWN6kzQLSSEo6gGGq8=; b=rpl+3WuIuW71LvxTyMqVTe7epZ3PkigkrnoL0BT3eSDZej3iq94MAivyyy4SDxJyzD l4xYfrbUCbFyMouvbKkqwbW5BFH8Twb5q8xQt0VZvvW+q7xlL4hpvDTz6CwQQqcSTajT L61/QqlUu4j5IKXoGeU2F0DmWjgd9bHYTvdIzTJorphgio32BveaQUhZMjui0QEPmXGp 20xPnzheBBXvjNWUcvzgAQ2yXTut31X7yeQ/QWY2/sVlD7hjjoCtqJck18EiEi1lKk0/ RXNSq8eQcD1lZHp7HpmbNZPLdI5t1sPl/NykuYFBbqlQvSSzM7B+euYTKg4W+CIErOWD XH0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753053; x=1762357853; 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=2Kd8waiEhdlSlAVSoCg9cTPL8dWN6kzQLSSEo6gGGq8=; b=LJeFmK9bOZRMBr8nuKxkQbPKEq1aSfOvujoTOdEmlbNPmdA4zp3iuHqM2j+edBA0qp 1jBiRKy8XX6vt3yBYZGd0oe0aPEpoFzxvARUDmU76xE4NRVjihqmVdt4y2mrCrzUTYdg p2qqnaBTu61R173V/eeG5rXRm2Rs3qYtg6cGLZfNJYJvWTbZlYmR80j0F5YzMMD7u9ar 4D5BHqGlXvEDjxJ6ykr9IADNMQazpJZa00Z9dGWN0qJGlyb6G39RLz6CnNCiA1/iyKod nQpYrspxcgwrC990r0PFGO39eoS5ZzgQrMMFEpl53dJWFY9hz071ayA/mIFvCNOm2021 87gQ== X-Gm-Message-State: AOJu0Yyh0CxxElUB6h5B9hUIsj9Gpey/YLlLEmtPLJCW9wq6Wgt7lWp6 Jwr11N5mVlU57GerGlCCKtAWNba7vgZBnsDj0XM458v0jvt/mMoIAvD8yt/v9GEnt4Y= X-Gm-Gg: ASbGncs/LOguuSQFiRxXObDa2kWtxDLUzgyYqm8RcWC2FGu7xKbEcumAoihOWI7KY8s 2UxhnQoF7FTnsIg6fNBY8+kIrr8TJxU6yJBR4tpgHO1myWKUqP1gzYPdROkKmel+Aw1osJcC2eT IZvyiHaZ2QAf+iM17L8SNTURJt0sEDTV3Ao6t0SWWx8cR8/qmxmeUuxAqyCOxcnS0BmnhiZ93jD I3kXMYDfOvq0OkICnznyB46IiGWESXfzJo/fy+VdXy0lMEs5xN5zXKL+nrSBnZy4lCj5omV24rg gcBAcv8PYKDLKkKspeQ7mW1lhY/mZSQ2gZbT5Ate8fgL2kl5mA2Slnr/f+TBLVpX3almGUw21Sj f3pp/ZAwYkRtYWvRH/z5FEJelhfwrtoJd0qMwssnkSeK5c3nYSuoiyb5r9LJ2wRB1uR+F2B13/h sV X-Google-Smtp-Source: AGHT+IH74DfAcpZzJjY5gVucN/iocAD2IdJwRSSi7LcnqQGKNq6pzCc8B0Oo1aWNXUavs+VjXcRB6A== X-Received: by 2002:a17:907:1c93:b0:b55:e023:5e79 with SMTP id a640c23a62f3a-b703d55cd84mr392077566b.51.1761753052555; Wed, 29 Oct 2025 08:50:52 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Pierrick Bouvier , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 07/35] plugins: add types for callbacks related to certain discontinuities Date: Wed, 29 Oct 2025 15:50:16 +0000 Message-ID: <20251029155045.257802-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753452659154100 From: Julian Ganz The plugin API allows registration of callbacks for a variety of VCPU related events, such as VCPU reset, idle and resume. However, traps of any kind, i.e. interrupts or exceptions, were previously not covered. These kinds of events are arguably quite significant and usually go hand in hand with a PC discontinuity. On most platforms, the discontinuity also includes a transition from some "mode" to another. Thus, plugins for the analysis of (virtualized) embedded systems may benefit from or even require the possiblity to perform work on the occurance of an interrupt or exception. This change introduces the concept of such a discontinuity event in the form of an enumeration. Currently only traps are covered. Specifically we (loosely) define interrupts, exceptions and host calls across all platforms. In addition, this change introduces a type to use for callback functions related to such events. Since possible modes and the enumeration of interupts and exceptions vary greatly between different architectures, the callback type only receives the VCPU id, the type of event as well as the old and new PC. Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Julian Ganz Message-ID: <20251027110344.2289945-8-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index f355c7cb8ab..8cf20cd96f7 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -59,6 +59,7 @@ union qemu_plugin_cb_sig { qemu_plugin_udata_cb_t udata; qemu_plugin_vcpu_simple_cb_t vcpu_simple; qemu_plugin_vcpu_udata_cb_t vcpu_udata; + qemu_plugin_vcpu_discon_cb_t vcpu_discon; qemu_plugin_vcpu_tb_trans_cb_t vcpu_tb_trans; qemu_plugin_vcpu_mem_cb_t vcpu_mem; qemu_plugin_vcpu_syscall_cb_t vcpu_syscall; diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index c450106af18..08bf366e363 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -161,6 +161,50 @@ typedef void (*qemu_plugin_vcpu_simple_cb_t)(qemu_plug= in_id_t id, typedef void (*qemu_plugin_vcpu_udata_cb_t)(unsigned int vcpu_index, void *userdata); =20 + +/** + * enum qemu_plugin_discon_type - type of a (potential) PC discontinuity + * + * @QEMU_PLUGIN_DISCON_INTERRUPT: an interrupt, defined across all archite= ctures + * as an asynchronous event, usually origin= ating + * from outside the CPU + * @QEMU_PLUGIN_DISCON_EXCEPTION: an exception, defined across all archite= ctures + * as a synchronous event in response to a + * specific instruction being executed + * @QEMU_PLUGIN_DISCON_HOSTCALL: a host call, functionally a special kind = of + * exception that is not handled by code run= by + * the vCPU but machinery outside the vCPU + * @QEMU_PLUGIN_DISCON_ALL: all types of disconinuity events currently cov= ered + */ +enum qemu_plugin_discon_type { + QEMU_PLUGIN_DISCON_INTERRUPT =3D 1 << 0, + QEMU_PLUGIN_DISCON_EXCEPTION =3D 1 << 1, + QEMU_PLUGIN_DISCON_HOSTCALL =3D 1 << 2, + QEMU_PLUGIN_DISCON_ALL =3D -1 +}; + +/** + * typedef qemu_plugin_vcpu_discon_cb_t - vcpu discontinuity callback + * @id: plugin ID + * @vcpu_index: the current vcpu context + * @type: the type of discontinuity + * @from_pc: the source of the discontinuity, e.g. the PC before the + * transition + * @to_pc: the PC pointing to the next instruction to be executed + * + * The exact semantics of @from_pc depends on the @type of discontinuity. = For + * interrupts, @from_pc will point to the next instruction which would have + * been executed. For exceptions and host calls, @from_pc will point to the + * instruction that caused the exception or issued the host call. Note that + * in the case of exceptions, the instruction may not be retired and thus = not + * observable via general instruction exec callbacks. The same may be the = case + * for some host calls such as hypervisor call "exceptions". + */ +typedef void (*qemu_plugin_vcpu_discon_cb_t)(qemu_plugin_id_t id, + unsigned int vcpu_index, + enum qemu_plugin_discon_type = type, + uint64_t from_pc, uint64_t to= _pc); + /** * qemu_plugin_uninstall() - Uninstall a plugin * @id: this plugin's opaque ID --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753175; cv=none; d=zohomail.com; s=zohoarc; b=SOBk777JX/TITITb93ZTf/fD83mLnGya35MrVlK9vfOmRAecSrCO9Dv+5Gc8Pu0aSGdWXKphhMNHIwp6SGyOSCzfFZoOvqbtgaTo+YTEF6B197Dw3/UxErNySPMsdSBI6/+1GDh29v7Kd4D/e43TNI4gLNXcGcdwXH3OeTZ1gLA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753175; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fhb+7Qy/aaY0P5BrwBDb6iFOKoQxT9GF6cclukqj4aw=; b=khvsh0JHtq3d30F3HWJUEQCpwwNhbSQDWovDghzzhmD9sITn5EYkg/Gn1N3d1AmoTmEikXv3ZY4vm9D3kLgSYDxxfMuwlqIVk4JUkTbyiWu7u479mi9cWD4fn8/wqc7RtcYV9Yb9+4wG9giilatEMGx5DltV4dEApNxQTEjD4vQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753175920481.998796500509; Wed, 29 Oct 2025 08:52:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8S6-00043L-J1; Wed, 29 Oct 2025 11:51:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8S4-00042I-C0 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:08 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8Ru-0002sb-3c for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:08 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-b6d5e04e0d3so2730366b.2 for ; Wed, 29 Oct 2025 08:50:54 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d85353ff7sm1475768666b.22.2025.10.29.08.50.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:50 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 9F4415FAE6; Wed, 29 Oct 2025 15:50:46 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753052; x=1762357852; 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=fhb+7Qy/aaY0P5BrwBDb6iFOKoQxT9GF6cclukqj4aw=; b=aX64Nmrj1glK0I9Fa0Q1mcgCnblV0uy0Tdw1iuZGf5N9ct+U8WP/3H0tWEUb0QN5Lp YMf2Gr55YBMJb571GU7ntdpnoy9cf3cwQvsOgHx16Ya1ifv60wH0CUz2C5EAkgGO+E7I ao7CsYwwQMoxpFT1cCrDzZRDZvxaPv70audRLJSUDb7VJBgN/DUPG1YF1lnAhy89vmhs Mi5tzcWsvw34NYJaSHqbpSFHFnrTt7r8Eb9Mew5W6oRHASI7QTkFasDQmMk+qQs4mOPw dFTWC2GafrKKBOBqycTcnsVR/asT78CEytjoXDrHt8Odf5d8KrY5+u56HsZ0AVdjUX5p HLKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753052; x=1762357852; 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=fhb+7Qy/aaY0P5BrwBDb6iFOKoQxT9GF6cclukqj4aw=; b=HpLKsf9+Mr0kQbOZrsUqW6z6PKXwe3fSxw0vk44hnJORxUsT29Y4yd/5K5Zxqdod9l IqUrzI8HJKkzu6FcipD5CqyjDMB7mTE0Oo+2USgtJOEqzrO5J7KpYKnZ0c7otlk/Mvn5 FcRi4gyLQ7b/y316Xi0lk5eK6FmC+IRQalR7Zg0wxUvmsxgo3f1XBj8+CuRmbooFeppC q72yfpo2ek37AcMlKdyDiNwwQgyQXllnQQZpzd2+qpcDPXb6F23q//WXbcFCXUzyq50A /Xos/i/I61/Smz4ojfHl/pPFtPq1/PqPVDgYh9Dpm3wXTCWxVbZMwx5Qt1YDOhsLgX7a XWvw== X-Gm-Message-State: AOJu0Yw03dyixEjMNBVABBi/Fbw4qq1UpeMVgl+R4Ja5YsNdtQPLEjm4 VBctQTPdcfcEFlXCoFEyFVAYxy4mhejZbkpw8m8JobS+qPri812Dn+SRotpLTLsW8Uc= X-Gm-Gg: ASbGnctr5hygbsLl+bfc0SeClbEMSVxBlZaM1bVolIjJ8JrnQn/cPFabi46t2poFDtD tQ0dHWDao4y/yxfe/8M96GDIlwsro8UKWyJqWvXjixyHJOWSG5T4uJP7xLgnCKJpLnZE76ujJht vx+9a4ufllojwCEUwhp6/NanY6qT2ijjBbggXMh6c3rcgmcu8mecMVp3t554MncQ3LY0WjVdXeS 3j2OFK1IdG6YBnWO4peDi6pzRdknnbHly+aR3W5kEzbCE9o8Fo+ZEfqfD1c4efDEFFExtH24XHv 978n4dLToqghXS+W4V217AE+0Th0K9XCIoYgyaZy10t++dpoMPutiok3iYoeUocznIQvoGqQ1ki NgTYcgrDHZeLnNz5ChTUEUpbY5/pshPe2JgjrlRBBAKaWvp3DPJjkqhmuOALeuoOhQuKdKZCijX jr X-Google-Smtp-Source: AGHT+IFCzOgsW8c3t/UdEfGN6N5tXpvg6NmQmmAsgRwrUV2tDyctQC8FL+k4YZRcDWTRKOsG3DVv4g== X-Received: by 2002:a17:906:4fca:b0:b1d:285c:e0ef with SMTP id a640c23a62f3a-b703d36dd21mr334808466b.26.1761753051773; Wed, 29 Oct 2025 08:50:51 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Pierrick Bouvier , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 08/35] plugins: add API for registering discontinuity callbacks Date: Wed, 29 Oct 2025 15:50:17 +0000 Message-ID: <20251029155045.257802-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753177000158500 From: Julian Ganz The plugin API allows registration of callbacks for a variety of VCPU related events, such as VCPU reset, idle and resume. In addition to those events, we recently defined discontinuity events, which include traps. This change introduces a function to register callbacks for these events. We define one distinct plugin event type for each type of discontinuity, granting fine control to plugins in term of which events they receive. Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Julian Ganz Message-ID: <20251027110344.2289945-9-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/include/qemu/plugin-event.h b/include/qemu/plugin-event.h index 7056d8427b7..1100dae2123 100644 --- a/include/qemu/plugin-event.h +++ b/include/qemu/plugin-event.h @@ -20,6 +20,9 @@ enum qemu_plugin_event { QEMU_PLUGIN_EV_VCPU_SYSCALL_RET, QEMU_PLUGIN_EV_FLUSH, QEMU_PLUGIN_EV_ATEXIT, + QEMU_PLUGIN_EV_VCPU_INTERRUPT, + QEMU_PLUGIN_EV_VCPU_EXCEPTION, + QEMU_PLUGIN_EV_VCPU_HOSTCALL, QEMU_PLUGIN_EV_MAX, /* total number of plugin events we support */ }; =20 diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 08bf366e363..60de4fdd3fa 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -281,6 +281,22 @@ QEMU_PLUGIN_API void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_simple_cb_t cb); =20 +/** + * qemu_plugin_register_vcpu_discon_cb() - register a discontinuity callba= ck + * @id: plugin ID + * @type: types of discontinuities for which to call the callback + * @cb: callback function + * + * The @cb function is called every time a vCPU receives a discontinuity e= vent + * of the specified type(s), after the vCPU was prepared to handle the eve= nt. + * Preparation entails updating the PC, usually to some interrupt handler = or + * trap vector entry. + */ +QEMU_PLUGIN_API +void qemu_plugin_register_vcpu_discon_cb(qemu_plugin_id_t id, + enum qemu_plugin_discon_type type, + qemu_plugin_vcpu_discon_cb_t cb); + /** struct qemu_plugin_tb - Opaque handle for a translation block */ struct qemu_plugin_tb; /** struct qemu_plugin_insn - Opaque handle for a translated instruction */ diff --git a/plugins/core.c b/plugins/core.c index ead09fd2f1e..40d001d39ad 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -569,6 +569,21 @@ void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_i= d_t id, plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_RESUME, cb); } =20 +void qemu_plugin_register_vcpu_discon_cb(qemu_plugin_id_t id, + enum qemu_plugin_discon_type type, + qemu_plugin_vcpu_discon_cb_t cb) +{ + if (type & QEMU_PLUGIN_DISCON_INTERRUPT) { + plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_INTERRUPT, cb); + } + if (type & QEMU_PLUGIN_DISCON_EXCEPTION) { + plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_EXCEPTION, cb); + } + if (type & QEMU_PLUGIN_DISCON_HOSTCALL) { + plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_HOSTCALL, cb); + } +} + void qemu_plugin_register_flush_cb(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb) { --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753176; cv=none; d=zohomail.com; s=zohoarc; b=LfeuH8KBQyW/Jwa9eSjvXURBozwJ0whtQF2duEbAews1yelKF5DlpStGxh48IX9YgrLYhtwfrcfalUrNgmwQxMkmLyPhiFMIKvYAevrnGWqEWvFXF6MondeWsFcMKLuFLgg9fEZAPg0eMghmmOEhD8ftvzdG0se1oC3Xpc4HbmQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753176; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0JVPjp+p0LqcgwbbqEf2EcoXP0IUYtqEVdw3WZ1a5g4=; b=ZbcoqxF0eg3KYtlix/hTFFsqU7otYDyrT1v63L3xGoLk4GRObxLAwyDfMD0pfs7ZEcLkZGMpT1E5E5GLL1yVRtXTXZemGr63EZOkNiclzje45H6gdrSWG1XrDEJgejJ37hxILCdyCI9zyXTFes3ffN4ciwVCpENw8vS986mbvf8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753176400718.2500288884315; Wed, 29 Oct 2025 08:52:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8SG-0004JJ-5H; Wed, 29 Oct 2025 11:51:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8S9-0004AD-71 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:14 -0400 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8Rx-0002t3-GN for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:12 -0400 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-b5e19810703so1701866b.2 for ; Wed, 29 Oct 2025 08:50:57 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d853386d8sm1448469766b.18.2025.10.29.08.50.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:50 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B87C65FAF1; Wed, 29 Oct 2025 15:50:46 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753054; x=1762357854; 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=0JVPjp+p0LqcgwbbqEf2EcoXP0IUYtqEVdw3WZ1a5g4=; b=qvFHe13q7JR4Ph3JMwLnL/OW602cn97SEplPkVfn26e+FeifcWtKMXVTHmZXyO/pPz vEn2Set9Oh4zOpYLFtUxHjZV/E1/7aR/eeP1t5w9voa1ISjQhjZdYvxQSAMiGal2WTTK 0qEc7GEWayX0XPO3C9Q4vgcbUeU+psJn+Ide/6IjimFXqo2oHqF9mdmD/vookZVhsZiB mYb5MRFqq5ZQD5pC06yWsuWv4i7CDydWE+JLmT3DjhDlQdu27rLCZoIseeMvxOsNLkud BNsRy0IcHscRDs+91MWS99wc3Rw5m6k/WeOsZx4jdl4nVf6MBze2z3XTvB7cbv0OYZ7M vVOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753054; x=1762357854; 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=0JVPjp+p0LqcgwbbqEf2EcoXP0IUYtqEVdw3WZ1a5g4=; b=AIk83b7x/IbhvsWTaPs2iw0yH0WBLx16VQB++WTB1si2r07KU7O+Q8mWuPR+Rzyao9 yqYubQjHkIpB9YM+n2eSd/+hrFm0N4s1X6gS6pEHStdHnLDtGszfW9THLHuS9YFr5h63 jQPHThxkpwNT3Tm7cc/YOOGVuTrQGVm9vqMNJXFIXx7DaYo1bJqRMIpj/JEnyWlH9eKG VY6CSY8RJDrvjzdb4cewbb7Vfe1j+EwznJG12N9rhXTyVDiOQGzn0QyCpTMb5j317gJw He9fetVMuRUDAPpxmxURrV8S9H6sgNVoyZH48ygLYmcPy4wp+tQKu9Adb8xznBjKF+f/ XZFg== X-Gm-Message-State: AOJu0YyH3DtEJRUsC+vy8fvFrjh1/A/5la1CZKtXXuQup3fpcRAGqr3q Qb9MDmAtZwcvaT7rdscN+jcB2bjLaCr/1AciPFtupB5iAcjxb8ggUSoD9TuhCxEa3LE= X-Gm-Gg: ASbGncs+5Fqui1HcWfN+WbRvifOMqAvip92Ejkv0aBrchIoMfRwAixWk60t80JsilHF Q5NzQLNCtYa2e0UhYnbihjJbl3Q9kAJ0AFqpJStSuqjElmrsKB7WtQiQqI38LhzloV6KdCj854F IRAkn8uSksjYq1A/eK96xzX4lTp2+GFUVNar/uBSACNWZR9q5FAemNyUiNmsZRUimCRlRE1WcNg oOR9OzJhFmf2PHDBuFWFPTrtYAbB3fkQAD0/vmTQVRniGG4kIwuzYMdHiH59YQ2pT2W9Wr1C9qG daDm24j79J9GWgKc3mk1PqqySWGIsAGBq1zxScUEWPU6dKUxrAgu5njyArv2TDDFkPyS4JZhS/q HxaM8H7P8rluTRxYgeL3VnBCkka6YRsYx4BdfCnd51bP5l8C/TljyHx91903tesyt1kuAPY2iiQ It X-Google-Smtp-Source: AGHT+IFcnRvMF0vgyxEnKxZBJgYIM0n7No+vR6lyXVN+4DFGQcYhky+PmicVtViKqcoaazhc+dNJYA== X-Received: by 2002:a17:907:7b89:b0:b4f:e12e:aa24 with SMTP id a640c23a62f3a-b703d326f7amr331527366b.22.1761753054269; Wed, 29 Oct 2025 08:50:54 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Alexandre Iooss , Mahmoud Mandour , Pierrick Bouvier Subject: [PULL 09/35] plugins: add hooks for new discontinuity related callbacks Date: Wed, 29 Oct 2025 15:50:18 +0000 Message-ID: <20251029155045.257802-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753180477154100 From: Julian Ganz The plugin API allows registration of callbacks for a variety of VCPU related events, such as VCPU reset, idle and resume. In addition, we recently introduced API for registering callbacks for discontinuity events, specifically for interrupts, exceptions and host calls. This change introduces the corresponding hooks called from target specific code inside qemu. Signed-off-by: Julian Ganz Message-ID: <20251027110344.2289945-10-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index 8cf20cd96f7..cea0a68858b 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -161,6 +161,9 @@ void qemu_plugin_vcpu_exit_hook(CPUState *cpu); void qemu_plugin_tb_trans_cb(CPUState *cpu, struct qemu_plugin_tb *tb); void qemu_plugin_vcpu_idle_cb(CPUState *cpu); void qemu_plugin_vcpu_resume_cb(CPUState *cpu); +void qemu_plugin_vcpu_interrupt_cb(CPUState *cpu, uint64_t from); +void qemu_plugin_vcpu_exception_cb(CPUState *cpu, uint64_t from); +void qemu_plugin_vcpu_hostcall_cb(CPUState *cpu, uint64_t from); void qemu_plugin_vcpu_syscall(CPUState *cpu, int64_t num, uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4, uint64_t a= 5, @@ -258,6 +261,15 @@ static inline void qemu_plugin_vcpu_idle_cb(CPUState *= cpu) static inline void qemu_plugin_vcpu_resume_cb(CPUState *cpu) { } =20 +static inline void qemu_plugin_vcpu_interrupt_cb(CPUState *cpu, uint64_t f= rom) +{ } + +static inline void qemu_plugin_vcpu_exception_cb(CPUState *cpu, uint64_t f= rom) +{ } + +static inline void qemu_plugin_vcpu_hostcall_cb(CPUState *cpu, uint64_t fr= om) +{ } + static inline void qemu_plugin_vcpu_syscall(CPUState *cpu, int64_t num, uint64_t a1, uint64_t= a2, uint64_t a3, uint64_t a4, uint64_t a5, uint64_t a= 6, diff --git a/plugins/core.c b/plugins/core.c index 40d001d39ad..35a252d2729 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -105,6 +105,30 @@ static void plugin_vcpu_cb__simple(CPUState *cpu, enum= qemu_plugin_event ev) } } =20 +/* + * Disable CFI checks. + * The callback function has been loaded from an external library so we do= not + * have type information + */ +QEMU_DISABLE_CFI +static void plugin_vcpu_cb__discon(CPUState *cpu, + enum qemu_plugin_event ev, + enum qemu_plugin_discon_type type, + uint64_t from) +{ + struct qemu_plugin_cb *cb, *next; + uint64_t to =3D cpu->cc->get_pc(cpu); + + if (cpu->cpu_index < plugin.num_vcpus) { + /* iterate safely; plugins might uninstall themselves at any time = */ + QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { + qemu_plugin_vcpu_discon_cb_t func =3D cb->f.vcpu_discon; + + func(cb->ctx->id, cpu->cpu_index, type, from, to); + } + } +} + /* * Disable CFI checks. * The callback function has been loaded from an external library so we do= not @@ -557,6 +581,24 @@ void qemu_plugin_vcpu_resume_cb(CPUState *cpu) } } =20 +void qemu_plugin_vcpu_interrupt_cb(CPUState *cpu, uint64_t from) +{ + plugin_vcpu_cb__discon(cpu, QEMU_PLUGIN_EV_VCPU_INTERRUPT, + QEMU_PLUGIN_DISCON_INTERRUPT, from); +} + +void qemu_plugin_vcpu_exception_cb(CPUState *cpu, uint64_t from) +{ + plugin_vcpu_cb__discon(cpu, QEMU_PLUGIN_EV_VCPU_EXCEPTION, + QEMU_PLUGIN_DISCON_EXCEPTION, from); +} + +void qemu_plugin_vcpu_hostcall_cb(CPUState *cpu, uint64_t from) +{ + plugin_vcpu_cb__discon(cpu, QEMU_PLUGIN_EV_VCPU_HOSTCALL, + QEMU_PLUGIN_DISCON_HOSTCALL, from); +} + void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_simple_cb_t cb) { --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753430; cv=none; d=zohomail.com; s=zohoarc; b=PJ1B2CqYKRpmS7D9xuxOHMP4XnErNleeW8w76DVl3IAJCuI4Yy3JIbfOijH5VFKdltFtdmHNSr0EmNat0BADNeiLd6NcWFIMbnPCbWRPxGgWFw90XJO49iKp+emxrGc/hkAcn3HcJEBWGxKuLnOiJCD5zd5JRr5bN6pjD25V+uw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753430; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UwjbQOL3SNK3XYyw4bXRUjK1Sm/B26LNqTre7AraQmI=; b=UuYlmiSD0Yt9YUoF19S3l+DpFhEaVbruPqjRiS0sFei5XYF4H7QFdNjDUD/IXtQjgGMWZSy2ITV9nTImg5YHXG8y2eDa16U+mdX1aPtRy35S/h+FnbmNI5QU1Ze3hoAc1vkX5PdXHI6omce79lVnhzqs2bMVqahF5b6Kg7himas= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753430707690.571990046794; Wed, 29 Oct 2025 08:57:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8SM-0004Uf-0w; Wed, 29 Oct 2025 11:51:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8SI-0004Nt-5D for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:22 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8Ry-0002sw-KW for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:21 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-b6d402422c2so3064566b.2 for ; Wed, 29 Oct 2025 08:50:57 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d85369697sm1509121566b.26.2025.10.29.08.50.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:50 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D3157602AD; Wed, 29 Oct 2025 15:50:46 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753054; x=1762357854; 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=UwjbQOL3SNK3XYyw4bXRUjK1Sm/B26LNqTre7AraQmI=; b=im5Y6J6BLCCx0ScQRywDnqhrVvUYLMOfO/Wp7eGJuTGLqGYpWSIowe+RBHnRzwtAfm aBcB/EHOPvndQFNTlP55EISLp1Suj+wez9O+naYGpovYiVNS8EDCIsl1kefu2NAxZkpZ ZBAaaQNgFdkTIPwIcF5PlZXl0HP68JbSrrTHm8P2iK35DitWETZA1EoQrcI1vIsKCcRH W3WhOlWRW843q3a6kEdb8gW5fgkQ/hTrWksMPB8Bk+pIfH0BuyLvtmjJmx3xSK7aEnlw hbQmz2e2iI1UK+EMIGLm6laHQLwbgG5/dIntxGTMWa0StFzi9WAKtdaA5GwqTp6OX9a/ QkxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753054; x=1762357854; 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=UwjbQOL3SNK3XYyw4bXRUjK1Sm/B26LNqTre7AraQmI=; b=nTmIeSj+gB7jC+nMy2AbB+uvjwI2JxNAecyP0FsRDtxfdR7rw/P+Cb2ZSouP1iHdmh xOMza1Oza2B5OOeM+/M+VjxXbpqlAuPraOcWZGDJe8In8n2KhyYfqp4wjxz+tbkFXSv8 C00vJTWUXarc+/TePxISk3bNoFBsEYBMnX+ax9CxrFkQW5AOhHFczfCCG7x/8ILcWMpr l3ZdZzUMewHQE1OWDTIvxESNFIY4HltnNNdihm1EQGerCqGzrz9BODgSpZ8V04epynTY 9GB/1MzZeMKqfnzalh0IDdUm48MVJ9TC33jjKod9sEdb+P9DSm9C/khWqszWpSCtCzRO DYog== X-Gm-Message-State: AOJu0Yye7Epi7ZAh47LF3QXetnDaB96Ssf5LWCUugF/Hysl9nCpxzIaw chMe4aELJFnbgd5+mHPlL1CsSjZMa/QlyFB0RN5SiU2Z4lwKnkCMg/Q9C8vMd8EY+QY= X-Gm-Gg: ASbGncseLC9LCxKdSWorPgJrdrT0FThMRAWgUYMe6MbwAwRnuxH4pEQNfdfji49ZnD6 5te4yQy/Xkl+DsGHFXm9wOIO9TilyTnt1VqAVfcwfdWPABNVtzmMiNBz0POt3vkN7DCLfmRYXEQ HRhtCw1/8CP8NmtGybmoiGi9gBRxhd0y+gzfQU3POGIhh/d5T1FF9R5t5rY0SCuyA8wDI3ufZC+ 0Q5k8exUygswTc1JHcYPD8Qwks70Pm6mPzz8OXIVL/co2ip4J6PMWcA8ZJlht1Q6WfsAmCZ6X6/ hNSzDT1rd+RwBVF02W5JMgqIDQpgdMBigIzwvoBNNfcfI03PTSDK83ZVmwjqqFtnY1ndpZq1QeM PYyluq98RkTpHIgbuMeZGUQSL9WJu7d/eLoMSJ1MyGnnfE/UM1Gdx6yI0tUcGh9m4rML7QDcVa3 7h X-Google-Smtp-Source: AGHT+IEAAVxjum6pA9Wytr0y5DHwzasYY9KJeQ60p3l5A1/ZyPaToyX2rSTRaO0ycP92T+2VnDZZsg== X-Received: by 2002:a17:907:7247:b0:b38:6689:b9f5 with SMTP id a640c23a62f3a-b703d294f7dmr378168266b.3.1761753053792; Wed, 29 Oct 2025 08:50:53 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 10/35] contrib/plugins: add plugin showcasing new dicontinuity related API Date: Wed, 29 Oct 2025 15:50:19 +0000 Message-ID: <20251029155045.257802-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x630.google.com X-Spam_score_int: -7 X-Spam_score: -0.8 X-Spam_bar: / X-Spam_report: (-0.8 / 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, NEW_PRODUCTS=1.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753438016158500 From: Julian Ganz We recently introduced new plugin API for registration of discontinuity related callbacks. This change introduces a minimal plugin showcasing the new API. It simply counts the occurances of interrupts, exceptions and host calls per CPU and reports the counts when exitting. Reviewed-by: Pierrick Bouvier Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Julian Ganz Message-ID: <20251027110344.2289945-11-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/docs/about/emulation.rst b/docs/about/emulation.rst index 8a5e128f677..92c219119e8 100644 --- a/docs/about/emulation.rst +++ b/docs/about/emulation.rst @@ -1015,6 +1015,14 @@ interesting to generate them around a particular poi= nt of execution:: # generate trace around init execution (2 seconds): $ uftrace dump --chrome --time-range=3D1753122320~1753122322 > init.js= on =20 +Count traps +........... + +``contrib/plugins/traps.c`` + +This plugin counts the number of interrupts (asyncronous events), exceptio= ns +(synchronous events) and host calls (e.g. semihosting) per cpu. + Other emulation features ------------------------ =20 diff --git a/contrib/plugins/traps.c b/contrib/plugins/traps.c new file mode 100644 index 00000000000..d5ddc0f3dd6 --- /dev/null +++ b/contrib/plugins/traps.c @@ -0,0 +1,83 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + * Copyright (C) 2025, Julian Ganz + * + * Traps - count traps + * + * Count the number of interrupts (asyncronous events), exceptions (synchr= onous + * events) and host calls (e.g. semihosting) per cpu and report those coun= ts on + * exit. + */ + +#include + +#include + +QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGIN_VERSION; + +typedef struct { + uint64_t interrupts; + uint64_t exceptions; + uint64_t hostcalls; +} TrapCounters; + +static struct qemu_plugin_scoreboard *traps; + +static void vcpu_discon(qemu_plugin_id_t id, unsigned int vcpu_index, + enum qemu_plugin_discon_type type, uint64_t from_p= c, + uint64_t to_pc) +{ + TrapCounters *rec =3D qemu_plugin_scoreboard_find(traps, vcpu_index); + switch (type) { + case QEMU_PLUGIN_DISCON_INTERRUPT: + rec->interrupts++; + break; + case QEMU_PLUGIN_DISCON_EXCEPTION: + rec->exceptions++; + break; + case QEMU_PLUGIN_DISCON_HOSTCALL: + rec->hostcalls++; + break; + default: + g_assert_not_reached(); + break; + } +} + +static void plugin_exit(qemu_plugin_id_t id, void *p) +{ + g_autoptr(GString) report; + report =3D g_string_new("VCPU, interrupts, exceptions, hostcalls\n"); + int max_vcpus =3D qemu_plugin_num_vcpus(); + int vcpu; + + for (vcpu =3D 0; vcpu < max_vcpus; vcpu++) { + TrapCounters *rec =3D qemu_plugin_scoreboard_find(traps, vcpu); + g_string_append_printf(report, + "% 4d, % 10"PRId64", % 10"PRId64", % 10"PRI= d64 + "\n", vcpu, rec->interrupts, rec->exception= s, + rec->hostcalls); + } + + qemu_plugin_outs(report->str); + qemu_plugin_scoreboard_free(traps); +} + +QEMU_PLUGIN_EXPORT +int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, + int argc, char **argv) +{ + if (!info->system_emulation) { + qemu_plugin_outs("Note: interrupts are only reported in system" + " emulation mode."); + } + + traps =3D qemu_plugin_scoreboard_new(sizeof(TrapCounters)); + + qemu_plugin_register_vcpu_discon_cb(id, QEMU_PLUGIN_DISCON_ALL, + vcpu_discon); + + qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); + + return 0; +} diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build index 7eb3629c95d..eb944b5159a 100644 --- a/contrib/plugins/meson.build +++ b/contrib/plugins/meson.build @@ -1,6 +1,6 @@ contrib_plugins =3D ['bbv', 'cache', 'cflow', 'drcov', 'execlog', 'hotbloc= ks', 'hotpages', 'howvec', 'hwprofile', 'ips', 'stoptrigger', - 'uftrace'] + 'traps', 'uftrace'] if host_os !=3D 'windows' # lockstep uses socket.h contrib_plugins +=3D 'lockstep' --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753263; cv=none; d=zohomail.com; s=zohoarc; b=VkJBnet3oe90mQj8HuRwxH8Y7a7Am3ShL0DV2blr13vAume4ueWJEI1uDVptxnkq4pIYlxBK4BxKosFLOs2rQwbOoZ4KkF7+6J2NhRKzGmKXPP5gplDYwR/WmjIi1f+hhfn+3xJOGv9Cn13fuaJ057aVt/UeBV/ri2vB2zZIT0o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753263; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ONPjhxBdnZw2nEiSNLLc67Obp7P7Ify6BVfhuB1s+3s=; b=K2dUwBrygo0GAem/VdmZv59Q5ICrve2P1EYTubpqaC8n7mDDzdtdu/PYIyFzXtIfshBtRccNADQlbyLQlfEgif3D+pe57V/qbfKP9GCoU4IkZoykl7jwvWcfailXrAX/o8mGEfpq0QRSGCRF5a2zbP4mZ9/Fu+gZjOf4ci+SEXM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 176175326354218.25401980383333; Wed, 29 Oct 2025 08:54:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8SU-0004cX-DH; Wed, 29 Oct 2025 11:51:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8SN-0004Y3-E8 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:27 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8S0-0002tb-Kv for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:27 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-63c523864caso16430429a12.1 for ; Wed, 29 Oct 2025 08:50:59 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-64043e05a5esm2512795a12.4.2025.10.29.08.50.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:54 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id E7CD260915; Wed, 29 Oct 2025 15:50:46 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753057; x=1762357857; 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=ONPjhxBdnZw2nEiSNLLc67Obp7P7Ify6BVfhuB1s+3s=; b=KglwVBffYuD8o9fN/bFgeDpp7SCI+m0tjAl/Z74EfLyE36uGVpP0EF/KVf2ukGxiMH xDqyNH/G1lBwrtE9q7dJfm936R03HmyfUvRoOzjcGShxpHaiK210JqvBeNo1XeIX+49j +nQbziPFl2MXw0JzoHDYAkiiaj0va8u7TJlBv2yMxNDOERsPABClpbc3fs3xfYCtVd5m zjds8zsdEzlHn2aJFU+W7qNlBj+paOeaGIQlU9Eq13obAhafHKRP7qSOynyKfTbzvW5y OOicqfiVZFDerFryXbCcRYuRBbtyLurNl5v/RQEWnUwsU97n5YwyQF2rWYxBlx6QM8LB jQ/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753057; x=1762357857; 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=ONPjhxBdnZw2nEiSNLLc67Obp7P7Ify6BVfhuB1s+3s=; b=nVqtvxhndmtoGRWCXTXQGt89GMCDcTNOHEtCsPhQgmug6jbVrVZHjsPYIY/cVTcPsR 8X0348yVGmCZWC1Ro10zmwGs/QocgpNMrKWi2wEdnUz8ByTxDXUwwehSizoZ311D3rkD G1oB+6R3FhuIlnzWmKbVeLmRjWdQU8RwvGqmoI0pITu/JCPbGNpzHfxtKKk4K4BTEhdw 1Ndj17BCHPlcb4pKsoBGPva3bkf8sQqMDkmcS7lkNDwaRutcyNlYV9DkNIWdq9PFJohT pUXyoC1xybhKIny0ZuOng4Pv3ORWGclvfQEtU7mJmNqueYbThL+7eGXNGWRcWxIKjj8+ 8SCg== X-Gm-Message-State: AOJu0YyJ70TfNV/06Kqf7yD7vUZ98WVeJ9/uImCrx/1PPm2kDwn+U6Jt GCb5rNFe9t8eBaMwQNObD5DeZkhxd0UfbJy1qNS97A0M5/YiQjSrbZScFa/bLYfwiFQieeS5gtA RMROVqTE= X-Gm-Gg: ASbGncuBEJ/gZGDVaTCR+QKurUs0W3H5sV7pUkATjghBjayYuoDatSOk6syShIt+hup ZKQN0E5RRK1n/cVwIWGWKac47mGXxdZzsm7n0feJMYGKl6usJq6iG3JitWBtBLvsRCkwcUv42Do JdV9lB2owlVlbYCKXsYZwIn1lxWNJ12F6j3hlGGfV+ZfpshgvD64bWGXkv/DQ1BU405eBAgfwJH XBpKv55FDo4mw5sqhvjURMnz4YYCmWR6LtP2kVOZc7si7C4PNNjWbcZ//5Cds+g6tMRC9PGRdQ7 rl+pV0Oioo6Vn/r/i+O3trA0h7IHKhHyvJ+v+SheiTm9iDRYpJNhhln4w8savNRRPJd8B/sTiVZ SdWzEd/Nh4P7+g3l0Ldjc4dZxX7ptiASqEH+fKfjT7CPtqjyVf+vLtdw9bEf3yjYI6UI87uR+ja Jn X-Google-Smtp-Source: AGHT+IEk5gN0V25rW1P43a+juaOx7z4oJTcYOb6OkbZZaSFVpz1E8qXc6CbrH6kclP4LSbDjscapLA== X-Received: by 2002:a05:6402:1442:b0:63c:4d42:993f with SMTP id 4fb4d7f45d1cf-640441aee2dmr2776482a12.3.1761753057248; Wed, 29 Oct 2025 08:50:57 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 11/35] target/alpha: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:20 +0000 Message-ID: <20251029155045.257802-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753265837158500 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for Alpha targets. Reviewed-by: Richard Henderson Signed-off-by: Julian Ganz Message-ID: <20251027110344.2289945-12-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/alpha/helper.c b/target/alpha/helper.c index 096eac34458..a9af52a928f 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -27,6 +27,7 @@ #include "exec/helper-proto.h" #include "qemu/qemu-print.h" #include "system/memory.h" +#include "qemu/plugin.h" =20 =20 #define CONVERT_BIT(X, SRC, DST) \ @@ -328,6 +329,7 @@ void alpha_cpu_do_interrupt(CPUState *cs) { CPUAlphaState *env =3D cpu_env(cs); int i =3D cs->exception_index; + uint64_t last_pc =3D env->pc; =20 if (qemu_loglevel_mask(CPU_LOG_INT)) { static int count; @@ -431,6 +433,17 @@ void alpha_cpu_do_interrupt(CPUState *cs) =20 /* Switch to PALmode. */ env->flags |=3D ENV_FLAG_PAL_MODE; + + switch (i) { + case EXCP_SMP_INTERRUPT: + case EXCP_CLK_INTERRUPT: + case EXCP_DEV_INTERRUPT: + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); + break; + default: + qemu_plugin_vcpu_exception_cb(cs, last_pc); + break; + } } =20 bool alpha_cpu_exec_interrupt(CPUState *cs, int interrupt_request) --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753349; cv=none; d=zohomail.com; s=zohoarc; b=WmtTdR7EbyKdXosEdpudErMgfmbuoUmEb6SU/qvbBcvewdus1bzN/xi/vjOGgL80AQa6BgPUCkfjjbEHHQhzA+EH8gyxtYfDDLY0Q2ksTBwP9hJyk5t2KX85e35OswFsxT7dkGWI0zoWfPZgsOxMSkCNnr/VcDb2FOB8Zy/qoo4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753349; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qIODdnohFbYXb1XCHQq9SFU/QmlMM/ak2DXbJVzwyRg=; b=hl+OMu9fhVBLpmSrq6dLhFOnUIQZc+6jeOVWeC4OJaDIyC1bwrI/jzKf0CSJ12KOo4nZ4aikGAtCetOPIzlyMDRYgc//7K8Vzwkh5IhjgeAtgXAPWhq0UOeyy7oIKlA4rGFogTyfSNqI4Eq3vv/XkwWKfapvUSucmAc5nuK6ndg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753349105774.1591759841989; Wed, 29 Oct 2025 08:55:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8SE-0004I5-Fu; Wed, 29 Oct 2025 11:51:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8S9-0004A9-7C for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:15 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8Rx-0002tG-GM for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:11 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-b6d855ca585so8309866b.0 for ; Wed, 29 Oct 2025 08:50:59 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-64043e05a5esm2512798a12.4.2025.10.29.08.50.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:54 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 0C6DB609B7; Wed, 29 Oct 2025 15:50:47 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753056; x=1762357856; 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=qIODdnohFbYXb1XCHQq9SFU/QmlMM/ak2DXbJVzwyRg=; b=gHiLX0J35QbIMJBdFRVQOWwkzhB2T1soIvLBrLr2FDge5PdcTBHrJbCu2zuipeVGa1 GGPPZVvLr2LSzsVaoRde/Z9JxaU5YpgsDxS9/048yzywbmTpNkpaPhi6hxh2K4ybUIxW yV4SgLXQf02J4zD66BEcsmRH2M4SR5+2xGwehxkTpfWC45b/lcaISXXqphGUscfEJ/jw zbTEwbKA0MU9oA8RoZWrzCFH0r2HvPgAKBykP57/KDQIA+kQ/BoDUNs+kN2wR04vsrjM OrdNwb/rol7zuwhZTp9E26EemPMHmB3pb8aB6NfaigVYpI2deHBOWXbCiLokqVhI1fCO gzmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753056; x=1762357856; 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=qIODdnohFbYXb1XCHQq9SFU/QmlMM/ak2DXbJVzwyRg=; b=jdYrQqd7ixV+fIOoBL+7JXWjQ3WvRwNkQpeOF+a4kw9c93TdALNlhXPyBl9/4aSJu3 tY89tr5YLNZCoiuowzrbHi5viV1tES++RdAd7v3vuKSPLywdWC4E2ybffC2Aadreie7z 1OAEiCMiqfSBJBNhNzKTFZgATBTnxu6jQkkfYDJyuiLOpRhERlTMwjNi531MzUW71Y3L yonhjbWlArZoVBpwBz8TY5vtfAIFQ6/uHVJRq2lfkx7AM45Qji6y21SWgH+Ur2LAQfoZ TeZyHkaX3DW8/jwPgBlD8HDXtOYZ1xxbvrEUxyr9/BN/SiBWvk0u+7OXIpsunaAoZikR Xi6g== X-Gm-Message-State: AOJu0Yznvu4U6JyGyYGn93uw3zognBDfpEVY5E7U8Yq2TtCdSdt/tLNX Hk1+tmXelQE47CL1HnZzjT87OxP8fQLsDK2+PEMoKN1UZEGqR2L9o01GhoUxDB8op6BaERsEfJp uqlb50B4= X-Gm-Gg: ASbGnctgy1xIPuDQJH1CjM7FKHyB23Bbp0eqTLIhB7nqQszzZNXhFMf6PSK1dTuOAnl 7XKS6G0Al8a5lS6woEGLaKi0IgSIXwCECdS8E/zIAihG/8bOQt8v5BjQVBgud9q0Mp277r1zcJn cijnYMQqhKWt5Kd6eykwkDiSTlW7Xk4bAZjtlWc9R6JDSqBSnElhOql2BMu/9F2bkECEIhu6I/v +oumBZMKG5vcyZZ+zrfiu+uyygLuUtDXMSmxf3G4TAd8lvsPW0LmlIJkwjTeBJ3kP6S9G5d2pGU hXigK1FkVWRuz1Bdwu/uw8My6IcxNeEoRnbkNrTO0/khc+C7ljHa7ckJItAcpBE2hpwfV5VSSFD D/VWL0Yv+aT/lX/V3ko6VyY70eX9cL9svSBh0uBP/FiQmI5gthHh+1txnZcCs/vP6N1pCvoBi01 ZK X-Google-Smtp-Source: AGHT+IFCWeSvhoYvfENgzQIjctgQyyRRSeGsIdurd/PASyGDzgk4V/SYVKDEiQUQP47LkhwCuowwRg== X-Received: by 2002:a17:907:728c:b0:b63:2000:72c8 with SMTP id a640c23a62f3a-b703d5f7bb1mr363351066b.62.1761753055607; Wed, 29 Oct 2025 08:50:55 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Peter Maydell , qemu-arm@nongnu.org (open list:ARM TCG CPUs) Subject: [PULL 12/35] target/arm: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:21 +0000 Message-ID: <20251029155045.257802-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753351464154100 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for ARM (and Aarch64) targets. We decided to treat the (V)IRQ, (VI/VF)NMI, (V)FIQ and VSERR exceptions as interrupts since they are, presumably, async in nature. Reviewed-by: Richard Henderson Signed-off-by: Julian Ganz Message-ID: <20251027110344.2289945-13-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/arm/internals.h b/target/arm/internals.h index f86f421a3db..6fbf7e1ca49 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -375,6 +375,7 @@ static inline int r14_bank_number(int mode) =20 void arm_cpu_register(const ARMCPUInfo *info); =20 +void arm_do_plugin_vcpu_discon_cb(CPUState *cs, uint64_t from); void register_cp_regs_for_features(ARMCPU *cpu); void init_cpreg_list(ARMCPU *cpu); =20 diff --git a/target/arm/helper.c b/target/arm/helper.c index 2ef9c178147..ef6435c3efb 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -34,6 +34,7 @@ #endif #include "cpregs.h" #include "target/arm/gtimer.h" +#include "qemu/plugin.h" =20 #define HELPER_H "tcg/helper.h" #include "exec/helper-proto.h.inc" @@ -8783,6 +8784,24 @@ static void take_aarch32_exception(CPUARMState *env,= int new_mode, } } =20 +void arm_do_plugin_vcpu_discon_cb(CPUState *cs, uint64_t from) +{ + switch (cs->exception_index) { + case EXCP_IRQ: + case EXCP_VIRQ: + case EXCP_NMI: + case EXCP_VINMI: + case EXCP_FIQ: + case EXCP_VFIQ: + case EXCP_VFNMI: + case EXCP_VSERR: + qemu_plugin_vcpu_interrupt_cb(cs, from); + break; + default: + qemu_plugin_vcpu_exception_cb(cs, from); + } +} + static void arm_cpu_do_interrupt_aarch32_hyp(CPUState *cs) { /* @@ -9473,6 +9492,7 @@ void arm_cpu_do_interrupt(CPUState *cs) ARMCPU *cpu =3D ARM_CPU(cs); CPUARMState *env =3D &cpu->env; unsigned int new_el =3D env->exception.target_el; + uint64_t last_pc =3D cs->cc->get_pc(cs); =20 assert(!arm_feature(env, ARM_FEATURE_M)); =20 @@ -9489,6 +9509,7 @@ void arm_cpu_do_interrupt(CPUState *cs) if (tcg_enabled() && arm_is_psci_call(cpu, cs->exception_index)) { arm_handle_psci_call(cpu); qemu_log_mask(CPU_LOG_INT, "...handled as PSCI call\n"); + qemu_plugin_vcpu_hostcall_cb(cs, last_pc); return; } =20 @@ -9500,6 +9521,7 @@ void arm_cpu_do_interrupt(CPUState *cs) #ifdef CONFIG_TCG if (cs->exception_index =3D=3D EXCP_SEMIHOST) { tcg_handle_semihosting(cs); + qemu_plugin_vcpu_hostcall_cb(cs, last_pc); return; } #endif @@ -9525,6 +9547,8 @@ void arm_cpu_do_interrupt(CPUState *cs) if (!kvm_enabled()) { cpu_set_interrupt(cs, CPU_INTERRUPT_EXITTB); } + + arm_do_plugin_vcpu_discon_cb(cs, last_pc); } #endif /* !CONFIG_USER_ONLY */ =20 diff --git a/target/arm/tcg/m_helper.c b/target/arm/tcg/m_helper.c index d856e3bc8e2..3fb24c77900 100644 --- a/target/arm/tcg/m_helper.c +++ b/target/arm/tcg/m_helper.c @@ -23,6 +23,7 @@ #if !defined(CONFIG_USER_ONLY) #include "hw/intc/armv7m_nvic.h" #endif +#include "qemu/plugin.h" =20 static void v7m_msr_xpsr(CPUARMState *env, uint32_t mask, uint32_t reg, uint32_t val) @@ -2194,6 +2195,7 @@ void arm_v7m_cpu_do_interrupt(CPUState *cs) CPUARMState *env =3D &cpu->env; uint32_t lr; bool ignore_stackfaults; + uint64_t last_pc =3D env->regs[15]; =20 arm_log_exception(cs); =20 @@ -2361,6 +2363,7 @@ void arm_v7m_cpu_do_interrupt(CPUState *cs) g_assert_not_reached(); #endif env->regs[15] +=3D env->thumb ? 2 : 4; + qemu_plugin_vcpu_hostcall_cb(cs, last_pc); return; case EXCP_BKPT: armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_DEBUG, false); @@ -2427,6 +2430,8 @@ void arm_v7m_cpu_do_interrupt(CPUState *cs) =20 ignore_stackfaults =3D v7m_push_stack(cpu); v7m_exception_taken(cpu, lr, false, ignore_stackfaults); + + arm_do_plugin_vcpu_discon_cb(cs, last_pc); } =20 uint32_t HELPER(v7m_mrs)(CPUARMState *env, uint32_t reg) --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753186; cv=none; d=zohomail.com; s=zohoarc; b=SZ10Jg9SDJDuDDNUSFoU0QIgeVcUhMjr4Ov3TO9e4P3WLcol4xP+EioxJZAedEU4KJ6aD8BmKFuU8DJ7RMpFNTJkluPxUDzYwLuR8s55bt074VrHSsKLBlXIF/WlEmq8XMhO63kRgEo3LFd/1NHZ/iOu6usnjX3Uk9Qn2KlghVw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753186; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=uKr5Bi2eQz1IQt5nF2ox0QSeE5cWUROzQSNoAdPSO3w=; b=gnwvToBAbRR8LPDfLCAOUR7Rl23nFjH4gaiJZk098Mkd2KLpugCYnE1l1yI3RmlB2URiNzSR5CUqHqqQUJFcVpe/5hGIiB1QBQ9rEranDrt3BzDVTalo2ol3bbCKf4LzgjQ+SMyI/BON6w+b1yNNMdID7IV+K/lFvLT2JYNC428= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753186451312.9674777328105; Wed, 29 Oct 2025 08:53:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8SH-0004KE-Sl; Wed, 29 Oct 2025 11:51:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8SC-0004Dx-5h for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:16 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8Ry-0002tS-49 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:14 -0400 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-b4736e043f9so6057266b.0 for ; Wed, 29 Oct 2025 08:50:59 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d8535974asm1449152766b.25.2025.10.29.08.50.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:54 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 25307609D9; Wed, 29 Oct 2025 15:50:47 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753056; x=1762357856; 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=uKr5Bi2eQz1IQt5nF2ox0QSeE5cWUROzQSNoAdPSO3w=; b=PpJ5qujGNC8Fs7eI+BxgVaOr0FfRoxwmsVYgAKJvW257LaJ7RKVRJ1e1uLnxDL9Pzh OtJDKb9AGoduAiJD3YFtOUmLJWWeorpoqk5EyBwWZa0rMQsdjCZ2DV+ZQCzWkdU/sMJE 2j8lLKipfsc9F+bsjVCIhH1mVK4H//MIkcx6ADJEx2gKwIGNzLHjo9aRq748NaNWm/7z W1ibVuTOn7JZfkM+edWJVhzYgs/syADYtclkTyCwwNdcpAhSai2xqdve8ySfat9Fnfbq 304xIzBB2uU6mJY4tc7wKPdMQ6F5r+eFvlca6lTvFRRjdCVj7BpMFJt7JLkiu4OEOGEa kgTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753056; x=1762357856; 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=uKr5Bi2eQz1IQt5nF2ox0QSeE5cWUROzQSNoAdPSO3w=; b=xLRYJsYhaORC2QUr5PudwgMhKoxpU/qJ3UI4fKU7UbO21MW5eVUjzJ0gLq6CTwWBJL 1wjghgE+rZZu/q9zHRuir5lX0pLTYoMslWFQOMuOnaIMVWA12RzcQkx4G2b1Un4kJVIQ 2Zr/KfkfRoP3qWh0SZ8e1NFe/LerhuU+fwuBX0XR171x9eIBOVSyOiPRqB2DllOhbh+v sG2+KoJh+5Zv3k6W1bt5GA0r330339mMgLq3DLUjc9CWwvRik9ib8byEqInpCIig6sAX ZmjO8aFZmGi8hjZkJBTv1iRw1rTdayuyzmghuk1aEOS46NSZsxXvs2rrh/l0+RhO3Zz/ dJgg== X-Gm-Message-State: AOJu0YxfqW8Md/69BBY1QFDf7/yqyIA9s8zNFRVfC1p5aBR/gkMdxrFp 376CP2D3wteiMksKxKjZYLYwmhElnEUiq8f/Uk5wweXIVVbMIJYfi1i4lfzXNLJ0i7c= X-Gm-Gg: ASbGncvV8EuC3GzWqmcvd5XDU3iiVaW3mll35eQyEijLL9TPS16GmD+6NyI/1QE1Fx0 F3UsX7suNpJMagciWjtxTDsVlP/OfX1+QI2MSseXWVPobuS0IEBbTkRzeYO/+azNu7MHqJ6dNjn VDu1620t7s1rckr1f6vSNzs4UX1WxVaMz0Ch0X4jPQ4DINMVayWpkTkKOrvThZzK4jF+KPzQ93c rTFFvH2rmhrPqNunxGIJ5tzMItfkSiuUUk6qXPRcCpGmidE9kvUZUnEkR4TZNM7SsjUwWyrRS4Y bb+0kf+0IAXDRgv2P7SC5C7IA0RflFCa72VYQ8eLkqiI29F9ChjrJ/5Y0NOeQQgUXqfmNiXSvJM Jy7uQlweDZcDvjvDCz0zwdqkMqk65pBrh0gkphR+YdOeYJTnsV68FpxAfH2tdGf+7SLq7bfUDh9 Y4 X-Google-Smtp-Source: AGHT+IEL8nmpTqhO/IIboP1gvLXDS8d8jXq0dbS95ogw7yzy9fcgSvuGx7kFyAh3gCtZGZBFrBvN3w== X-Received: by 2002:a17:907:9496:b0:b3c:3c8e:1896 with SMTP id a640c23a62f3a-b703d457176mr300504466b.42.1761753055992; Wed, 29 Oct 2025 08:50:55 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Michael Rolnik Subject: [PULL 13/35] target/avr: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:22 +0000 Message-ID: <20251029155045.257802-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x633.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, T_SPF_TEMPERROR=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753187592154100 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places the hook for AVR targets. That architecture appears to only know interrupts. Reviewed-by: Richard Henderson Signed-off-by: Julian Ganz Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251027110344.2289945-14-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/avr/helper.c b/target/avr/helper.c index 4b29ab35263..365c8c60e19 100644 --- a/target/avr/helper.c +++ b/target/avr/helper.c @@ -28,6 +28,7 @@ #include "exec/target_page.h" #include "accel/tcg/cpu-ldst.h" #include "exec/helper-proto.h" +#include "qemu/plugin.h" =20 bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { @@ -102,6 +103,8 @@ void avr_cpu_do_interrupt(CPUState *cs) env->sregI =3D 0; /* clear Global Interrupt Flag */ =20 cs->exception_index =3D -1; + + qemu_plugin_vcpu_interrupt_cb(cs, ret); } =20 hwaddr avr_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753350; cv=none; d=zohomail.com; s=zohoarc; b=UmnouaTlV6JT1Rx3dhzGNNMADjrNrAQgIw0ULNK3xpuFBG8iemD7LkLh5VbSFh/smWudZjRbVtY6aGrVrIYAeeW5LFYNIcfDI6meQlrjSBRT8BgC6+x3klclupplTpJovarXyi8R7qVGu/cWAef8kez6EIkSYhx2wcbNsIA3rt8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753350; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=c+ln+dG2wKaF7Yw5cmZbQoKlVg9Z7JYXIwQU5UuyNBg=; b=D75/4yfD6EglQAb18TrGEmirnoftQAXK3fJlVGQhwomX3iXd8FOnssOUYRRmjUHYMb1bf+UK0zWuSf/2vB2U+vMm93fLZiOHPVcyWmAJzZXSccZfzK8w8bj9SIJLCN51CeZp1n1YeUSLkYKCmygKcClii6fFQvSG2Nqd5oliIik= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753350646204.3982492188278; Wed, 29 Oct 2025 08:55:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8SM-0004W7-Ru; Wed, 29 Oct 2025 11:51:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8SG-0004M3-Jo for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:21 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8S0-0002uA-VM for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:20 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-b6d3340dc2aso16634966b.0 for ; Wed, 29 Oct 2025 08:51:01 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d8ceeaffasm1483828566b.45.2025.10.29.08.50.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:54 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 3D84C60A0F; Wed, 29 Oct 2025 15:50:47 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753058; x=1762357858; 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=c+ln+dG2wKaF7Yw5cmZbQoKlVg9Z7JYXIwQU5UuyNBg=; b=GtMsZsnqj/vBDJplgNTIINcwMHXTLyWZxWfevUCJAjA/pONxNUcZELOOc/5+qq6N0z qxrXguU2b5CLhUMzeYAJzHE/I99NyQYR9TP79a5KMX3HyyyjlrZ6qJ26nEn36e8m7GxL EPGXwOL9DCGFkuZVWsQKdMP/kKBmiT0u68uXGWdHu/t4QyG7+boaH5O7a/yTJSDP6wt0 /m+kf2gll+ai5MvcxHfT0+zhikbENeA87TvoIIFtC06AZOTuag6vpV0xTj8ghOiUaSie USdOh6TzMEpPMNTpSZkOaRfpaASpu1Rf+/9cvrFe3jLjHpMxANt01J+QyEQDOT5/WTgk OX+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753058; x=1762357858; 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=c+ln+dG2wKaF7Yw5cmZbQoKlVg9Z7JYXIwQU5UuyNBg=; b=kOQgnYZJfDDco7T8OcF7bs+Q+3ezRaKbDMbBA20uQ6461yZuIVw1QusEGeRFlHj4kt g17linsNBmOspvrokYSpm3WW5aklD5I5FyTiUBdiODERVsFWeIbmEd1H/UkSJG5d3QPB 4NDk6kaZaeaaAmqF5VESc5Ugozaw0ho4ark2mG0r5LVQh5xfHkk9ttJtqkXqeyxsqiRW aCFbd0I2uoyAGM+9R57YjmhA8SxjRl8cq4OxC8Nmz1vaA5AXh4ME4GGY/jG8NZSIB0fX KO8DSqLFjzHOTMFIHR4ZWLpdB28j1ModsIipxpqmgT7GTcnR/30YaHLYcm1bz1LA24Ch rzOg== X-Gm-Message-State: AOJu0Ywk+gVY4wDCDQ8uzAUQJCruWpNkq+v/fCPBH2nPu7RVXSOFE/JE 2r6CKmUUPi7lJiVxOjcCQ7JyDwS0E+XocLoBcuXSR/YvMd9w+D4GMwbTu15iiRfJhlQ= X-Gm-Gg: ASbGnct5jAi8yMoAzY2vLDNR0bj+JkpyEC7TJz0FFliG3zQbxGeNTf3IpGn9XyuvTyw ZwApTckMpbkbVcQQCHee9WegFSSaL/+re3SVK3/ZbEo+fq5aVXfqunQHRSZX3DeGlUYd0MDulHm yK6iYJgTOPdhuBlJX+l6Ng53pdaq5c+iizmYXwSQgDyW+SHlryGOI1SBknP5ulBOV2xdwj6F3Mk GIFQEuLzQXOrFY0XZD6gomFErU5ahDGd3NuJgyUI4HwuSRJ0XqA8KVqane48Ni/DQNSCgTWvwfU QPUKdwbzuR8N9CEs3BsDhm5wlGoXHz0v27+PmyjPXBn4I/qcu4lAsTB5L/BtcLOcyj18fTEDfui +547RQR+i24nXizEZCNAtgq7fhdp8DRN2QnXXQi5IEZur5xE+SA6N6AohxWupxs/iz/tXnSEYPi Kl X-Google-Smtp-Source: AGHT+IE7fNRKVHFhU42Qa+DYrRxvU564A9e6wdbDkcv5KG7BLGz2/w5HaBW7C1n6aXfKBMZDZ6J76A== X-Received: by 2002:a17:907:6d1c:b0:b6d:6650:c3cd with SMTP id a640c23a62f3a-b705212b084mr6520066b.21.1761753058400; Wed, 29 Oct 2025 08:50:58 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Helge Deller Subject: [PULL 14/35] target/hppa: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:23 +0000 Message-ID: <20251029155045.257802-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753351457154100 From: Julian Ganz We identified a number of exceptions as interrupts, and we assume every other exception is a (syncroneous) exceptions. PA-RISC appears to not have any form of host-call. This change places the hook for PA-RISC targets. Signed-off-by: Julian Ganz Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251027110344.2289945-15-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c index 191ae19404b..4e4869285b5 100644 --- a/target/hppa/int_helper.c +++ b/target/hppa/int_helper.c @@ -24,6 +24,7 @@ #include "exec/helper-proto.h" #include "hw/core/cpu.h" #include "hw/hppa/hppa_hardware.h" +#include "qemu/plugin.h" =20 static void eval_interrupt(HPPACPU *cpu) { @@ -95,6 +96,7 @@ void hppa_cpu_do_interrupt(CPUState *cs) CPUHPPAState *env =3D &cpu->env; int i =3D cs->exception_index; uint64_t old_psw, old_gva_offset_mask; + uint64_t last_pc =3D cs->cc->get_pc(cs); =20 /* As documented in pa2.0 -- interruption handling. */ /* step 1 */ @@ -212,6 +214,21 @@ void hppa_cpu_do_interrupt(CPUState *cs) env->iasq_f =3D 0; env->iasq_b =3D 0; =20 + switch (i) { + case EXCP_HPMC: + case EXCP_POWER_FAIL: + case EXCP_RC: + case EXCP_EXT_INTERRUPT: + case EXCP_LPMC: + case EXCP_PER_INTERRUPT: + case EXCP_TOC: + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); + break; + default: + qemu_plugin_vcpu_exception_cb(cs, last_pc); + break; + } + if (qemu_loglevel_mask(CPU_LOG_INT)) { static const char * const names[] =3D { [EXCP_HPMC] =3D "high priority machine check", --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753179; cv=none; d=zohomail.com; s=zohoarc; b=Th+DE35ccCkZdgtwxKVxeMh1GPAyaa09Pg0kaCOAkGE2VGj2Oa9GeihHebSlpmcw9anqMGmtalQ9ZWDOufBlMbmeGeABSxU8Hypyu4tbV5DYsePcXb5bxCNNY/IYNuwtvQNR1tCtF9QLpKoVnQffx5Li1D9orF/dlXMyDAcblzU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753179; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sq/TUmwSETrlaqqQV4sQGzo1zOqcOiHNyoh3bdGBVw4=; b=TT1pyUDiXi1Yii7in47UyB1vWHRQ5UE2w9wd1q+Wm1w3C2tS6Y3NMommVfpDV5UCWqjmviaak7yHh37o8i1Tos0bpEBOYQVE4Mf/h98ak88TDpKc1z/cQ6l2MXnxuuKw7pepe25d1pkjyosumlamEd4Xccj0KCMHCz0eX98GrO0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753178999111.20521254893788; Wed, 29 Oct 2025 08:52:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8SF-0004Jp-9x; Wed, 29 Oct 2025 11:51:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8SB-0004Du-Td for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:16 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8Rv-0002tV-OU for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:14 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-b6d53684cfdso6960966b.0 for ; Wed, 29 Oct 2025 08:50:58 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d854430dbsm1454544666b.63.2025.10.29.08.50.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:54 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 5639460A76; Wed, 29 Oct 2025 15:50:47 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753056; x=1762357856; 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=sq/TUmwSETrlaqqQV4sQGzo1zOqcOiHNyoh3bdGBVw4=; b=swKqLKYrf41b2W64MVesEwFgjbx+MYzdXFrH184hJ3VWtHZ5eTPZ2DC06fo6PDS8Tq lazZAqN2VTCMPxM+qi+xgcCgFC+v8vdY4zuyV6yYS1zQyxdqBU8vhOdtd6qYDK0VNtkj w2q2WIVc1l+JhCN/xYLYE26yRpioFNrLEuSmk09WqO85mq24rD4hA+jkV0/pIuY+IykH HmoO8o/rD88SjYxRK1ix8PV4W50YK09EB4prufxQeiuOgYx+AzKaWfk1KRoG2sQn8SMw FvOr+r3YgR8eOwcRCssjgU7RcqLJJvW4HJLqfAVNjvHzkarJciYutii27QDr9ifYnf7H xrTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753056; x=1762357856; 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=sq/TUmwSETrlaqqQV4sQGzo1zOqcOiHNyoh3bdGBVw4=; b=u34Jcp9SZ8DzvjBEjLirAFGRlyR/u1CrTSNovJbvAIQkWVzxtnYlTnowG0k+tqnv3V owqfkPF8ETOeYyBJv/q/oNJ6Zun42pHaemPfuMibMjZdMoT6i6HhNIJLBnoSIJIuDvON eukJF8Wl+85ApbgmkZdDpxrILNVKUWFj52hIpPIXAjBVYSrA2OnhmX0GtdP3NLA/5XQ9 LWbUqGs1kZCGvm5xzXY2MwiIL4aW2EQShcq/weVSY4mu8qAZP8Spc0hFMqfMJdGAzv4I QzaoQNBtcNyGRqEoFF4kwFFvSrsOqzJRwXc2Al1BgcLXXHOACu7m4IpJMt7hzqhMKGvq QcOQ== X-Gm-Message-State: AOJu0YyQU9lq09ySyk6BQNeNcIc94TUmOehUKP409Yup66pPG3WfafRI ud55wrlHDStXxH+zfV/4TjCNpZt2I8pKV2GvgUYWX0IZGWuRzgKKiyv9QLVspSuivNQ= X-Gm-Gg: ASbGncvmY5Nf+5im2WiCmrkY6Cl6VY3pNj74IKkXPXQEos+xQgNq8lHGhWMfr4ZfUaW jN9TPk0SC6P/kWYIVr+2WhrQEE6xJ48StdjZ7YMDlkIEPuZ9Kqjz4S5V6VfrZaIDenI/TEnfL9j 1OQuT0w2S+RVt83USM8LLNWPeGdS43ba5gPUgb59x2ie7soxxrTH+t+gr+O7+Dz441V4imHRjgz HR6yYVJDPxo7KMvX017qBkWXIt3mTGeZCqR3fuY20rO855mpb6fONltmc7cWiQoqgYGndZKB7W2 hUgV7ioDSUkwMajgpWxNfzjk4eVZKC9rGXHreohTEHf1BS3fPavTNumGVmlliBuxwOOkDltgh4T QO67UYkrspoij57W4pN+1G4Urt3z+r8wRjVp6YKX7i/3vHE9dS7q1E7wydiDnstaqpu+KuLJ/IL OY X-Google-Smtp-Source: AGHT+IG74OQPKARQTpIENvif4hlJ0v1eYEstH8OUjhOpOxSQzDx+ELc7GUw1WosxHGQk8lfdgx/i2A== X-Received: by 2002:a17:907:d8e:b0:b54:8670:7c2d with SMTP id a640c23a62f3a-b703d55d49fmr336038766b.55.1761753056365; Wed, 29 Oct 2025 08:50:56 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 15/35] target/i386: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:24 +0000 Message-ID: <20251029155045.257802-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62e.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753181559154101 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places the hook for x86 targets. Signed-off-by: Julian Ganz Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251027110344.2289945-16-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/i386/tcg/excp_helper.c b/target/i386/tcg/excp_helper.c index 6fb8036d988..32f2784e923 100644 --- a/target/i386/tcg/excp_helper.c +++ b/target/i386/tcg/excp_helper.c @@ -23,6 +23,7 @@ #include "system/runstate.h" #include "exec/helper-proto.h" #include "helper-tcg.h" +#include "qemu/plugin.h" =20 G_NORETURN void helper_raise_interrupt(CPUX86State *env, int intno, int next_eip_addend) @@ -93,6 +94,7 @@ void raise_interrupt2(CPUX86State *env, int intno, uintptr_t retaddr) { CPUState *cs =3D env_cpu(env); + uint64_t last_pc =3D env->eip + env->segs[R_CS].base; =20 if (!is_int) { cpu_svm_check_intercept_param(env, SVM_EXIT_EXCP_BASE + intno, @@ -106,6 +108,7 @@ void raise_interrupt2(CPUX86State *env, int intno, env->error_code =3D error_code; env->exception_is_int =3D is_int; env->exception_next_eip =3D env->eip + next_eip_addend; + qemu_plugin_vcpu_exception_cb(cs, last_pc); cpu_loop_exit_restore(cs, retaddr); } =20 diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c index f49fe851cdf..667b1c38696 100644 --- a/target/i386/tcg/seg_helper.c +++ b/target/i386/tcg/seg_helper.c @@ -29,6 +29,7 @@ #include "seg_helper.h" #include "access.h" #include "tcg-cpu.h" +#include "qemu/plugin.h" =20 #ifdef TARGET_X86_64 #define SET_ESP(val, sp_mask) \ @@ -1192,6 +1193,7 @@ void do_interrupt_all(X86CPU *cpu, int intno, int is_= int, int error_code, target_ulong next_eip, int is_hw) { CPUX86State *env =3D &cpu->env; + uint64_t last_pc =3D env->eip + env->segs[R_CS].base; =20 if (qemu_loglevel_mask(CPU_LOG_INT)) { if ((env->cr[0] & CR0_PE_MASK)) { @@ -1263,6 +1265,8 @@ void do_interrupt_all(X86CPU *cpu, int intno, int is_= int, event_inj & ~SVM_EVTINJ_VALID); } #endif + + qemu_plugin_vcpu_interrupt_cb(CPU(cpu), last_pc); } =20 void do_interrupt_x86_hardirq(CPUX86State *env, int intno, int is_hw) --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753348; cv=none; d=zohomail.com; s=zohoarc; b=RqGom/cubfFNpthUsiS+0f5mvQHFhYtgy+ZGS3CO6pt3NewqNcCsAaBYJuHqsHspKWFcUMGzCon8xpGI0A8dhdDfV47+VnF+cUyqFMB5paIFAGx3Jnsa8tIAs5uNBL1uusJvdPo0DCKJTt9O5NGWrGBoWf2gMsq5pyt0o0H7lew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753348; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4mvGSXD8bq+JsCFwOFVuxwpiCx0oCJyPaBH3O6zMDgo=; b=ksDISPzZYukNaQxl2Q4WUh9RCNMt1VKcoDl7gpE8XYzWd1XLLb9DeCUZJChr+MQUkbjRW1lEuWNAvdD+wIvHzAZEbtkkMN0gEP5DFOLuVj3t+JFo/Sv2l5dzJ7dDX1HBSEEh8qMgo+P9CWK5zVPqsJShX15zAzueHmAAlJkFDLQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 176175334825424.577230071167378; Wed, 29 Oct 2025 08:55:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8SO-0004Yi-UV; Wed, 29 Oct 2025 11:51:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8SG-0004LG-AF for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:21 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8S0-0002tn-W0 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:19 -0400 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-63c09ff13aeso12914624a12.0 for ; Wed, 29 Oct 2025 08:51:02 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d854430dbsm1454545066b.63.2025.10.29.08.50.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:54 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6EE5560A94; Wed, 29 Oct 2025 15:50:47 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753058; x=1762357858; 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=4mvGSXD8bq+JsCFwOFVuxwpiCx0oCJyPaBH3O6zMDgo=; b=BRU7IlRwCv94jkwSdvkhzofLiKoO9TUbgetUMKO0Zi308XQ+vWw5oX1vCBLzLw9Dcv lft5z6MhnAV8+LftYmnpE2pHeUBN77Y9+4Ht+pfuBrSZWNffWd2u7y1I40pPAV0ETWti RXkmbw0IsBrbk/LxIO3L/to5dOavtyQVyUJ0s9ARM7DYVMNHJ4kHQr66kvNEyeVLNwFt SELAJ0YGawFVmLRUb05ruqbUMRVC2MgTFQpDwpkNMUGLmRJpW5gZW0pzpt7HSvv8+vC6 1t7UI1tBKKjmvFNjtPfvDj8aam+JNYkIaPu8E34UXRCmUlB15yDp00rq4sS0TUEim8cs Jlsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753058; x=1762357858; 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=4mvGSXD8bq+JsCFwOFVuxwpiCx0oCJyPaBH3O6zMDgo=; b=stWnKX+d3foD9ZZeyaHIiomE9z4n3r+9F1dQVS57hRjQ6iOv9ZsUGqbLbqPOLJvBBM yoy9N5UozfbmZbuSPsqDXX2K5aAckhqXlIx3S7Tp6Iyq9dyX0MBSCX82+QxPUbhp2AaB 8aXsd8xhQuaqJlRuN3ifZNFp4gsFZXcqq9cKgBekPy/nGbFIJ7WkS/i1ij39i3iw0Ymo eVV6YJCJ43MqZER5oAeB6/S6VlTbKe1mUP3WBlA7y8NpQlH1Ow0/HCCfUSFRRSwHCSOQ hi0wwaIhiaDspWNPMysGeHfdE0AZr+i7VxwInNCjhkVEx93/PfgiglBv1ubs28WvQwOY msQg== X-Gm-Message-State: AOJu0YyZri15wgtBif+SaFORkVtt7TlY4X7DKvVboKvyK56fVQCsVVSe XKvt+DONqKZVjgF/yfKjb3lYHI2hcp05jI1LEUGBrSGaAJTzFKCoAKKOuw9LOxhbzFo= X-Gm-Gg: ASbGncv2/eIE+DzedrLSaAJqWBs9U3QAM2oKECFu4X6519yjwRiF9bB+VSAN0h1JTMo youYIRxQ9WbCN55s4tdixZlrvZErwuMSpMoKD6omprOGI4OLG5aoxqWLGieWYH0cxscPbUgEPJE Kxb+obKA3S6Nso/dAc1iZWMoyAYm4FuNxqyqKcMWMzMXFPqMnmlUCBpyT0SuNV9kkHWMyZ/10hm 2ydL6R+ymCAklcYFIzH7khh8BerXPUvy+XYxLBomzUXAk2uFT0upCZXejVDoJk6GhPh89m6E8FZ f+r8JbwN2f1NMO+tsOZouEm43v/QAm4PkM0U3CmUIi9m2hmqVILPL2K+YUnTAsmqc6r8M1UU324 8KfdbbKvHoWi1HGKJDCoqRZ7/qYAoqfO94sLqMbkLrnnlXvhSChW7EgOdapAIPOFhbW/hn8l/uN Qr X-Google-Smtp-Source: AGHT+IEVJ5MdooYOp5TOvHPq+ldR6VCsJqEyAY5pUcrR0/U7mZSSZuKPkBn8vTOO3Lp2bmhDwMu/Fg== X-Received: by 2002:a17:907:6d1f:b0:b44:fb0c:5c43 with SMTP id a640c23a62f3a-b703d57201dmr347158166b.57.1761753057830; Wed, 29 Oct 2025 08:50:57 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Richard Henderson , Song Gao , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 16/35] target/loongarch: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:25 +0000 Message-ID: <20251029155045.257802-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753349650154100 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for loongarch targets. This architecture has one special "exception" for interrupts and no host calls. Reviewed-by: Richard Henderson Signed-off-by: Julian Ganz Reviewed-by: Song Gao Message-ID: <20251027110344.2289945-17-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/loongarch/tcg/tcg_cpu.c b/target/loongarch/tcg/tcg_cpu.c index 82b54e6dc3c..9d077c56d9d 100644 --- a/target/loongarch/tcg/tcg_cpu.c +++ b/target/loongarch/tcg/tcg_cpu.c @@ -8,6 +8,7 @@ #include "qemu/accel.h" #include "qemu/error-report.h" #include "qemu/log.h" +#include "qemu/plugin.h" #include "accel/accel-cpu-target.h" #include "accel/tcg/cpu-ldst.h" #include "accel/tcg/cpu-ops.h" @@ -80,6 +81,7 @@ static void loongarch_cpu_do_interrupt(CPUState *cs) int cause =3D -1; bool tlbfill =3D FIELD_EX64(env->CSR_TLBRERA, CSR_TLBRERA, ISTLBR); uint32_t vec_size =3D FIELD_EX64(env->CSR_ECFG, CSR_ECFG, VS); + uint64_t last_pc =3D env->pc; =20 if (cs->exception_index !=3D EXCCODE_INT) { qemu_log_mask(CPU_LOG_INT, @@ -190,6 +192,7 @@ static void loongarch_cpu_do_interrupt(CPUState *cs) __func__, env->pc, env->CSR_ERA, cause, env->CSR_BADV, env->CSR_DERA, vector, env->CSR_ECFG, env->CSR_ESTAT); + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); } else { if (tlbfill) { set_pc(env, env->CSR_TLBRENTRY); @@ -208,6 +211,7 @@ static void loongarch_cpu_do_interrupt(CPUState *cs) tlbfill ? env->CSR_TLBRBADV : env->CSR_BADV, env->CSR_BADI, env->gpr[11], cs->cpu_index, env->CSR_ASID); + qemu_plugin_vcpu_exception_cb(cs, last_pc); } cs->exception_index =3D -1; } --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753706; cv=none; d=zohomail.com; s=zohoarc; b=Ezf8vUiNAqtiwK4PkWzWF4HUbPHZZ9Sb1dvhHusspU3kBq27lpV1OjaeWFNXZi3IvJRxZ+M0WQJiRTpAszVs0x8CiTd2mfSf0bSwYrjSTdxDnteAy1Z/b/pid3u8+LsBfabYEIW9CLDmrGMkSjP1Xpe7sMG8Hllwj7l184VFW4A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753706; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ho1xOLvnUOE2rAtG4NNgx7NGGv2rZs1C03ISFU94cQY=; b=XL4vazgU1wMigKPGLO9aYTzmbIFl9+irRtgZFaUlHYhVzZKBUx/T7fHT9LBR2qxk49vnmvoxWQbEwv5+H2CpVNs4YyoxcE6A4KMbvZOdwHBvdr/A/NkRMsp4QEnJVAIea7z8ZGGbbhyyXyl+dfxZv7F+P7RV9e9Qq6wD9SEky20= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753706674224.09843221813674; Wed, 29 Oct 2025 09:01:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8ZH-0005vD-1Y; Wed, 29 Oct 2025 11:58:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8Yf-0005Mm-9C for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:57:59 -0400 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8YR-0003X5-U5 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:57:55 -0400 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-b3b3a6f4dd4so7795266b.0 for ; Wed, 29 Oct 2025 08:57:33 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d8541fc31sm1458507366b.60.2025.10.29.08.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:57:27 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 8610B5F929; Wed, 29 Oct 2025 15:50:47 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753449; x=1762358249; 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=ho1xOLvnUOE2rAtG4NNgx7NGGv2rZs1C03ISFU94cQY=; b=JDnf2u2BtIhm+pSUvE3Wz3XAYfrhyfMnMnKtf/aCrNTsCC8U22AmViI+yzi5ZYnWXA qJWJwKuE67agW6InV2+gZychMG9kPVDEI5Ps4l4jI7yH7L3eHheLdqaG5SjJGzYwAxKK mIb+cJggF/tNKw6jKf4yEKDKdwq6+q7SK1Btm3xso43LLwxxtgvc0Fr/IQUJ4ghpivDM KnhGxh3nuXGPmNd3C2Hxtr8FwzETlMDEZhDByiw8Ur3his+kNPaakflz6/WUQ0D+aveb FdLIScjIq+x+uYlk4E19IF7ZwF8Bb9yi0/G+iWWV2/S/jTby61ih7HvdlNU1Bel+hglZ aVdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753449; x=1762358249; 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=ho1xOLvnUOE2rAtG4NNgx7NGGv2rZs1C03ISFU94cQY=; b=Fw/OSNqudU8koJBemZpPAIKUAQjrebIw1yz1tHFh8cjofq18lnl/UuV1ABxqpRnZvq sSR937AFbw3LoAVDOc4VtYpzm5g4mqHnS45LpJZ5hRIVeA2KG9ZX+O+OUMkl7anqYwvC HmnMooy5tPzjDS+1yZ79m/748/ewik4epggWbqBCDoHHB0pM+1o3unyqsCYq6avW8lz9 U2oEmcimY6gDM+jqa7fmBACWL76zLy7ae8IiV7WRfE9PQuNlbvBrJnwJtf2m63FnwwUB bfcz4O89Dq+WySxAzDihCp9dfOMNukbW+Mo90jWiHlJg+MvsbI7rQ7vR1kNP3i2sqdHE sARA== X-Gm-Message-State: AOJu0YwwhVansX37AnxbPbp+j4yHwX3bG8BC9Q++wW396PKAMQRCBWmj VaGzHdv883EcHcW4qQk7TRbcyWV+FvYCvXTMqOaGaBCtd9geeBd64+fnFawGtOBD3SE= X-Gm-Gg: ASbGncseM9jSV3jBFsZ0Esm5wiCWXJyEni/Zhz/EGiz+gXZvSNxQTliBVW0mLoBgs8G KlHZhx/KFYQDmkgnmNJ1syR+297M2uS7+osA6d1BvSyiCpGqfjPeXV2pr5UqiGZstcDsWbMF6kC EEq8QS1KJ9KoNEtK2qSR+awPokuP6UpHhd74TNVCnrGV6lVuDFf1ECJvpgmMmrs7xNCF7fijMCu uYf4g8zHqlrZOiz72eqmNngYBXVhithiSRkMdoQ5Msmmhg4vNL55wbJJEHML408tPU0TXJh+a+P oKzTaPhRNOGLksFUCF+GbGMzSHJgLP0IsFvl7Bx8Bet7TPBzY5bRDO7gMBmrnRNeMlbACMYyjGI VoUazagcBdIlrGTyvTYuJqTyDPPRQ49VIr94DFECeXOrIvUDHVybFV+1UokI4PzSUQ4EBC2j/lL zr X-Google-Smtp-Source: AGHT+IFqlCMGlEgviwc8U0M+EKB/vdZRqFt9uG9JK9q4jw5HEyW/eQbBUiVtJTbVN6mxsQ7i9neDjg== X-Received: by 2002:a17:906:fd87:b0:b4f:e357:78f8 with SMTP id a640c23a62f3a-b703d5c70bamr352665666b.52.1761753448905; Wed, 29 Oct 2025 08:57:28 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Laurent Vivier Subject: [PULL 17/35] target/m68k: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:26 +0000 Message-ID: <20251029155045.257802-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753710841158500 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for Motorola 68000 targets. Signed-off-by: Julian Ganz Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251027110344.2289945-18-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index f29ae12af84..e9c20a8e032 100644 --- a/target/m68k/op_helper.c +++ b/target/m68k/op_helper.c @@ -22,6 +22,7 @@ #include "exec/helper-proto.h" #include "accel/tcg/cpu-ldst.h" #include "semihosting/semihost.h" +#include "qemu/plugin.h" =20 #if !defined(CONFIG_USER_ONLY) =20 @@ -183,6 +184,21 @@ static const char *m68k_exception_name(int index) return "Unassigned"; } =20 +static void do_plugin_vcpu_interrupt_cb(CPUState *cs, uint64_t from) +{ + switch (cs->exception_index) { + case EXCP_SPURIOUS ... EXCP_INT_LEVEL_7: + qemu_plugin_vcpu_interrupt_cb(cs, from); + break; + case EXCP_SEMIHOSTING: + qemu_plugin_vcpu_hostcall_cb(cs, from); + break; + default: + qemu_plugin_vcpu_exception_cb(cs, from); + break; + } +} + static void cf_interrupt_all(CPUM68KState *env, int is_hw) { CPUState *cs =3D env_cpu(env); @@ -203,6 +219,7 @@ static void cf_interrupt_all(CPUM68KState *env, int is_= hw) return; case EXCP_SEMIHOSTING: do_m68k_semihosting(env, env->dregs[0]); + qemu_plugin_vcpu_hostcall_cb(cs, retaddr); return; } } @@ -239,6 +256,8 @@ static void cf_interrupt_all(CPUM68KState *env, int is_= hw) env->aregs[7] =3D sp; /* Jump to vector. */ env->pc =3D cpu_ldl_mmuidx_ra(env, env->vbr + vector, MMU_KERNEL_IDX, = 0); + + do_plugin_vcpu_interrupt_cb(cs, retaddr); } =20 static inline void do_stack_frame(CPUM68KState *env, uint32_t *sp, @@ -277,6 +296,7 @@ static void m68k_interrupt_all(CPUM68KState *env, int i= s_hw) uint32_t sp; uint32_t vector; uint16_t sr, oldsr; + uint64_t last_pc =3D env->pc; =20 if (!is_hw) { switch (cs->exception_index) { @@ -417,6 +437,8 @@ static void m68k_interrupt_all(CPUM68KState *env, int i= s_hw) env->aregs[7] =3D sp; /* Jump to vector. */ env->pc =3D cpu_ldl_mmuidx_ra(env, env->vbr + vector, MMU_KERNEL_IDX, = 0); + + do_plugin_vcpu_interrupt_cb(cs, last_pc); } =20 static void do_interrupt_all(CPUM68KState *env, int is_hw) --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753586; cv=none; d=zohomail.com; s=zohoarc; b=P27OYP76tjKPEPHR75XSc5hZHuiDup/RgXG/PZLawD/XwA+25Rp9J7wXsN22jrrZjHxfErqn8OOLbPKjusjAI6//SUP48U3W54pgI6dbmxG6cMfZ929F/j09PpE+7JVRNCeTb2xk9V0RX6KZMQ9zQkml4h6nOvTFlNf2Qh1HxWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753586; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=S6TnzkMVL6YklkleCxaGQEy3FPm7r0vZ+EhWkgXooxc=; b=MOl5wicG6MECV6h+w8F/Ffxy8+4fAaqtDRG5/rx0g7MUv2mx4Bjsta+BeAhw7BWlqBwoQykly8pVIVNsXXmKAfGwpCyOhauI9EFd+njhTKzd9kg+831liQqaxw1aXc7B+RtMfT9bdktogT8TR3SGwm53stTLzskx7DyGVrH90xs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 176175358604424.53548042314833; Wed, 29 Oct 2025 08:59:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8Zp-0006MU-GF; Wed, 29 Oct 2025 11:59:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8Yk-0005Ui-0W for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:58:02 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8YR-0003XM-Tm for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:58:01 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-b50206773adso238663366b.0 for ; Wed, 29 Oct 2025 08:57:32 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d85445e81sm1459774666b.64.2025.10.29.08.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:57:28 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 9E6AC60B4E; Wed, 29 Oct 2025 15:50:47 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753450; x=1762358250; 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=S6TnzkMVL6YklkleCxaGQEy3FPm7r0vZ+EhWkgXooxc=; b=e9FJeSz5pAZ6Eg2s2zmwQjMqGIOdjLtxZ5Kk1rywdqetHGKOVQjvTWl9O/b3H2Gy+l Yrp6Jye4v75ea6aSLyKRJeugiubD8HAOT//q7CMvamQVUD8w+EjFVyrqPhDZw457Hiid vId6SF4++4WYUAFgQQogxdofk91VFo4kKMm8R6R6oN6K8ObjUr23FqXIhpqCQNaUULv0 o02d0kbgvlWkvAOgaAVpJ7E1bAZyRZPX5apWjFedE8ix/7NW+XZ9NF2kH+6+2IITlRma 5TqYNlx2578egwWVivBXAcIaucTcZHS2p3maSDq+Q28VGl5L/AAr2W683jLpVCYZoYYv tAow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753450; x=1762358250; 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=S6TnzkMVL6YklkleCxaGQEy3FPm7r0vZ+EhWkgXooxc=; b=GQTbqsx9ukAZXT/VJrxCN+FIp7fh0YNQ3KY20srKlW+JSKA3T8rqr367Qmutsvn70s +B3ftYSNamZ39Q8SJ1mkML5I1R7U9A9K8IwmOB2GjqXY2GSoisNhiSugaEUowMC9GzOL woIWrcsa54i1Mkl3vEp9F2I8bAHFZKdl+bNcvkkOe0WltvXPu8MmCpTWoXSgHJ2UO8kK z+rmK5i9kQnvvhmOOAt9Z6znACaX/rqzoHB4juLms1Sk3mLDdaoBYMI7BPJXSxVr6VZj QGM++zNVSza5Q86rac33zc3aSD7lQjRdgwPY0aG5kdF9LiDX+2xsViJIQ02c1g9plYh5 LSOg== X-Gm-Message-State: AOJu0YwSjpk0AI8VC8JUHNl6W8rqpoc94hnhFiDIisMd+bJ1oEHh41Lg JN98N1/1cijLeBScN52f/qheXrCl3jfWxmWiAFvwKtilATyfteHts6rSZC3q5Z5eYEI= X-Gm-Gg: ASbGncvZpi1UsonATScplgYtjBMfXXeXlglcHN/BTtMqi/29joT7le7r+R4GE65iSZv 3Jfj2x7tTY6R9XxtaM5cQkJkcWlu1IcfzPVW3RByVKdyliMsqRY7oX6HjlBR8sTzljMOxAcfy3p KQNE3XlCYKzXxKR0cILsGCKYxZqFUjrtLKUQ1/3iEEX9ebC8oRaGYiuyPyTrPtPfjksp9eFq1Jc RiDNUkKffWQDGZkQCaTmcznThLeCWEfU2ZB1YAJyksur+fJTPCRA3UG/gwrBLJT3uJRY9/al/2C gBd/KVQWn7Hfz+Me8uC0BodExrAVysPLyqBK9YinYkx2kIds0J2mMLs7ielTVVZXUECYaseP2WQ deUUAI4EKlD+HAAAQ5j2iBvtUipiThONH5VuYn+SJaZlkVqO2hz0ZKZaZMHZ4W2ul+lq7FFh0zQ eY X-Google-Smtp-Source: AGHT+IEDe6OTxnw8vElqEb5iO57nd3s38uzJLKhBT1pbpZFFcbK0PeP2Fa6C9Nhr9KZWP8KqK5qQlA== X-Received: by 2002:a17:907:7f9f:b0:b46:7e8c:c0e3 with SMTP id a640c23a62f3a-b70520e181amr9859266b.20.1761753450187; Wed, 29 Oct 2025 08:57:30 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , "Edgar E. Iglesias" Subject: [PULL 18/35] target/microblaze: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:27 +0000 Message-ID: <20251029155045.257802-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x632.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753589516158500 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places the hook for MicroBlaze targets. This architecture has one special "exception" for interrupts and no host calls. Signed-off-by: Julian Ganz Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251027110344.2289945-19-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index cf577a72268..a1857b72172 100644 --- a/target/microblaze/helper.c +++ b/target/microblaze/helper.c @@ -27,6 +27,7 @@ #include "qemu/host-utils.h" #include "exec/log.h" #include "exec/helper-proto.h" +#include "qemu/plugin.h" =20 =20 G_NORETURN @@ -35,6 +36,7 @@ static void mb_unaligned_access_internal(CPUState *cs, ui= nt64_t addr, { CPUMBState *env =3D cpu_env(cs); uint32_t esr, iflags; + uint64_t last_pc =3D env->pc; =20 /* Recover the pc and iflags from the corresponding insn_start. */ cpu_restore_state(cs, retaddr); @@ -54,6 +56,7 @@ static void mb_unaligned_access_internal(CPUState *cs, ui= nt64_t addr, env->ear =3D addr; env->esr =3D esr; cs->exception_index =3D EXCP_HW_EXCP; + qemu_plugin_vcpu_exception_cb(cs, last_pc); cpu_loop_exit(cs); } =20 @@ -152,6 +155,7 @@ void mb_cpu_do_interrupt(CPUState *cs) CPUMBState *env =3D &cpu->env; uint32_t t, msr =3D mb_cpu_read_msr(env); bool set_esr; + uint64_t last_pc =3D env->pc; =20 /* IMM flag cannot propagate across a branch and into the dslot. */ assert((env->iflags & (D_FLAG | IMM_FLAG)) !=3D (D_FLAG | IMM_FLAG)); @@ -256,6 +260,12 @@ void mb_cpu_do_interrupt(CPUState *cs) env->res_addr =3D RES_ADDR_NONE; env->iflags =3D 0; =20 + if (cs->exception_index =3D=3D EXCP_IRQ) { + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); + } else { + qemu_plugin_vcpu_exception_cb(cs, last_pc); + } + if (!set_esr) { qemu_log_mask(CPU_LOG_INT, " to pc=3D%08x msr=3D%08x\n", env->pc, msr); --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753452; cv=none; d=zohomail.com; s=zohoarc; b=Pz6tce/1P673qG2MfboMRYneMnnejKOiLr6+kstOR22+9wPv4fC+nm2icE0ifeq7UNWcc/F24GxFk7QmDKxVdk9wBTs/fOL+uexa7d1YUCnFRSAeeqJ/Eg7hkp4Bhd7VXDEcdQJUlKgOpb0+DVYWuLkgsKp1rZcV8HPBOcYujZs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753452; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=uP6UFPzOs5VzsipNmOA4LajH4groxk/LhsikWmtW740=; b=hs0FGQGdfmdRhjLs2F7W/mG5MzNq7yC8Jj8tTsmAeAWF6Z/J/PNxPaEx7XdNPaqHwGdmz7GDyxJr88QVuKIRPknA001xD9kQsjIVD57lA+YhumMMQavkHmy6hb/C1VjZVKprVBoRg463li5548M48oRJavqBcOUeliQRfwPJx5E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753451995121.78752990425698; Wed, 29 Oct 2025 08:57:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8ST-0004c5-7E; Wed, 29 Oct 2025 11:51:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8SR-0004al-OT for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:31 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8S3-0002u5-N9 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:31 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-b626a4cd9d6so2224066b.3 for ; Wed, 29 Oct 2025 08:51:03 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6da1e2226fsm1058044766b.20.2025.10.29.08.50.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:54 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B879E60C1B; Wed, 29 Oct 2025 15:50:47 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753059; x=1762357859; 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=uP6UFPzOs5VzsipNmOA4LajH4groxk/LhsikWmtW740=; b=u8jtZiHVsWGPcH1trNEQeXvRiJbVqKwSLN7QpEXUFfr7gL5OR1Fpud24Qv/FNVkv7z 9SWxGISTTPxFdNy1gRdrRE+5kejASnjk5UWuTlRB4qqb7hze2BGGheBVKXVC6/Mp1d2M QzGlBhdIrH5kWIb8GKyxmqX+1oS8iuremEh/WMPXAcFl9U9norFnXQJdAzSomRMDBZSA vkPBwHDoCUO5e2SBpSPE17wBE51d1Nug2dZm/hk6hpcRNxN1odi8yM7RjFpk5vjD+F5N yIUFjHKoeVHYMYOSGsHnBmgDnnXuJwFHAKouS0tp5lVgKndwiBWbdHVvyZhdN6GRK1TW bBfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753059; x=1762357859; 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=uP6UFPzOs5VzsipNmOA4LajH4groxk/LhsikWmtW740=; b=R5Af8pT2oNCw0mKreL7BGYdr7VhF1BuFYjodGbLUy4rIHhB4Z5M49baXagg7S6zS7p I68oLSUL+U1W5Jjb75lOMTmx6SK3XqPeRflVboGGU2M2zXJXhGD7ePkSQrB/x+M+aQ6g v2Rp/+CL1paz1xLpQuGUJhDP/99RUkY9fm+kchIfvLE8BPAf9u5m4+9kpMn8wwUr/iDU cCGyrkCaFG3KiM4dvUKwBId3cpFwPFCFw+OEL8EG87hmhNF8fhgHh73AZBH7S3YGCqfH 0lp9u147L4mfPz4Gn0HNVA+OX7PujfRK8sq0hdSekRjuddrXWBE4VT5eGlGfr8AEdpwK 5VTA== X-Gm-Message-State: AOJu0YxmstzTKKFSXaTDVvsK0UfN8AcTayNoA+ES8QKofvaX2XDL6BO5 MpHqXYHaE5y/BZ9We5O4AwDfnbQ8Z5i0vs7/e6x7mnplFBOR9y9ot6jH2u/vG3rHQao= X-Gm-Gg: ASbGncvRVUFmInRJI2InHR2q9L0fO4rqP+BVeR385qwBlKl0cw1kb2qF1ue4C1Ao6O/ sGqgcJ3+KzqBoxyJEU1EePKPYGPqzG8+IikYn0YM7JY2Um5kkyYrHOh+3l5T303gangu/2GYGue H5m9vX3YzM3htxV/xn7yAKiRfeqa/b7Lt6vUVNcZZaHVm2dhIrY+3CKjiYEQSBl1fIldrd0GD5d S1gL772ez9y0Pbs37aau3o2GRPq4V/CVsNa9Nv1EVSMk00Lp/jDsOo11+bExu5yQaLZw11CQA8h x/beZnGcYg/01vv+XGbw1+lMvFaaHRA7JX9x8Dj83km7A31A91xYbFQOwSvuVMLqw317edRrF3l TVlGxLE0+NQzmg91rms4gpw+e2+jDfm0gN9augbugbnFmaYYlUYN6XBI/oPf/bvE8GUXToXt5zD p2 X-Google-Smtp-Source: AGHT+IGpjByL7vfdJDTEqRI0K/9K+lVbmHa8nHBQ4Twl3mkC0fc2tNzdooDZxTPPUFY3SRwdcDN76g== X-Received: by 2002:a17:906:c108:b0:b6d:6a4d:d922 with SMTP id a640c23a62f3a-b703d4932cfmr304593966b.42.1761753059029; Wed, 29 Oct 2025 08:50:59 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo Subject: [PULL 19/35] target/mips: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:28 +0000 Message-ID: <20251029155045.257802-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62b.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753452837154100 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for MIPS targets. We consider the exceptions NMI and EXT_INTERRUPT to be asynchronous interrupts rather than exceptions. Reviewed-by: Richard Henderson Acked-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Julian Ganz Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251027110344.2289945-20-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/mips/tcg/system/tlb_helper.c b/target/mips/tcg/system/t= lb_helper.c index 1e8901556d6..566924b079e 100644 --- a/target/mips/tcg/system/tlb_helper.c +++ b/target/mips/tcg/system/tlb_helper.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" #include "qemu/bitops.h" +#include "qemu/plugin.h" =20 #include "cpu.h" #include "internal.h" @@ -1034,6 +1035,7 @@ void mips_cpu_do_interrupt(CPUState *cs) bool update_badinstr =3D 0; target_ulong offset; int cause =3D -1; + uint64_t last_pc =3D env->active_tc.PC; =20 if (qemu_loglevel_mask(CPU_LOG_INT) && cs->exception_index !=3D EXCP_EXT_INTERRUPT) { @@ -1052,6 +1054,7 @@ void mips_cpu_do_interrupt(CPUState *cs) cs->exception_index =3D EXCP_NONE; mips_semihosting(env); env->active_tc.PC +=3D env->error_code; + qemu_plugin_vcpu_hostcall_cb(cs, last_pc); return; case EXCP_DSS: env->CP0_Debug |=3D 1 << CP0DB_DSS; @@ -1336,6 +1339,14 @@ void mips_cpu_do_interrupt(CPUState *cs) env->CP0_Status, env->CP0_Cause, env->CP0_BadVAddr, env->CP0_DEPC); } + switch (cs->exception_index) { + case EXCP_NMI: + case EXCP_EXT_INTERRUPT: + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); + break; + default: + qemu_plugin_vcpu_exception_cb(cs, last_pc); + } cs->exception_index =3D EXCP_NONE; } =20 --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753528; cv=none; d=zohomail.com; s=zohoarc; b=F/KipETdtOUAmhLTRJvfhbhklPFa3qD7YwPCkJmjt2bMaTYd9iADVt8iFRMwG4Nx4vMT4DwFnISxfq/DZxABtpbjPo+D3kS64Ldpbn96ovEyv0FkDbJQXpz6ym75igRXEEr6S10o3ZMGlINohFI0OsKbONckI9eLohLRGh1/0qk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753528; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TrDTvZiJG4yDG73wsRxB9Wak97hDmOb6p4nvdjA0DcY=; b=Ht+cxI3qP1THz4peIoEHamr9BzKdSrjv2jzMg8jlzcaNXaKWi7OUuyOdtA3YFJmcXSGQbbJNN/m+aEfHCpXjt0yxUfQ69+cB+tbO3oh11ckcZW1BhYPqiLLbGiAv7Pn0je19F4lASnKg2G0ioOLzqSrRutpwOmbd36WjANAX1rQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17617535285049.826611518062009; Wed, 29 Oct 2025 08:58:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8Yj-0005Mk-4C; Wed, 29 Oct 2025 11:58:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8Yc-0005GG-Cd for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:57:55 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8YR-0003Xr-05 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:57:53 -0400 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-63bdfd73e6eso2196628a12.0 for ; Wed, 29 Oct 2025 08:57:35 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-64043e05a5esm2528748a12.4.2025.10.29.08.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:57:30 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id CF74860CB8; Wed, 29 Oct 2025 15:50:47 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753452; x=1762358252; 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=TrDTvZiJG4yDG73wsRxB9Wak97hDmOb6p4nvdjA0DcY=; b=NbuT+Q92QdTOl1L2fZ9ey+HdK5kIziIxicX66L9Cno4kIjgGGtQnKCUnnqNv9isBCx 6H7Xptc6LAX4iCb9F1xWIhlq79f4Dua0AO2AxVmLRnR010ZiT4lTznpmoKuwM8PooQJY 85NXqcSpDkqZ3PQDIh95DBPbp7ikf6glywY1FiBUkw+V0pNOmFpIqm8jX7AIzVe8KB89 iHfR+gnZ/rZ4ISeLlju22Ml6/F0Q7YwhrGcQm/trqipIS+sg82c7c+JAirxe7N13O5I5 6q+dPrhlK/A4Lb+o3oobrPi7pBbP5iMcw9JPIMUV1KHkA6UJx5zXQo+CcMWh91LVBuW0 YbjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753452; x=1762358252; 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=TrDTvZiJG4yDG73wsRxB9Wak97hDmOb6p4nvdjA0DcY=; b=J2UW9vTsyTyepVus/5CCor9qVCfqtKQZwjCMKjF1RIvAuiRPtA4Dk5KcAkzFCt0IJv +PZygEjWdo9Z+6yugw4sRVxZu/iWCVQPLA/9SiZGdykzA9PxxAWdNWQHY3jBfGfktM06 CuaRbiV8sM1QD+F6V1WovvO98gZroWb9tpWLzHYhOwt6gCKAsih7z9HdmKbYVnOk8rKg d6KK82Pt3tCyCb0w/BCmXIgXvfoooNp/WXSA+b3PA3h3bG9HaAuJOzrHFUTf9PyG3KP0 VghN1vl4rME8xcGEics2AI+IaKc4avIU7t69uJWn3vERMv4VJV3kyhamM8CHSgOMNNVo 6dng== X-Gm-Message-State: AOJu0YzBkg2eg9IwcG1zzLymCh0OBBybYCg6VEdjUhlT7EiGb7Y6jR9+ vhY57esptbL8vhRrnUvVtPtiQKTV9j49+Pelv1Xs56lMp3z1Tyt0ZAMI+/5pwM8xP+c5EJC/PRl EvOCS2qs= X-Gm-Gg: ASbGncsNywzUulNg8KSb4DAaszpi5WY6li5BVaHE7v3A45MAEJiReBLnY5Zndnny0lE 2uFZn8AYnTNNvGODs+LZIaeAeKRpiyKGxUFPKBS0NHi/1WQQEk6ErjfZ9g+Ia9Er9K0zeXW41A8 CaoTGgDGI5h2h3w/L7uOnDoks1y1H+S3l4YI6iZA6w0Q3IKjh7GlMiN7FU+P5KJePyApI83gfTS glvpcKcSazDprDQFWQ/Uyj1kd9bJtWyoHuN+GDc2quNglZupT9yuq3DkCPXhz77faIH1pGKvYYv T8CRuxyOs15pCe/J1fC5s8YfFPWGliXLS0o/nR85Ml3kU2dKKqyVhfsfHwFcoflIpH7NxQwowDC PjWEnnWWvQom44qVq9fyu0MmCfQEpt6zNrjI7M12MNg+vKGB08PYrDYFKb5R5fToCN6VOra+Eeq yL X-Google-Smtp-Source: AGHT+IHg1BTnAUZG3sy2mU17DsFflxDrw/5NGVNoDUZS80xsCyFNi0XKXTSARZ8Ipw2OPWdnNzRNtw== X-Received: by 2002:a05:6402:5165:b0:62f:9091:ff30 with SMTP id 4fb4d7f45d1cf-6405e7cd523mr76185a12.3.1761753452610; Wed, 29 Oct 2025 08:57:32 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Stafford Horne Subject: [PULL 20/35] target/openrisc: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:29 +0000 Message-ID: <20251029155045.257802-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753531589154100 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for OpenRISC targets. We treat anything other than resets, timer and device interrupts as exceptions. Signed-off-by: Julian Ganz Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251027110344.2289945-21-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/openrisc/interrupt.c b/target/openrisc/interrupt.c index 486823094c8..d357aaa7da1 100644 --- a/target/openrisc/interrupt.c +++ b/target/openrisc/interrupt.c @@ -25,11 +25,13 @@ #ifndef CONFIG_USER_ONLY #include "hw/loader.h" #endif +#include "qemu/plugin.h" =20 void openrisc_cpu_do_interrupt(CPUState *cs) { CPUOpenRISCState *env =3D cpu_env(cs); int exception =3D cs->exception_index; + uint64_t last_pc =3D env->pc; =20 env->epcr =3D env->pc; =20 @@ -98,6 +100,19 @@ void openrisc_cpu_do_interrupt(CPUState *cs) cpu_abort(cs, "Unhandled exception 0x%x\n", exception); } =20 + switch (exception) { + case EXCP_RESET: + /* Resets are already exposed to plugins through a dedicated callb= ack */ + break; + case EXCP_TICK: + case EXCP_INT: + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); + break; + default: + qemu_plugin_vcpu_exception_cb(cs, last_pc); + break; + } + cs->exception_index =3D -1; } =20 --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753691; cv=none; d=zohomail.com; s=zohoarc; b=d8N5iTI9oHpuJfRpyuUmYL3PcqVNXh0+xv7tL/53oRNbAaXr73zH2N9OG44ZjQtZWp/nqT5YfsD5GkfqC/z1PEXbfWHA44ADHmiDwecf9oqafKxaiVurpfs82x8sBBUI3xXXEoo6q6h0gHFKW4dD7m0vjBmKu4u7lB+E1oF+pYM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753691; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UVNbDVVHMFokssKdvhxJv3BzMGLnbgSkMxsQpkTlVCE=; b=lEGGTqUsnZeitGd5sHdI8n1CsJi/GpKWNc1vAAS2wstD7ojRLHAURW9IVg5QyP7KChRFVouwcWbOTYCG13oh0wEC3WeXhXHFX1U43c9LKQwvYevdfvjx7n6y0wN8Bdqw95EVlMULhRDp1P9RjcLjzwINqoswbJo4s8nlWR4lNU4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753691380198.28674043241074; Wed, 29 Oct 2025 09:01:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8ZV-000620-Rr; Wed, 29 Oct 2025 11:58:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8Ys-0005nP-4G for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:58:11 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8YR-0003YS-Tp for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:58:06 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-63c3d7e2217so13853632a12.3 for ; Wed, 29 Oct 2025 08:57:37 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-63e7efd0c1fsm12326567a12.37.2025.10.29.08.57.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:57:30 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id E77505F909; Wed, 29 Oct 2025 15:50:47 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753455; x=1762358255; 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=UVNbDVVHMFokssKdvhxJv3BzMGLnbgSkMxsQpkTlVCE=; b=YvS94LAm85I8w0LzkwVHyLEbDQWvTLVuhx1kZsqak5n1KEi84d3xoHPRO0suwSzMuf Q/tIv60hn7U0fJDVEYM8diV1MTDIR0BYZGIoc4Bo82PqM1OCj3xnNiyfrounjUdf21eL EMBlvpyfxXA96bQ5idexAhNgwH+YFp7QHtOsquCT7Je25mu/BJqygaRqjiQ1RX3n/U85 WEncHTqWtvZavaCAIUZ1SeJQBHoLxMrf31RF+2E1PHK8bm+FMy1SkdCK22cdlm4mslsq yeJspTPIjrQsklp1PnApAI0E/ySP1pG19HrxYcbC4dMIc35LZasCunOoKP/PceX65Fsy AG5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753455; x=1762358255; 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=UVNbDVVHMFokssKdvhxJv3BzMGLnbgSkMxsQpkTlVCE=; b=q4/rcHXbqhTyQ/XfK3KVeojP7KSgJci39bNtqp8vDQLXL9XNHRbNbRhVCKHyC+j3R5 H5CmqeZxEOPPyR0X2sm31RoW8oEKtv2ce+9Rd5FvBNVozxeF+0LI3k2jg8bUOe7GbbyW dExO5nQ6+SCISO8ntAUB7EHyfHeBMxjkl3/SWy0HiaY1YWrZMnO11RMl2vXGR8/pp7X4 OK7mq5/8GnjrDRRDh965iPxD/Kz+BJNRpO0e7h40B/+54aQWN8j+GeM/mJA2xE66aoR1 VKMQSHYrIdTuzsmbb8ADzUnwqorhRzCvx3jV4Rp5RrolvtTsei7ziFKOrd6DrQvBIw+2 pDbg== X-Gm-Message-State: AOJu0YxaWDGNd+xXd74l/XCM0xcaMRD5h3JsVbYdxIkoysvMqqbyqfiH wRrSN8fV2QF7ISyUhg391zBxpO185MYfvWEZS/72fyVvBCy9DHVzfW6WNpd5tATJH/TakmpEUOU rrAhoEjY= X-Gm-Gg: ASbGncuhu8/A+CuMCR/08tJJvjTqh1ZU9Ngi4id280GvHf6Xvyz4S8bZ/3xcWXMj9TW oExUo7CZcO9upr2dWZ8z9fQs2lR+QrkGLyJ4YymVvTaYT1QcTm9n5/z66JNtNdCx00Ffup0t19m rsD+wB5ZylZ0dWnqnuWB85IAvUjr6oCeK7XA2tPRJHBC5YYV7aoEzBVDzUFHv56S5iImdL/+FkW frsjqZ0xQsmwqjHOPzIT7UqP4sVfKQFaRpJqtLefXaopeljCJuDAy6DhVFpEBjR8JaRDP6gCcQG C2sKr+FeUCC+4aWedteZOx604WQrHlc+FyfvUtD2NIwXsDitHf2pTQfGbs3FZXCE5TUhpaeAduD jTAeZva0Yo/AgoHvlzPyI4p10bIabmgm0Vw9sG0RrSXEVMd7KZvhlyU4YZkm+o14G9H9+Wfkdm/ q9 X-Google-Smtp-Source: AGHT+IEAgy0LRBuIJfK18+KnU6cJDe7thUa3O4FdR7CHMtexbdMjrMzZR4P1APkWJIQAPRHgU3+qpw== X-Received: by 2002:a05:6402:2690:b0:639:4c9:9c9c with SMTP id 4fb4d7f45d1cf-64044375aacmr2889442a12.27.1761753455212; Wed, 29 Oct 2025 08:57:35 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Nicholas Piggin , Chinmay Rath , qemu-ppc@nongnu.org (open list:PowerPC TCG CPUs) Subject: [PULL 21/35] target/ppc: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:30 +0000 Message-ID: <20251029155045.257802-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x529.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753692661158500 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for Power PC targets. Signed-off-by: Julian Ganz Message-ID: <20251027110344.2289945-22-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index d8bca19fff5..6d05b865058 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -27,6 +27,7 @@ #include "internal.h" #include "helper_regs.h" #include "hw/ppc/ppc.h" +#include "qemu/plugin.h" =20 #include "trace.h" =20 @@ -404,11 +405,31 @@ static void powerpc_mcheck_checkstop(CPUPPCState *env) powerpc_checkstop(env, "machine check with MSR[ME]=3D0"); } =20 +static void powerpc_do_plugin_vcpu_interrupt_cb(CPUState *cs, int excp, + uint64_t from) +{ + switch (excp) { + case POWERPC_EXCP_NONE: + break; + case POWERPC_EXCP_FIT: + case POWERPC_EXCP_WDT: + case POWERPC_EXCP_PIT: + case POWERPC_EXCP_SMI: + case POWERPC_EXCP_PERFM: + case POWERPC_EXCP_THERM: + qemu_plugin_vcpu_interrupt_cb(cs, from); + break; + default: + qemu_plugin_vcpu_exception_cb(cs, from); + } +} + static void powerpc_excp_40x(PowerPCCPU *cpu, int excp) { CPUPPCState *env =3D &cpu->env; target_ulong msr, new_msr, vector; int srr0 =3D SPR_SRR0, srr1 =3D SPR_SRR1; + uint64_t last_pc =3D env->nip; =20 /* new srr1 value excluding must-be-zero bits */ msr =3D env->msr & ~0x783f0000ULL; @@ -456,6 +477,7 @@ static void powerpc_excp_40x(PowerPCCPU *cpu, int excp) if (!FIELD_EX64_FE(env->msr) || !FIELD_EX64(env->msr, MSR, FP)= ) { trace_ppc_excp_fp_ignore(); powerpc_reset_excp_state(cpu); + qemu_plugin_vcpu_exception_cb(env_cpu(env), last_pc); return; } env->spr[SPR_40x_ESR] =3D ESR_FP; @@ -510,12 +532,14 @@ static void powerpc_excp_40x(PowerPCCPU *cpu, int exc= p) env->spr[srr0] =3D env->nip; env->spr[srr1] =3D msr; powerpc_set_excp_state(cpu, vector, new_msr); + powerpc_do_plugin_vcpu_interrupt_cb(env_cpu(env), excp, last_pc); } =20 static void powerpc_excp_6xx(PowerPCCPU *cpu, int excp) { CPUPPCState *env =3D &cpu->env; target_ulong msr, new_msr, vector; + uint64_t last_pc =3D env->nip; =20 /* new srr1 value excluding must-be-zero bits */ msr =3D env->msr & ~0x783f0000ULL; @@ -567,6 +591,7 @@ static void powerpc_excp_6xx(PowerPCCPU *cpu, int excp) if (!FIELD_EX64_FE(env->msr) || !FIELD_EX64(env->msr, MSR, FP)= ) { trace_ppc_excp_fp_ignore(); powerpc_reset_excp_state(cpu); + qemu_plugin_vcpu_exception_cb(env_cpu(env), last_pc); return; } /* @@ -653,12 +678,14 @@ static void powerpc_excp_6xx(PowerPCCPU *cpu, int exc= p) env->spr[SPR_SRR0] =3D env->nip; env->spr[SPR_SRR1] =3D msr; powerpc_set_excp_state(cpu, vector, new_msr); + powerpc_do_plugin_vcpu_interrupt_cb(env_cpu(env), excp, last_pc); } =20 static void powerpc_excp_7xx(PowerPCCPU *cpu, int excp) { CPUPPCState *env =3D &cpu->env; target_ulong msr, new_msr, vector; + uint64_t last_pc =3D env->nip; =20 /* new srr1 value excluding must-be-zero bits */ msr =3D env->msr & ~0x783f0000ULL; @@ -708,6 +735,7 @@ static void powerpc_excp_7xx(PowerPCCPU *cpu, int excp) if (!FIELD_EX64_FE(env->msr) || !FIELD_EX64(env->msr, MSR, FP)= ) { trace_ppc_excp_fp_ignore(); powerpc_reset_excp_state(cpu); + qemu_plugin_vcpu_exception_cb(env_cpu(env), last_pc); return; } /* @@ -758,6 +786,7 @@ static void powerpc_excp_7xx(PowerPCCPU *cpu, int excp) if (lev =3D=3D 1 && cpu->vhyp) { cpu->vhyp_class->hypercall(cpu->vhyp, cpu); powerpc_reset_excp_state(cpu); + qemu_plugin_vcpu_hostcall_cb(env_cpu(env), last_pc); return; } =20 @@ -803,12 +832,14 @@ static void powerpc_excp_7xx(PowerPCCPU *cpu, int exc= p) env->spr[SPR_SRR0] =3D env->nip; env->spr[SPR_SRR1] =3D msr; powerpc_set_excp_state(cpu, vector, new_msr); + powerpc_do_plugin_vcpu_interrupt_cb(env_cpu(env), excp, last_pc); } =20 static void powerpc_excp_74xx(PowerPCCPU *cpu, int excp) { CPUPPCState *env =3D &cpu->env; target_ulong msr, new_msr, vector; + uint64_t last_pc =3D env->nip; =20 /* new srr1 value excluding must-be-zero bits */ msr =3D env->msr & ~0x783f0000ULL; @@ -858,6 +889,7 @@ static void powerpc_excp_74xx(PowerPCCPU *cpu, int excp) if (!FIELD_EX64_FE(env->msr) || !FIELD_EX64(env->msr, MSR, FP)= ) { trace_ppc_excp_fp_ignore(); powerpc_reset_excp_state(cpu); + qemu_plugin_vcpu_exception_cb(env_cpu(env), last_pc); return; } /* @@ -908,6 +940,7 @@ static void powerpc_excp_74xx(PowerPCCPU *cpu, int excp) if (lev =3D=3D 1 && cpu->vhyp) { cpu->vhyp_class->hypercall(cpu->vhyp, cpu); powerpc_reset_excp_state(cpu); + qemu_plugin_vcpu_hostcall_cb(env_cpu(env), last_pc); return; } =20 @@ -947,6 +980,7 @@ static void powerpc_excp_74xx(PowerPCCPU *cpu, int excp) env->spr[SPR_SRR0] =3D env->nip; env->spr[SPR_SRR1] =3D msr; powerpc_set_excp_state(cpu, vector, new_msr); + powerpc_do_plugin_vcpu_interrupt_cb(env_cpu(env), excp, last_pc); } =20 static void powerpc_excp_ppe42(PowerPCCPU *cpu, int excp) @@ -1073,6 +1107,7 @@ static void powerpc_excp_booke(PowerPCCPU *cpu, int e= xcp) CPUPPCState *env =3D &cpu->env; target_ulong msr, new_msr, vector; int srr0 =3D SPR_SRR0, srr1 =3D SPR_SRR1; + uint64_t last_pc =3D env->nip; =20 /* * Book E does not play games with certain bits of xSRR1 being MSR save @@ -1144,6 +1179,7 @@ static void powerpc_excp_booke(PowerPCCPU *cpu, int e= xcp) if (!FIELD_EX64_FE(env->msr) || !FIELD_EX64(env->msr, MSR, FP)= ) { trace_ppc_excp_fp_ignore(); powerpc_reset_excp_state(cpu); + qemu_plugin_vcpu_exception_cb(env_cpu(env), last_pc); return; } /* @@ -1252,6 +1288,7 @@ static void powerpc_excp_booke(PowerPCCPU *cpu, int e= xcp) env->spr[srr0] =3D env->nip; env->spr[srr1] =3D msr; powerpc_set_excp_state(cpu, vector, new_msr); + powerpc_do_plugin_vcpu_interrupt_cb(env_cpu(env), excp, last_pc); } =20 /* @@ -1373,6 +1410,7 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int e= xcp) CPUPPCState *env =3D &cpu->env; target_ulong msr, new_msr, vector; int srr0 =3D SPR_SRR0, srr1 =3D SPR_SRR1, lev =3D -1; + uint64_t last_pc =3D env->nip; =20 /* new srr1 value excluding must-be-zero bits */ msr =3D env->msr & ~0x783f0000ULL; @@ -1472,6 +1510,7 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int e= xcp) if (!FIELD_EX64_FE(env->msr) || !FIELD_EX64(env->msr, MSR, FP)= ) { trace_ppc_excp_fp_ignore(); powerpc_reset_excp_state(cpu); + qemu_plugin_vcpu_exception_cb(env_cpu(env), last_pc); return; } /* @@ -1516,6 +1555,7 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int e= xcp) if (lev =3D=3D 1 && books_vhyp_handles_hcall(cpu)) { cpu->vhyp_class->hypercall(cpu->vhyp, cpu); powerpc_reset_excp_state(cpu); + qemu_plugin_vcpu_hostcall_cb(env_cpu(env), last_pc); return; } if (env->insns_flags2 & PPC2_ISA310) { @@ -1662,6 +1702,7 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int e= xcp) ppc_excp_apply_ail(cpu, excp, msr, &new_msr, &vector); powerpc_set_excp_state(cpu, vector, new_msr); } + powerpc_do_plugin_vcpu_interrupt_cb(env_cpu(env), excp, last_pc); } #else static inline void powerpc_excp_books(PowerPCCPU *cpu, int excp) --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753704; cv=none; d=zohomail.com; s=zohoarc; b=DplDIEj7SQZF1poe9rUSO2oq0vxFAP1L9FKNLvdIF/a12MYyh+7/VxhkD7PFoZ/k2jn5SQz/iEPTGYO+ccGeALMOYbadlu/vJByWNgxpBq5PUYr+yvZEPzazkNsPfx08n5KEsJJ4mAzUOSWnpqS+ehZEZON4i1YumhDZpVjPRLo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753704; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DcgRLJxKs/ujjrhiNpo+x+KjdrmWKBAZJK7rS+3Uwcc=; b=ehM3SW+kFsfhDPvNmA3Ord9RXLgfl1kjsG89vzKXFt+wbi6WC8pczi84ubJkBfued1lCrTU51LK4UMGNzpCmYPeud2TOLc5eQ7wSHp6/aocfgRHvsuMxc/9sRbVk8phU9uZcsYgzE7HhqkYbahJJ+rBfcm8EEIwuxq8PhQuHOhU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753704747852.2194567278211; Wed, 29 Oct 2025 09:01:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8Zy-0006ZY-S1; Wed, 29 Oct 2025 11:59:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8Ys-0005nQ-3t for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:58:11 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8YR-0003XF-Rf for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:58:02 -0400 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-b6d3effe106so4301166b.2 for ; Wed, 29 Oct 2025 08:57:32 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d854430dbsm1456111066b.63.2025.10.29.08.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:57:28 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 0B6DD60D8F; Wed, 29 Oct 2025 15:50:48 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753449; x=1762358249; 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=DcgRLJxKs/ujjrhiNpo+x+KjdrmWKBAZJK7rS+3Uwcc=; b=opo8LXugwHwsrZ44mSvbARE/a7kJloWmpZcp4MyZtDWNed04JmIafKA80YQdeMpIdp xEUqFHSTTywNosMmalppLoSreG1zKgJvx0ZtQZZJGCHE+wweZjVnPPwxsjUktmiR6yhi 2xUlPHgIVxvvKElT1iqSymqI+IKJKk6pUaUyf0lDXOsZNknSFanPyYyvlsYXLslywPMY HZ19KWRHjHrh2x5UsSdu82ts7Me1dTZ7jHhwHc3SO2MsMv+My2CqkZU4ccGXGGv6VXHd H7IOIc/Q5KN0f45WL5q/2ugGV8b3lKCthXVvNb3ahxilZ7XFrwOmY4cqplYTqnPY5wWQ 9h8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753449; x=1762358249; 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=DcgRLJxKs/ujjrhiNpo+x+KjdrmWKBAZJK7rS+3Uwcc=; b=KOEoAx8Tjp0AppnWABu7ttjUOHucn93tEQX/TYlf4PHGDqHcGi24tLFsp7zDgPIXys 2TgGkaGu+eC7plBRmZ12g25GHknc6+ibn+Sf5iDOecZs/LMwb0dR1slLDafUtCgADt2B kUE+Hc0ovQmYIxF6xxwhjseWxYimAi8fwJZDf8YBppsreEKh+Ao98wFA1dgAdlFr9rV2 YhqssmQPoFjVUqLc2cFHyoAd/nTp8LcFndDIemuqHk14iNsPEvCJ7LyShSeG7doPLNnc ALiW3tME39b91ofr5mE0W8bzIFr+KChxD3Dp+NirxFlVUXqmjI1Cp8LVTjuwWkbxPv1d zDzQ== X-Gm-Message-State: AOJu0Yyxznpb7OUy+rNrnbdDeFYIDBalRAvyZ2/A5gQwHeMJMpdm3EDT rA0D7oW5yAdwac74xqtjYwjJX72AYh8Lv0WoZCG+6cXBKwIkBy8L2pENRSjzjmNGIfI= X-Gm-Gg: ASbGncvD7310DUCwLWFSaKAXJd2spyCLcEcD4FkFqkfPyL2GNs603cEujEasKBMBhjv TFI9ELVVrSNKJGjvSHKp6RZiLSZWuTaYZ/TrDVZNEF0eqqLZycbO+e4BjB06kBCo0yN1gEgba0R NMLl+6S2zowt9gJQ/dMkH3Q1QD/VBYcujjhMvtvTZzNUax7GXoKf7FMnFNATHKXhw5xq5B2BzES me6yVVuAAzBq9ao6+0BgQzJSBEsL6+ZpZKUolRpISsvA2HPEEgETh266i229D/ecp3KE3zWe3w0 6TIU1rm5Hfw5ZWIlYE60s6VZLPg4Sel+vypEJO1e1iVgj9F1PshUq3rnz6QeDOtc92fKTFH/DKi 0zEWVYSDD6wrQlHAaJqPkUZcYm2pxz+343PH7bSknpfqBiXtlRDCN2XqvjhGIzBj9Nh5RS8u66H st X-Google-Smtp-Source: AGHT+IEzSEWOt12h8+WFH2Wbhn59o3crkLlzNu4Ru+A1nr2eo1RoJGj6eT1FBFQ/fFtNJQIkvFkCwg== X-Received: by 2002:a17:907:944a:b0:b65:abf2:417a with SMTP id a640c23a62f3a-b703d6034d6mr339435966b.64.1761753449288; Wed, 29 Oct 2025 08:57:29 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Daniel Henrique Barboza , Alistair Francis , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Palmer Dabbelt , Weiwei Li , Liu Zhiwei , qemu-riscv@nongnu.org (open list:RISC-V TCG CPUs) Subject: [PULL 22/35] target/riscv: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:31 +0000 Message-ID: <20251029155045.257802-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x635.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753708811158500 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for RISC-V targets. Reviewed-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Signed-off-by: Julian Ganz Message-ID: <20251027110344.2289945-23-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 360db133e21..c4fb68b5de8 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -36,6 +36,7 @@ #include "cpu_bits.h" #include "debug.h" #include "pmp.h" +#include "qemu/plugin.h" =20 int riscv_env_mmu_index(CPURISCVState *env, bool ifetch) { @@ -2175,6 +2176,7 @@ void riscv_cpu_do_interrupt(CPUState *cs) uint64_t hdeleg =3D async ? env->hideleg : env->hedeleg; const bool prev_virt =3D env->virt_enabled; const target_ulong prev_priv =3D env->priv; + uint64_t last_pc =3D env->pc; target_ulong tval =3D 0; target_ulong tinst =3D 0; target_ulong htval =3D 0; @@ -2197,6 +2199,7 @@ void riscv_cpu_do_interrupt(CPUState *cs) case RISCV_EXCP_SEMIHOST: do_common_semihosting(cs); env->pc +=3D 4; + qemu_plugin_vcpu_hostcall_cb(cs, last_pc); return; #endif case RISCV_EXCP_LOAD_GUEST_ACCESS_FAULT: @@ -2466,6 +2469,12 @@ void riscv_cpu_do_interrupt(CPUState *cs) prev_priv, prev_virt); } =20 + if (async) { + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); + } else { + qemu_plugin_vcpu_exception_cb(cs, last_pc); + } + /* * Interrupt/exception/trap delivery is asynchronous event and as per * zicfilp spec CPU should clear up the ELP state. No harm in clearing --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753798; cv=none; d=zohomail.com; s=zohoarc; b=bcXzoYAykcUIP6aZF4xc5PAyF+cfwu7F4erUa523d0jU86rXgwEJGbXtbzFYj/drI7mvLbS0td0Ffq1ZrrwyfOX0v/9PpfikKYKbV6Z23wMrsGh6kcdJjKYBVGI/vv8cPupdB+XAy10Tto2ng8rQ+A7ChTQSHES+9ydALhQvXPw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753798; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gI7POiFO1cX4nQU3EyumRDIsbzchXTV+6pxtxm7uAYU=; b=lfiCGPipij9hbw5STV3w4j6mDskvGEiyf5gFE/4IO0tySMnekPH/PfXcmSiwzEk1q9C5o8HbkPx49iNWCRKX1wt7k2wRTNkNXjLrS24baewpHBfYNSLJn9GrrPkOX+c25d1lkHp65KkNqW4dBvoE0tZRv2qeW8dhQuq7UgQYGwU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753798030373.66602590127695; Wed, 29 Oct 2025 09:03:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8ZH-0005vE-16; Wed, 29 Oct 2025 11:58:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8Yk-0005Yd-SI for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:58:03 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8YR-0003XY-VL for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:58:02 -0400 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-63c2d72581fso10821978a12.0 for ; Wed, 29 Oct 2025 08:57:33 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-63e7efb97cbsm12492397a12.26.2025.10.29.08.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:57:27 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 241DB60D95; Wed, 29 Oct 2025 15:50:48 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753451; x=1762358251; 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=gI7POiFO1cX4nQU3EyumRDIsbzchXTV+6pxtxm7uAYU=; b=wSYG69m6L7TcrM2H6RcUfnMlqo2ZFD+pScd6imiVSj8CO4gYrbkWlKTrMq8XJ3wmZ9 K4FBl3/eLztqbFONp+29fuM59r/TYy6caFCMer4OFEKFC5Xm6v883Rvfe0tt7cBe6Qvg cPV3kLJnUf7mtzAzIqCFA2urRUN4U+QccTHJ/oOCweduiCHhR29oxrQ1uZFRF9v+bnsR lKM1CgIbqDtaMkrrjyolJdpip6s7G+VhYKxxBah/SNAe+Wug0lpXw+r/+Kea+iA+iZMf OtKQXU0nRIPk6RhPZrzX6RKOW5p9Vp8ZxBHjWiqWSVkNI4QZkx6RQjFhXmvYPiYLnTHU l20g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753451; x=1762358251; 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=gI7POiFO1cX4nQU3EyumRDIsbzchXTV+6pxtxm7uAYU=; b=CHWHVSMbinyRhVEJihq0YrGTw7GDCZ5GZUqMvPWJUVQU5sGEneguUXzFlgGFwpkewt V1iNARvbrPZWqAD1M/yE7HNUuR3k6VhLZcfx6P6CQgB0EuYK5yLpBh2cEr0CU08zQY6O NK6W+5Dt9SvAS1DSDKkyM8x/L5QK9vV/0h6ZNEpSmKtWto8NMJJ6oe3TrrjyRWGSA0mK Jq45Mow6U4fc5LKb8MNyR4D4EA9UARcAxNUr+DWlD0dHfJ+RiY7FrYeljtdb/U+n4SuF P1ShteyTEZpNY+FeW5VtjFI056ReR8lcxakNWQxBrw3c7UnlOfrEk3K1DQb+//zdiBGS Ndcw== X-Gm-Message-State: AOJu0YwayQLm3XgAiKO1FLofMf8fct0D49STdzN64dvwhtyCf7mnvFCU aQF/h5wK/e/CAOqOxZxttKR0nIfUKOBddr71ax7FMA2wXGAFF2dN3AL/5jVWVgmmMmux0gT3h9K P/7s5Xvc= X-Gm-Gg: ASbGncuXMtZrXjpC2H4KXbJVpBa/s6JW+qYaJcmNdL6WtPDQFV2xssSxJwAo5AZWvKA RLS0CRURHA1143NbzAUrxqRXEIjskKWOxjJuJJys2CqB0/klkjI/pHIf+3lnmeSizCXvxevJ/hi UK/TzJwd69HTzVrrR5PvXgRoxQ/UwxtZzAnWibO2BK5FYoZ8FeWRApP/y50CKzQnRLJ4K9oNwv5 ATV02L/0K9RATtO+goNwa19RXxZu8/WM5EVEDXp1GbmFYrse2gyb5ERHPFcfOnV1tG5t+tFCi2d OVPTml6XOlB/SoJ8N977k7/6oM8UYrtB6AAWSF0Rsw6XJnUMd2fOJUrrKDyRbeWvh2On8Ane8mv nQ3LEclByadA7wznq5PRZFeTJ0+fRbvw9OwWSsVeoDZXuxLOYlQG7WArbAZmaq1Vcsx8jEf7DR9 RT X-Google-Smtp-Source: AGHT+IHDbeuVW6JrqqUwUrVIWnkfP5Z5hpNfFmDd0ys4GwPKvzgwUz2ylzC/Avaoal6GRFrlEO1zqw== X-Received: by 2002:a05:6402:208e:20b0:639:fca4:c471 with SMTP id 4fb4d7f45d1cf-6404e292ac6mr1440586a12.28.1761753450752; Wed, 29 Oct 2025 08:57:30 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Richard Henderson , Yoshinori Sato , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 23/35] target/rx: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:32 +0000 Message-ID: <20251029155045.257802-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753798875154100 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for Renesas Xtreme targets. Reviewed-by: Richard Henderson Reviewed-by: Yoshinori Sato Signed-off-by: Julian Ganz Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251027110344.2289945-24-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/rx/helper.c b/target/rx/helper.c index 41c9606fd1d..ef47e32add8 100644 --- a/target/rx/helper.c +++ b/target/rx/helper.c @@ -22,6 +22,7 @@ #include "exec/log.h" #include "accel/tcg/cpu-ldst.h" #include "hw/irq.h" +#include "qemu/plugin.h" =20 void rx_cpu_unpack_psw(CPURXState *env, uint32_t psw, int rte) { @@ -46,6 +47,7 @@ void rx_cpu_do_interrupt(CPUState *cs) CPURXState *env =3D cpu_env(cs); int do_irq =3D cpu_test_interrupt(cs, INT_FLAGS); uint32_t save_psw; + uint64_t last_pc =3D env->pc; =20 env->in_sleep =3D 0; =20 @@ -65,6 +67,7 @@ void rx_cpu_do_interrupt(CPUState *cs) env->psw_ipl =3D 15; cpu_reset_interrupt(cs, CPU_INTERRUPT_FIR); qemu_set_irq(env->ack, env->ack_irq); + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); qemu_log_mask(CPU_LOG_INT, "fast interrupt raised\n"); } else if (do_irq & CPU_INTERRUPT_HARD) { env->isp -=3D 4; @@ -75,6 +78,7 @@ void rx_cpu_do_interrupt(CPUState *cs) env->psw_ipl =3D env->ack_ipl; cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); qemu_set_irq(env->ack, env->ack_irq); + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); qemu_log_mask(CPU_LOG_INT, "interrupt 0x%02x raised\n", env->ack_irq); } @@ -92,6 +96,14 @@ void rx_cpu_do_interrupt(CPUState *cs) } else { env->pc =3D cpu_ldl_data(env, env->intb + (vec & 0xff) * 4); } + + if (vec =3D=3D 30) { + /* Non-maskable interrupt */ + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); + } else { + qemu_plugin_vcpu_exception_cb(cs, last_pc); + } + switch (vec) { case 20: expname =3D "privilege violation"; --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753691; cv=none; d=zohomail.com; s=zohoarc; b=M4tj0dUgqQ7DkGCdA+1TquhhFIej0WZIdko4UqYB0mZRaX5frE61h1g3EZLRowMQWu7/TGYR4lMcn31OdvhGjKbHs0zywu9tWRZVtsukBdcxx8lo2A/JODiOYSSd7rQ7gnm3RA4uEIGnkNG+aS8Yd06q/Wqcz8BF+USsRkm9coU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753691; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MId34UX3NzRcmw00YP9pkzNQ2Gj+AkCcJGiYrjRobaM=; b=IlHRHWjl69QkwhsZQdKKgTb2mJUSOVlSLQ1FJqTJ+FpN5rzzw4qV9Oi9XOqwdOY3bRUryVUjo24JuL2DejvyPQnQZH+fYnixlZpRV/nJk2fEt5S2Y8BCROpt5aYiwWfO4c7R4yLhivfBQpiN/S/+dkqOiNmui9f392ktS4hpeJg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753691132914.4278056298241; Wed, 29 Oct 2025 09:01:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8Zm-0006Jg-QX; Wed, 29 Oct 2025 11:59:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8Ys-0005nR-3r for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:58:11 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8YU-0003Xk-45 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:58:05 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-b6d5b756284so6744966b.1 for ; Wed, 29 Oct 2025 08:57:33 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d853f9a0fsm1452040066b.50.2025.10.29.08.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:57:30 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 3B5B260DA5; Wed, 29 Oct 2025 15:50:48 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753452; x=1762358252; 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=MId34UX3NzRcmw00YP9pkzNQ2Gj+AkCcJGiYrjRobaM=; b=lPEwkp5Q2GDWQuSTUEn19Ahq2L7FOPK2A4rRs1hAMDEdjO8uh2US1u3tLUlVFOS1cA qbsE0NlrN/zNdlxls5ahW0BsPHeghMPeEC7Zi/+YsTZF9zV1ZbBV54WSdWN9/wjlB9I8 q3sOAVqqAWt23dywPjFyIFBxx8XswumAWnda4M6sPvz3gARqMVRpVmipfgBfgU27BRVw iZkRgofUXQQidBr3Ue5ZOeWO6ZwBKgyFAd8QcGQv22tdoqGiAYI1tMXLfEIGi8J64A1N HFsnm4o1dytzGJXijzv3Ko3bE7OjE42oAHtgrCi3yyJOGapABFrjmPwEwgkSty7FqlLQ BzwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753452; x=1762358252; 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=MId34UX3NzRcmw00YP9pkzNQ2Gj+AkCcJGiYrjRobaM=; b=qDLYShRL6TLNMAbipbVH5DkkZ3HRBGD36O/g2JbIzrMPNgBESB2tt63my31shmg1aX hRLfc0LRFlPED865bKTr68N/aEAqA01M6v8Zv+l85FZSp7vDnKJNvc/pYwvlfzQSr3sN 6oiWs8dYzt2E8yUkEFC81IyQnXOZZcmXYaw3HjzQu7GdWjkqGjlXJIexSUXJ9sQhg8ip Xfxj55XOjW18/XjkKrRfGOznlcQG+Yz1sIML8T8FDuIPfEOTK1vOhRLaVoyJ5JY/SWfI FVh6aUbewMg6A1/II9HCBTfEmDiPvGqsnbttZzJPFGkP9MZsGpUD1lvRhGir2/7I7i58 CKSQ== X-Gm-Message-State: AOJu0YyvfmlOX7UrSyvA6RpD6Y2kjkrT7eXNX+lcqcdDu010Y8Sen6qe fCAqvkf6pu47SyptSwQoVGYf+0bjVaX4zmbiVrzG6ELjMXEZ9+HtgwmGBb6jPvNknHY= X-Gm-Gg: ASbGnctwvYyQne4q6prpjhiJncThcTx2Ruf3Ku0Sakjdt22Fr/4BMUZ/UkQfgA/MeP7 z8YOitscV9xIER+rwxumNXffkhz2Qm5XF2pzR+9XX4oH9rxfjztvru5CigRLRBM7EiVJP+s1huB nuEsYzkPxflOBaMNFUwjtSG/WQsI2nwzUQ7yyIfGc7WKQPB8VRNtS0jwU28Hl1AfhIIVdWya90Z pSB6/yaLPZaJ0C98isIdRSBno08/IwKhZo4ZZPjoJt2OKTvoZGlY372z44YQgUVqGwhva8bwDCH LXQrrQ/hahQIPcozZeUYYKc2pgZwRy6VBlC8sTTAAq4lVOkjtHpZ4IpAVfzYXajcC+PYqs+tW/A jY01gDhwnMD2BZJ6fSdEXHLkVQM6HdSpHEoyGxhAjH1zKdt6OpgnePdc5CiefptAzwokG1fzVvy D8 X-Google-Smtp-Source: AGHT+IFas+EgjH+CZpJNYBxdSXKEfyuQA8kpR4su7TZkZHIlGPRW+W9F8QX7Q3YQoOER1ITQ/5ep2A== X-Received: by 2002:a17:907:c06:b0:b3e:fe8f:764 with SMTP id a640c23a62f3a-b703d45726dmr334603166b.32.1761753452044; Wed, 29 Oct 2025 08:57:32 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , David Hildenbrand , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Ilya Leoshkevich , Thomas Huth , qemu-s390x@nongnu.org (open list:S390 TCG CPUs) Subject: [PULL 24/35] target/s390x: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:33 +0000 Message-ID: <20251029155045.257802-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753692588158500 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for IBM System/390 targets. We treat "program interrupts" and service calls as exceptions. We treat external and io "exceptions" as well as resets as interrupts. Acked-by: David Hildenbrand Reviewed-by: Richard Henderson Signed-off-by: Julian Ganz Message-ID: <20251027110344.2289945-25-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/s390x/tcg/excp_helper.c b/target/s390x/tcg/excp_helper.c index 0ae4e266065..c6641280bc6 100644 --- a/target/s390x/tcg/excp_helper.c +++ b/target/s390x/tcg/excp_helper.c @@ -35,6 +35,7 @@ #include "hw/s390x/s390_flic.h" #include "hw/boards.h" #endif +#include "qemu/plugin.h" =20 G_NORETURN void tcg_s390_program_interrupt(CPUS390XState *env, uint32_t code, uintptr_t ra) @@ -502,6 +503,7 @@ void s390_cpu_do_interrupt(CPUState *cs) S390CPU *cpu =3D S390_CPU(cs); CPUS390XState *env =3D &cpu->env; bool stopped =3D false; + uint64_t last_pc =3D cpu->env.psw.addr; =20 qemu_log_mask(CPU_LOG_INT, "%s: %d at psw=3D%" PRIx64 ":%" PRIx64 "\n", __func__, cs->exception_index, env->psw.mask, env->psw.a= ddr); @@ -531,21 +533,27 @@ try_deliver: switch (cs->exception_index) { case EXCP_PGM: do_program_interrupt(env); + qemu_plugin_vcpu_exception_cb(cs, last_pc); break; case EXCP_SVC: do_svc_interrupt(env); + qemu_plugin_vcpu_exception_cb(cs, last_pc); break; case EXCP_EXT: do_ext_interrupt(env); + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); break; case EXCP_IO: do_io_interrupt(env); + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); break; case EXCP_MCHK: do_mchk_interrupt(env); + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); break; case EXCP_RESTART: do_restart_interrupt(env); + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); break; case EXCP_STOP: do_stop_interrupt(env); --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753705; cv=none; d=zohomail.com; s=zohoarc; b=nLFIw6wqeVVUaxtO4LuS5O3h98PK3Ut39IjakZ6MD2KUWY9PbQaCD9Sw2x7C4bja3WP7YwpsC+1CQ2fB1ySSBAc2SztcXDjcqzdfO87Zd0bjSdch53lMgUkSkfaZ7XmIDP00d5AfccCf4e5HRTupdPzt0tQJthdHbFxq77si+RE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753705; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vt4UkIzTYNn3Frk9IT9Ae6t7kuPopy2qxzZpm/RFBq0=; b=OO0uhWDGl7LyNeAwS9IH5HVIyKWXLWKN0O0APJMz400Z3tJ5Y19ejbJ0kaN/jYHuFgGXbkNfrN0ubOOv2jjmeEAIbALvin9xxVaxIRIdG0dkE139rTDEOUb/L1u1n496XSfyS41NviTNTzBeyVRqRtI2hLsPW8KSasFH138SCLI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753705663920.6463091094696; Wed, 29 Oct 2025 09:01:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8Zx-0006W9-Ak; Wed, 29 Oct 2025 11:59:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8Ys-0005nW-5u for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:58:11 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8YR-0003X3-VL for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:58:05 -0400 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-b7042e50899so9031066b.0 for ; Wed, 29 Oct 2025 08:57:31 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-63e7ef96105sm12146231a12.19.2025.10.29.08.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:57:27 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 53C0360DF5; Wed, 29 Oct 2025 15:50:48 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753448; x=1762358248; 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=vt4UkIzTYNn3Frk9IT9Ae6t7kuPopy2qxzZpm/RFBq0=; b=QaQxbpjDUXrMcIpdH7Gn+iNefA6+silyeADaI7XkCbp4c4GyN8wKB0B0Fxc8XLtDzV 1ZgTOGSWFOgr+OiWlmTxXCcrepC4CaQoSEygsGO/6piOq3LqDdiaDMW/CcspIBYKyqvU NkXOiemBvWHnubYBPjvZOLx5hytTAvk67pwdZdyet8LwU9VDn7+5RzmeRjCMvo5zc1XV SW9ZJXE4iVbCyfhRkY05oCiozuY7ahIlbm4S7UDozJzIC+/xcoDiFO7i/P+AeZoL2LUZ A9t15SpqdY2pkktqLGcdSNqFtB6oqjR9b9HMB0QMprQgRxLIZ2OvFkPAr4obExEi5FEd lMSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753448; x=1762358248; 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=vt4UkIzTYNn3Frk9IT9Ae6t7kuPopy2qxzZpm/RFBq0=; b=jz/Y/XT361gBHb7gj2ru9m6BChgP0DNKD5ekJEcp+YX2WUrn1OLzwZBw9qUtaocahy 9iaa9n+cft3Qb2Wuy8LSUYP/vfM298Sbdht1Ww6Cjncer+2fjWP9xMV3qQvjpLAuPwfG KLAnYqvTis0/2AJPcgxgdLrS5a5VQvPIhomGu44iGHlumCo2Fml0R4fvY1dwREykG54y MakQOaeTfSRoz/PRfZj/5zK8j+eyhBnFxNa9U0j/w7gDL/oLXgz+3T36D+HPo2KZJfd3 El7703MAK/8kHoW0x93hbO/eRAijQvAX5cxIZNnhB43BebeDM2ogWzx5KOx5n8clcN0J 2fEg== X-Gm-Message-State: AOJu0Ywx/eUfdiIZTpUODC1+mol2Dqfcxk8BWJA4DqYA2ypV0Ym+hFhg 054ylVOrxZ5Zdf9/8KyUxK3zVPCb2dr/72TXEbsKP8xp8Jfh5MagvG0d+mEDNU4axfs= X-Gm-Gg: ASbGnctcyFwnFrWGq/YtndRUH1wCVfZF6M//bWeFS98S6K/9Lzy0islKs9cx503dBYs ouumg5qUTZlwv8MyWLKjqQW7lVogoyEB4FFObnvv472x93mHOT6NaCxHqR/K5FptRVE3ILDTWe7 KI34RM/CcGapA7ZdChzeum2oFAVPkmNIUv3HCg2QIEk/SdlD2BHqNzP/gG7wHo0aJmNlBN+Pjnu 5OgQhy/lHJJYF1A1lQN61z0qhlMnDm9Q0KwRq6VdEhN1fOT/vyVC0xnZj4i97k4j2Tbc9uSZFc4 eTg8l7uOGFAYXZ9oyxn16ytXNOzviappnAOxwQykbvG4T9ZadZO1lpTsBvVc7oCrwO88N74O7mr BFOZRann4AKoquU4DzIHZ59xihFxQkPVk4LeV4rCHuIV2drgHaqRsJLuvie3CvVr+dHSD2ZoPOr +k X-Google-Smtp-Source: AGHT+IGdHBkEtKTvs4lH7vVrF3ONWqmhMNQjVlAH5VBeznRboPjBEZCMMnVGgg9kTIdKMypns9iZ1g== X-Received: by 2002:a17:906:6a10:b0:b6d:6c1a:31ae with SMTP id a640c23a62f3a-b703d5393a3mr343694666b.49.1761753448528; Wed, 29 Oct 2025 08:57:28 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Richard Henderson , Yoshinori Sato , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 25/35] target/sh4: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:34 +0000 Message-ID: <20251029155045.257802-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x635.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753708849158500 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for SuperH targets. Reviewed-by: Richard Henderson Reviewed-by: Yoshinori Sato Signed-off-by: Julian Ganz Message-ID: <20251027110344.2289945-26-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/sh4/helper.c b/target/sh4/helper.c index 3b18a320b86..5d6295618f5 100644 --- a/target/sh4/helper.c +++ b/target/sh4/helper.c @@ -24,6 +24,7 @@ #include "exec/page-protection.h" #include "exec/target_page.h" #include "exec/log.h" +#include "qemu/plugin.h" =20 #if !defined(CONFIG_USER_ONLY) #include "hw/sh4/sh_intc.h" @@ -60,6 +61,7 @@ void superh_cpu_do_interrupt(CPUState *cs) CPUSH4State *env =3D cpu_env(cs); int do_irq =3D cpu_test_interrupt(cs, CPU_INTERRUPT_HARD); int do_exp, irq_vector =3D cs->exception_index; + uint64_t last_pc =3D env->pc; =20 /* prioritize exceptions over interrupts */ =20 @@ -176,12 +178,14 @@ void superh_cpu_do_interrupt(CPUState *cs) env->pc =3D env->vbr + 0x100; break; } + qemu_plugin_vcpu_exception_cb(cs, last_pc); return; } =20 if (do_irq) { env->intevt =3D irq_vector; env->pc =3D env->vbr + 0x600; + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); return; } } --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753540; cv=none; d=zohomail.com; s=zohoarc; b=NLeSYkzGbyL1pM15yNVKdUGS7kSPDQ887i5PozY77IdKz+nkXuLQx0N6mBxRkByjOnCHUkYNurD/6Dlu5TdmgU8NuHLBNyvqi5uUB9dAFNaevaRkMU6Wg+n2ivxdX3OaZJ7xYjlQAOH8MhB/HFuVzoAUoiEgFDlnQKLLCG0wxjw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753540; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=89K9UohZzH0h6Hv05a+atCjJ751UhZo4tfa75Adu0VM=; b=eEgES9t4LLT20Hl/qaaFnC/DzBANMxunBscJY0ZlpJzPd1kblZwHalai1FUQ+je1+waPHNET4dNY7V3AiXx/BGZyXB/BMGCNu651p1gduJcq5sAT8yRh+r+a1B43Uo7OMU7KxbmW/83BU0NFWy35A2v8addMRIyDzoyCx77L92s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753540381190.47191813892402; Wed, 29 Oct 2025 08:59:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8Yj-0005RI-4O; Wed, 29 Oct 2025 11:58:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8Ya-0005FP-8H for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:57:55 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8YR-0003Xf-Tn for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:57:51 -0400 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-63b9da57cecso11458219a12.0 for ; Wed, 29 Oct 2025 08:57:33 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-63e7ef6c129sm12372234a12.3.2025.10.29.08.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:57:30 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6B3BC60E7B; Wed, 29 Oct 2025 15:50:48 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753451; x=1762358251; 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=89K9UohZzH0h6Hv05a+atCjJ751UhZo4tfa75Adu0VM=; b=MXT7WeFQtgXydoJiN87S/gCj3mgDZbmdCgUb+JXxLQDTktyBqsEJaWygX6A8T+riH0 Gs044drrdW7jhw3Xjeys5tFHPUUBE2MV1w3VEsOyn4QafN/rSmszY6NtnfunLIn1Pjh8 xX50UtuzDhZ1LjH5CUILfquXeks/2HwOJ7LXJnmIgP+K8NvR/CU2PT++8STibok4Yy6k hPDsaMSGiiCM1aYOavNVNvnq1+1VQB8Mi1sgIzcyZNn0A2dqmumAE2pQMfYV5YU4rmbE 62E/XKBeiqYY/AEXHEUL1gRSsmjMYr1JCk7OvwEiw6AqRM3AxEC0ok2kAu/oicIXl2vA m2bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753451; x=1762358251; 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=89K9UohZzH0h6Hv05a+atCjJ751UhZo4tfa75Adu0VM=; b=goeXcgV9z1Z0rgftFi6yQcs5qMy2FofFE/Ad/JNAHju6AN70mIPLEIypAbu0QVN6O7 pFTywniAszlfFYA/W9MTHo/6h+2l/sjMFgcxOo42VM0SahdW5rtRfNi8v+lUD070wQ5y hurefd3UlOit7fwNW9QlfI+kUktJsNAWZ5kpeXJFnHH6miwG6smeio16AQuQ6TsX2DQj 6I4NZnqvBjHthuFt5WUHEeT52tZg/8DSrSTsPzK7i+tD/7OTHqs4tTCo33DOI6Z+Rf/Q ELvUoMsJzIH2FWr3B+DK18mLWMJeKtVQLLCfHfq/x5W6GkrCPN/ef7GcpXJ/ad/9m4U4 85eA== X-Gm-Message-State: AOJu0YxAhp90tnxIyhRiBNgwpyNj+CBDcLBOuT7TSyVAsimhiv56b1is 69BOvJcNNdCA45QR7Jck68o6qEksK7FtSEcUE1ymUIUDmR5zlGbYqs7mcJv5/eRcN/s= X-Gm-Gg: ASbGncuaOXs2MbLxUwaEsBEUkdjcArBAwz/d+6ncScyp+vhnwDZhzHnV2Qyimz0zA0f mXwtwx+o/bXYOxhFqXkFB7HtUa6r4Zi5vbSgeCEjoIEGsF5cPaykiD32FvWORHwTQ8JWi9yKUMl wp1IePnxYMI6exadUy6Gh3zOvNhP9PehwY9MpMQXC/Rfw1XXuPEyXqcCotWTS/5wM5jPzYgd0Vn 1/DyU34s36y4mRN+YK5K2T3u9BJrpyvKw5S6CkqjatJ21Z+rt3BBeaIr4yTnmT/ic8eo2YLBCRg +0XZ8bzzEwAxvnToqHb2bu6Dy0zSKLQfr5kDGtQFQuml45QgQXETPH2JrQaOUAnN8Cv5kLIMoCQ mnNnSlFjntXMZ2hSQBCu9QEARh68zyIRF9RauD3C0QmEmDxxT5rCPaddapYnpc5/nIaHCxvbBIm 4U X-Google-Smtp-Source: AGHT+IEdRGuVDjp+89hHJhLbme6fxra2eMMvOY4Rvjg5qASqG4xWdLo7iYrljRz2UrF1o6SdpJn+PQ== X-Received: by 2002:a05:6402:40c3:b0:63c:58b6:25ef with SMTP id 4fb4d7f45d1cf-64044246f86mr2958856a12.20.1761753451449; Wed, 29 Oct 2025 08:57:31 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Mark Cave-Ayland , Artyom Tarasenko Subject: [PULL 26/35] target/sparc: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:35 +0000 Message-ID: <20251029155045.257802-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753542984158500 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for SPARC (32bit and 64bit) targets. We treat any interrupt other than EXTINT and IVEC as exceptions as they appear to be synchroneous events. Reviewed-by: Richard Henderson Signed-off-by: Julian Ganz Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251027110344.2289945-27-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/sparc/int32_helper.c b/target/sparc/int32_helper.c index fdcaa0a578b..b29f693a6bf 100644 --- a/target/sparc/int32_helper.c +++ b/target/sparc/int32_helper.c @@ -24,6 +24,7 @@ #include "accel/tcg/cpu-ldst.h" #include "exec/log.h" #include "system/runstate.h" +#include "qemu/plugin.h" =20 static const char * const excp_names[0x80] =3D { [TT_TFAULT] =3D "Instruction Access Fault", @@ -174,4 +175,10 @@ void sparc_cpu_do_interrupt(CPUState *cs) env->qemu_irq_ack(env, intno); } #endif + + if (intno =3D=3D TT_EXTINT) { + qemu_plugin_vcpu_interrupt_cb(cs, env->regwptr[9]); + } else { + qemu_plugin_vcpu_exception_cb(cs, env->regwptr[9]); + } } diff --git a/target/sparc/int64_helper.c b/target/sparc/int64_helper.c index 96ef81c26cd..60ab0478fc6 100644 --- a/target/sparc/int64_helper.c +++ b/target/sparc/int64_helper.c @@ -24,6 +24,7 @@ #include "exec/helper-proto.h" #include "exec/log.h" #include "trace.h" +#include "qemu/plugin.h" =20 #define DEBUG_PCALL =20 @@ -256,6 +257,15 @@ void sparc_cpu_do_interrupt(CPUState *cs) } env->npc =3D env->pc + 4; cs->exception_index =3D -1; + + switch (intno) { + case TT_EXTINT: + case TT_IVEC: + qemu_plugin_vcpu_interrupt_cb(cs, tsptr->tpc); + break; + default: + qemu_plugin_vcpu_exception_cb(cs, tsptr->tpc); + } } =20 trap_state *cpu_tsptr(CPUSPARCState* env) --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753535; cv=none; d=zohomail.com; s=zohoarc; b=aEtmAwPta0Rq6xpemQlFAtfH4XdEdjheAPqnJl0+YHCt1hrpf4ouNvq4JiAfXJSbf03noqqe0HxZZqw2VULUgby5gENpBDi9FdMZeDld8pFipHZ+OhOuSGZyxJu1Ywk8GRVCHCh0dHdkHIRAZTkLAMbeZI4c61Dyg5vuXE1gNVE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753535; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VMZ8smhJoOFXlVYHZrThhvPhMrsexYC+bniZ9hCR8Ac=; b=WQeUB+vEO13uhzOmf03Rt6+/WkDWQ2bOT4rs4PZob4EfaicZUPABKrJiuLoUbRA463bxRGLbpaGGMmIHj1WGsVkbMQhANa0Fe/pMMi8ZCWYoa6ZR6UvQQ/dbtPq9G6ISC9QdTdrjzDlWrRdIh8hlw0uUENsPhCEvYIYaCibgKcA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753535815925.3843061973987; Wed, 29 Oct 2025 08:58:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8Yu-0005mH-QF; Wed, 29 Oct 2025 11:58:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8Yf-0005O3-CG for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:57:59 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8YR-0003Y4-Ul for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:57:56 -0400 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-63bea08a326so10581740a12.3 for ; Wed, 29 Oct 2025 08:57:36 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-63e7efb818esm11750111a12.24.2025.10.29.08.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:57:30 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 82A5360F51; Wed, 29 Oct 2025 15:50:48 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753453; x=1762358253; 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=VMZ8smhJoOFXlVYHZrThhvPhMrsexYC+bniZ9hCR8Ac=; b=uYG0vhbtZbAUHbdSRebkWmbAINJBy5du9FO+nKhh8skO2YWu+V+tSvGqIC2vGTn5Ro GebSbgTVgfHHJYKM/Fo4+BysOWTCIGYtH7aPz6dsGacK6T1zdkTxl9pTzaL5uefIARZL +l7VSNvsB+LCGhcgC4dYI4LoAvb2mUAvRcJpV/MnxCGjVS7Ruc2HAtz66cvq4T/xOx9C izsTVgYmxxX3kcUn1UWsOltdtR4yKyyIn8aqt3cb0ZML/p06xxae2f8BDry9w3U4GjdR zyRrHL4A0F0TorjP/7vxZ6kETQfs85tzkaQFCkof2TxO8/xw6ruI31e2z0hsJLG/h5vE CW7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753453; x=1762358253; 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=VMZ8smhJoOFXlVYHZrThhvPhMrsexYC+bniZ9hCR8Ac=; b=qrNMKr+kFeIvu/JuOnyOVM+H/P/dNEOX2xDpZ5NzIjIUd4IsM/VWjWeIsH6D5VPhZF jbpAcFD4319VULUO3y48zxKW0BbE/vzLNTI/lqHYkbrGU7clDpH5HkgDmvhC6qAAdUsN zh8GMb9cVOIeZA2zUZhQCVXTfqN6ssNGM6JR9dpTxKqmr8BQlKNELcB1OmpY1Go5+2Ru ALssjktVeHiEkCihGs1dWSsHd4FsAci5Aw22/MBsDMiEOr0czc/O576zDO+mjaBzMv+m UwKTJkgFTx69ZiV3I1ESy5ygADJqfP1GygdoeCDS1z2jEMz31+n50r7KE/tl7H6hqbbj lJZw== X-Gm-Message-State: AOJu0Ywcxwg17vkA17QjMDnB9SSTCcbRcf1MGEGNYi3fw7ndurkshMHD t1v6eETNxd98dfnb+C8WFbU1lYSQjMP/LHJnWdJNSjeAs58/R2JvlwjVP3xwsOmJOVw= X-Gm-Gg: ASbGncsAmonhObiCcWgh97p+ocA/XFfJNzawX0V3meVxOSRc3mcD9NFz0I59RAuaSOV STYMdjBcZSL8H5sqG11ZyGEQ+6lPGVQFO1qtTPY+JClraG2PDGan3khJNdVBOBpNaQxO2Da4SZb V41zA8QASRpiTEmoTph78skXbLroeCkBSd4egXjTDhR5GJjgnkUOXeTb84nWi9q9j7PFhdtst+C hdUGNkrmZC3ZyuvyhBXGluCM0RU1Zc5wM42j8Q0hFxxe/ECu6TCIydKxlDOL4tfoO3rAdCiKwiH NfOQh3+oi/6zSd5Pz9WYtwUx+ATFEvZo/8qR19rwYasulzSKZNovyR8ScBmsOjoZe3CQUhLkzvs w3YUHMO4mEJgWYC48lO+5/a1a/E/Gd5iUKTon5yBb2n5SC8j2L+0qXkXBOGUd5ykljVOLAwqnUY Ug X-Google-Smtp-Source: AGHT+IEFR5WgsjTAhfOCc8293iI6N7DEgFbm+6qB7nZfQEAYYWH16dtVqi7CqJw//qeCs7ahrkr8xA== X-Received: by 2002:a05:6402:1d4b:b0:63c:32a6:e9ff with SMTP id 4fb4d7f45d1cf-6404418a630mr2909489a12.8.1761753453187; Wed, 29 Oct 2025 08:57:33 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Bastian Koppelmann , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 27/35] target/tricore: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:36 +0000 Message-ID: <20251029155045.257802-28-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753537811154100 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places an exception hook for TriCore targets. Interrupts are not implemented for this target and it has no host calls. Reviewed-by: Bastian Koppelmann Reviewed-by: Richard Henderson Signed-off-by: Julian Ganz Message-ID: <20251027110344.2289945-28-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/tricore/op_helper.c b/target/tricore/op_helper.c index 610f148a237..2c8281a67e0 100644 --- a/target/tricore/op_helper.c +++ b/target/tricore/op_helper.c @@ -19,6 +19,7 @@ #include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "accel/tcg/cpu-ldst.h" +#include "qemu/plugin.h" #include /* for crc32 */ =20 =20 @@ -29,8 +30,11 @@ void raise_exception_sync_internal(CPUTriCoreState *env,= uint32_t class, int tin uintptr_t pc, uint32_t fcd_pc) { CPUState *cs =3D env_cpu(env); + uint64_t last_pc; + /* in case we come from a helper-call we need to restore the PC */ cpu_restore_state(cs, pc); + last_pc =3D env->PC; =20 /* Tin is loaded into d[15] */ env->gpr_d[15] =3D tin; @@ -90,6 +94,7 @@ void raise_exception_sync_internal(CPUTriCoreState *env, = uint32_t class, int tin /* Update PC using the trap vector table */ env->PC =3D env->BTV | (class << 5); =20 + qemu_plugin_vcpu_exception_cb(cs, last_pc); cpu_loop_exit(cs); } =20 --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753429; cv=none; d=zohomail.com; s=zohoarc; b=GH9dFzto25yA9kIR8I7x+GvuUsRUNc6+LUUgpzuTVWaL/MR5Oc0kKYAY7viTVCW5nV1mzEhsdKfhFN98aBtBAoGKsLk/XkAzUasTkm8uaGPCsC+HPJ9Oxhd047xeI9clPiKDIz5zWC2ouMz5XAhOWm+bHcxf71IjJFviflZUHpA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753429; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TQljybzpHjU4IgUqxQisRNFwaJc4gUeecLRNQGky0zI=; b=HHtN8DSSpATp1vW2jmu5ny7CtiR9cL7KDHWkVrnsK+tKHud5NemrAdK2apKCzq76uQSNc7fDkepq1j5x7wrgIkk4mecvZp/nxnKzJViFFNUelt8EuEDRgX0wtndx0qEBRaedj8YgWtgyjRoHvjhqn6f7PgaFPIS/0IbaIqvMTd8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753429369893.7980074423465; Wed, 29 Oct 2025 08:57:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8S7-000449-Bd; Wed, 29 Oct 2025 11:51:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8S3-00041o-Q7 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:09 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8Rv-0002t5-Hb for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:06 -0400 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-b6d855ca585so8304066b.0 for ; Wed, 29 Oct 2025 08:50:58 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d853077c7sm1475100366b.7.2025.10.29.08.50.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:54 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 9A32560F68; Wed, 29 Oct 2025 15:50:48 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753054; x=1762357854; 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=TQljybzpHjU4IgUqxQisRNFwaJc4gUeecLRNQGky0zI=; b=KghnWP2ojrOPMXKYXFUiu7og/FmXkTJ66FFtINIwnr4McD3zvkfMEZiBulNsEeunTE biqk0HgLx+zxBmNMIvxXjHs9tvbrahxQzJIomfktoMI0htsnSNCNexY75TUOPJsxOlIC cwdeenQqO3P5AkRpgBGPFRwvUTB7Z6l59ku/QacD1mwoGBed0wStnPigvFuEVzbVgA7R NbX8+dEOP88eTjdQyUEE8HllkW3ZYPog5GjZpcemOHT65ViiuIkZTWwQE9962y/lm9Si Z8VjfsjH3RsX98C9+L11nuHktZ7a+bwxwX0aFPdqJC4v6RTWZgOOYn/WeYgiRXQIvFNY dPSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753054; x=1762357854; 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=TQljybzpHjU4IgUqxQisRNFwaJc4gUeecLRNQGky0zI=; b=NKVjXoOgiCHF/C0wzRhYlI0pwefz/hdZFqiA8Jk994ZVYEv36UHhegoGv5coZ4UAC3 bgA/QY8LpQLILYQiMfznv/+XPfX/Ws1vpbU0+L+Wgd2fEMCcBBVflbOabTZYbYAUqcrn j6SPExZz3Ejh7B12d8MVBFCCjZ3bNKKX2vZgjNTgx594ZLdI/x+VgzOmSC2lMo0BC6UX fE5h6fwxOF+JWgeU/gTzoyz6LkijYcfcNm08RlEdPpajzMT3COfX8j6lV4/xO4r2ve1X G22je0QvS/RWFsNfLhlQSQKMhNyo16K9+7o982wv6DqODvbis7t+J+gV+sVl83ZOdgjd lkRw== X-Gm-Message-State: AOJu0Yz+HTJgIuLWXiucC8aLBZWRo7OnP0JvCgB/vreu/9GmDkc7lwOg wRdeDfpynZZs+JOx+TKClPQzV0q3mOBzS7TvBBHKND87E9KwJwpnA8e8z5zvCUIH6FU= X-Gm-Gg: ASbGncvneZP4lhDM9MIiA2jImu9puSI9skSSaqsYbQgHiMKHvsq+WlkwJKHw2DkVL4G 8Q8xXUHcJfbsyrZ5Z7nAWuKwohGEuWSgKgf4+dcqJa0UcA3qDtgTXo+m6KVdmgmwBBOSudYtAHN UVbMO4Hcu9k998ck6vDbHiEnOVd3kJjnNWDWKFkWjWdQ3oCxS6KM1ZRuEc87si2IsnnoqhB+HtC SBFC2PvZW2jri7sbAMzEfKPIv8a5AbVvrsUkXgxU5d5yVokan+Nvu5h1/EvVesAobjuer1xGvSE hugg4dR6r7OibvO3vkllmaemri+NhC8lmz50t6oYY5zfz0x9qMG8Ox6o7FvvAWc8aPznP3LM3Wj lJS8APx3DKOpxsVeeP/giE85a/97WjOpae+gGfvKvhjNx2YXrBpAKPy3FPQrk+34oPoR9NgKtKC ji X-Google-Smtp-Source: AGHT+IHZByoB4QQ+8aZ+aYAyf2Abr63lwtoRmvm4xI8rJGNxRYIDrSxIS9uuHQ1FmUuhp772Mg3NOA== X-Received: by 2002:a17:906:6a0e:b0:b45:1063:fb62 with SMTP id a640c23a62f3a-b703d342998mr334718466b.24.1761753054607; Wed, 29 Oct 2025 08:50:54 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Max Filippov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 28/35] target/xtensa: call plugin trap callbacks Date: Wed, 29 Oct 2025 15:50:37 +0000 Message-ID: <20251029155045.257802-29-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753430444154101 From: Julian Ganz We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for xtensa targets. Reviewed-by: Max Filippov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Julian Ganz Message-ID: <20251027110344.2289945-29-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/target/xtensa/exc_helper.c b/target/xtensa/exc_helper.c index b611c9bf97c..fdc522698dc 100644 --- a/target/xtensa/exc_helper.c +++ b/target/xtensa/exc_helper.c @@ -32,6 +32,7 @@ #include "exec/helper-proto.h" #include "qemu/host-utils.h" #include "qemu/atomic.h" +#include "qemu/plugin.h" =20 void HELPER(exception)(CPUXtensaState *env, uint32_t excp) { @@ -207,6 +208,8 @@ void xtensa_cpu_do_interrupt(CPUState *cs) CPUXtensaState *env =3D cpu_env(cs); =20 if (cs->exception_index =3D=3D EXC_IRQ) { + uint64_t last_pc =3D env->pc; + qemu_log_mask(CPU_LOG_INT, "%s(EXC_IRQ) level =3D %d, cintlevel =3D %d, " "pc =3D %08x, a0 =3D %08x, ps =3D %08x, " @@ -218,6 +221,7 @@ void xtensa_cpu_do_interrupt(CPUState *cs) env->sregs[INTSET], env->sregs[INTENABLE], env->sregs[CCOUNT]); handle_interrupt(env); + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); } =20 switch (cs->exception_index) { @@ -238,9 +242,11 @@ void xtensa_cpu_do_interrupt(CPUState *cs) env->sregs[CCOUNT]); if (env->config->exception_vector[cs->exception_index]) { uint32_t vector; + uint64_t last_pc =3D env->pc; =20 vector =3D env->config->exception_vector[cs->exception_index]; env->pc =3D relocated_vector(env, vector); + qemu_plugin_vcpu_exception_cb(cs, last_pc); } else { qemu_log_mask(CPU_LOG_INT, "%s(pc =3D %08x) bad exception_index: %d\n", diff --git a/target/xtensa/xtensa-semi.c b/target/xtensa/xtensa-semi.c index 552815ebfdb..28dfb29cbd3 100644 --- a/target/xtensa/xtensa-semi.c +++ b/target/xtensa/xtensa-semi.c @@ -35,6 +35,7 @@ #include "system/memory.h" #include "qapi/error.h" #include "qemu/log.h" +#include "qemu/plugin.h" =20 enum { TARGET_SYS_exit =3D 1, @@ -197,6 +198,7 @@ void HELPER(simcall)(CPUXtensaState *env) CPUState *cs =3D env_cpu(env); AddressSpace *as =3D cs->as; uint32_t *regs =3D env->regs; + uint64_t last_pc =3D env->pc; =20 switch (regs[2]) { case TARGET_SYS_exit: @@ -433,4 +435,5 @@ void HELPER(simcall)(CPUXtensaState *env) regs[3] =3D TARGET_ENOSYS; break; } + qemu_plugin_vcpu_hostcall_cb(cs, last_pc); } --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753248; cv=none; d=zohomail.com; s=zohoarc; b=KAyRKnjTYxLLyldU9dqrZYXxmI3LOE7eaBdjcJi1Yt7Q46OdgGCUnLt9hqyOcAOVn+qE306bkCTwhZRXuDOiA4y/tWjAxDJO/CFm1doL8D8nIt4i7QIzeVCmg4a5sYsl3OAshHaZIpSWGofmom23sa20FsEjyiq1t7z0xIFh6qM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753248; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hH1NTFxh3WCuSCKtyOLnZNkjnkW5oLfrCD/8JkcGtSM=; b=EqNP5k4Df5zf12HK/7MUthVSnHE1/pLEVCq65srxGPvyn4qdfv0a+Zg70gAz+Ge55FJhtq8ksRALgR3wEKOBfgI+X8pYtiXBuC6B785YBc2ZnA1SgepWugYChIImceMQnuiIZet2wC7LFTG7ZCwQOYQP1PmRYjm1WN/Vj8SDxto= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753248263244.83224750285274; Wed, 29 Oct 2025 08:54:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8ST-0004c7-D8; Wed, 29 Oct 2025 11:51:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8SM-0004Uv-U3 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:27 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8S3-0002uM-4B for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:25 -0400 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-b472842981fso3020266b.1 for ; Wed, 29 Oct 2025 08:51:04 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d853c664asm1468001666b.42.2025.10.29.08.50.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:58 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B3C155F7C7; Wed, 29 Oct 2025 15:50:48 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753060; x=1762357860; 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=hH1NTFxh3WCuSCKtyOLnZNkjnkW5oLfrCD/8JkcGtSM=; b=n8xv+fe6TKwfDq10WQx1E7G8nASyrCmjs9BptPSomaNR/aLIQI8KDkovIEA21cPvuk lDnF56HMDgPPzEXkUOx/tdSF1G6XWejiEKvnVM+rs8ojshFaswcF4do+BcuACcwTBkrw mQ+FSe7Fdzyi3mde+krOnX7p6QWo5y0mMUqjQvlQfDyHxQqBHDFog39vhvqlIMvDDm51 DTe2R4mRvYZJY3hDHp60on5+rW0r9UoQ0XAZJt15NbqtaD+sk09idRzNmRjkc2QuJvTP u0/UU00JquVDll5AZGhTjOuQJe3dN73igRtQm6qMKt4Zp3pHh3O9mMjhyujjLWDLNtE+ Fh1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753060; x=1762357860; 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=hH1NTFxh3WCuSCKtyOLnZNkjnkW5oLfrCD/8JkcGtSM=; b=XqT3IfMNg+uZWJod9VZyo5Gcx0emfSLvkb4rHxr8s86nZh6imUOZsw+3eiq603OSaN BycbhAbRflTdsNq2n0nYwiHmZtsQqHi8E80dOHTWvbofdYF9w3bxAxPduOk2477/aPi3 PCvuke2mDouDTM6XA5Nc0VLQiiODXKMO2a9n6WiSgJ1wwNUZ4kTor8Z6qG6uwPXr+mmy 3l/lETggrNqpGqKF+v1ir2/oGf8jE3G54FtzKGQDnICHPWJ2zPbvwx0gS8hE6shUb+I1 V6esD+ykxwsXNg//ojjQqCathEmVF6VRBNuzklmpEEGEXhs561nsokQqIesJLooUG8Pb bZUQ== X-Gm-Message-State: AOJu0YxEuZUF03rLaQUB2nA7HJQRkkgJ3zxZw+hQWRgZavANn3dNr2HQ QfmEyLRfh+vQ8kOtblQUYIYaR+iktYoUp7j+/up7jcjFzstfjB6mt6rHEqBJkRh2Nno= X-Gm-Gg: ASbGncuiiFkyKXmARIZhSAoeWe1oTxGauCIeTKDv97uz1eaJj2SKLHKf5TXRCVGGezj 8KUGxPpR8bAlwLM47GYMo33XfiqmrTModrVrIYtDBn5rG4bnjYjpqlhOOwBCpHk+jSE+gTgnrzl IR4gp6gDj+AabLAvsUlVuFF9320k7KYEAUHNihxRl+zZXtaSDqeaVAnMrXOBhGdihZOvTD1XgS6 xa3CnNaYJ79SOLg99OMEEYz+nyo8Rls2uM3BdGmvnPxuDMRV1jDETeTQMxFr/WnQaGSxx9C9g0t t/991lodG1FyxqCHW1qUrEgoDoE0HGdlRlsrOcrFEUFCXmUt99yb1mYpqeqqXRixNR5sCh19yDD Zr/MAcTYkelrZzyxqHKmPuTJq5EjOZGSMuaW80XWa6zAwK2gbqFn43vgpr+jsjjBL7fHMQM4+JO IP X-Google-Smtp-Source: AGHT+IEbWE1CIRhAp/bCaTB4SLBeyGsJgvvG3GPZz7keyKHJHG2OrM+dfL9bLdzk/JBq6eDjlEeUAA== X-Received: by 2002:a17:906:fe4a:b0:b45:e8e2:ade3 with SMTP id a640c23a62f3a-b703d5fafb4mr320500166b.64.1761753060216; Wed, 29 Oct 2025 08:51:00 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 29/35] tests: add plugin asserting correctness of discon event's to_pc Date: Wed, 29 Oct 2025 15:50:38 +0000 Message-ID: <20251029155045.257802-30-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x635.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753252239158500 From: Julian Ganz We recently introduced plugin API for the registration of callbacks for discontinuity events, specifically for interrupts, exceptions and host call events. The callback receives various bits of information, including the VCPU index and PCs. This change introduces a test plugin asserting the correctness of that behaviour in cases where this is possible with reasonable effort. Reviewed-by: Pierrick Bouvier Signed-off-by: Julian Ganz Message-ID: <20251027110344.2289945-30-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/tests/tcg/plugins/discons.c b/tests/tcg/plugins/discons.c new file mode 100644 index 00000000000..2e0e664e823 --- /dev/null +++ b/tests/tcg/plugins/discons.c @@ -0,0 +1,221 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + * Copyright (C) 2025, Julian Ganz + * + * This plugin exercises the discontinuity plugin API and asserts some + * of its behaviour regarding reported program counters. + */ +#include + +#include + +QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGIN_VERSION; + +struct cpu_state { + uint64_t last_pc; + uint64_t from_pc; + uint64_t next_pc; + uint64_t has_from; + bool has_next; + enum qemu_plugin_discon_type next_type; +}; + +struct insn_data { + uint64_t addr; + uint64_t next_pc; + bool next_valid; +}; + +static struct qemu_plugin_scoreboard *states; + +static qemu_plugin_u64 last_pc; +static qemu_plugin_u64 from_pc; +static qemu_plugin_u64 has_from; + +static bool abort_on_mismatch; +static bool trace_all_insns; + +static bool addr_eq(uint64_t a, uint64_t b) +{ + if (a =3D=3D b) { + return true; + } + + uint64_t a_hw; + uint64_t b_hw; + if (!qemu_plugin_translate_vaddr(a, &a_hw) || + !qemu_plugin_translate_vaddr(b, &b_hw)) + { + return false; + } + + return a_hw =3D=3D b_hw; +} + +static void report_mismatch(const char *pc_name, unsigned int vcpu_index, + enum qemu_plugin_discon_type type, uint64_t la= st, + uint64_t expected, uint64_t encountered) +{ + gchar *report; + const char *discon_type_name =3D "unknown"; + + if (addr_eq(expected, encountered)) { + return; + } + + switch (type) { + case QEMU_PLUGIN_DISCON_INTERRUPT: + discon_type_name =3D "interrupt"; + break; + case QEMU_PLUGIN_DISCON_EXCEPTION: + discon_type_name =3D "exception"; + break; + case QEMU_PLUGIN_DISCON_HOSTCALL: + discon_type_name =3D "hostcall"; + break; + default: + break; + } + + report =3D g_strdup_printf("Discon %s PC mismatch on VCPU %d\n" + "Expected: %"PRIx64"\nEncountered: %" + PRIx64"\nExecuted Last: %"PRIx64 + "\nEvent type: %s\n", + pc_name, vcpu_index, expected, encountered, l= ast, + discon_type_name); + if (abort_on_mismatch) { + /* + * The qemu log infrastructure may lose messages when aborting. Us= ing + * fputs directly ensures the final report is visible to developer= s. + */ + fputs(report, stderr); + g_abort(); + } else { + qemu_plugin_outs(report); + } + g_free(report); +} + +static void vcpu_discon(qemu_plugin_id_t id, unsigned int vcpu_index, + enum qemu_plugin_discon_type type, uint64_t from_p= c, + uint64_t to_pc) +{ + struct cpu_state *state =3D qemu_plugin_scoreboard_find(states, vcpu_i= ndex); + + if (type =3D=3D QEMU_PLUGIN_DISCON_EXCEPTION && + addr_eq(state->last_pc, from_pc)) + { + /* + * For some types of exceptions, insn_exec will be called for the + * instruction that caused the exception. This is valid behaviour = and + * does not need to be reported. + */ + } else if (state->has_next) { + /* + * We may encounter discontinuity chains without any instructions + * being executed in between. + */ + report_mismatch("source", vcpu_index, type, state->last_pc, + state->next_pc, from_pc); + } else if (state->has_from) { + report_mismatch("source", vcpu_index, type, state->last_pc, + state->from_pc, from_pc); + } + + state->has_from =3D false; + + state->next_pc =3D to_pc; + state->next_type =3D type; + state->has_next =3D true; +} + +static void insn_exec(unsigned int vcpu_index, void *userdata) +{ + struct cpu_state *state =3D qemu_plugin_scoreboard_find(states, vcpu_i= ndex); + + if (state->has_next) { + report_mismatch("target", vcpu_index, state->next_type, state->las= t_pc, + state->next_pc, state->last_pc); + state->has_next =3D false; + } + + if (trace_all_insns) { + g_autoptr(GString) report =3D g_string_new(NULL); + g_string_append_printf(report, "Exec insn at %"PRIx64" on VCPU %d\= n", + state->last_pc, vcpu_index); + qemu_plugin_outs(report->str); + } +} + +static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +{ + size_t n_insns =3D qemu_plugin_tb_n_insns(tb); + for (size_t i =3D 0; i < n_insns; i++) { + struct qemu_plugin_insn *insn =3D qemu_plugin_tb_get_insn(tb, i); + uint64_t pc =3D qemu_plugin_insn_vaddr(insn); + uint64_t next_pc =3D pc + qemu_plugin_insn_size(insn); + uint64_t has_next =3D (i + 1) < n_insns; + + qemu_plugin_register_vcpu_insn_exec_inline_per_vcpu(insn, + QEMU_PLUGIN_IN= LINE_STORE_U64, + last_pc, pc); + qemu_plugin_register_vcpu_insn_exec_inline_per_vcpu(insn, + QEMU_PLUGIN_IN= LINE_STORE_U64, + from_pc, next_= pc); + qemu_plugin_register_vcpu_insn_exec_inline_per_vcpu(insn, + QEMU_PLUGIN_IN= LINE_STORE_U64, + has_from, has_= next); + qemu_plugin_register_vcpu_insn_exec_cb(insn, insn_exec, + QEMU_PLUGIN_CB_NO_REGS, NUL= L); + } +} + +QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, + const qemu_info_t *info, + int argc, char **argv) +{ + if (!info->system_emulation) { + qemu_plugin_outs("Testing of the disontinuity plugin API is only" + " possible in system emulation mode."); + return 0; + } + + /* Set defaults */ + abort_on_mismatch =3D true; + trace_all_insns =3D false; + + for (int i =3D 0; i < argc; i++) { + char *opt =3D argv[i]; + g_auto(GStrv) tokens =3D g_strsplit(opt, "=3D", 2); + if (g_strcmp0(tokens[0], "abort") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], + &abort_on_mismatch)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; + } + } else if (g_strcmp0(tokens[0], "trace-all") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], + &trace_all_insns)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; + } + } else { + fprintf(stderr, "option parsing failed: %s\n", opt); + return -1; + } + } + + states =3D qemu_plugin_scoreboard_new(sizeof(struct cpu_state)); + last_pc =3D qemu_plugin_scoreboard_u64_in_struct(states, struct cpu_st= ate, + last_pc); + from_pc =3D qemu_plugin_scoreboard_u64_in_struct(states, struct cpu_st= ate, + from_pc); + has_from =3D qemu_plugin_scoreboard_u64_in_struct(states, struct cpu_s= tate, + has_from); + + qemu_plugin_register_vcpu_discon_cb(id, QEMU_PLUGIN_DISCON_ALL, + vcpu_discon); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + + return 0; +} diff --git a/tests/tcg/plugins/meson.build b/tests/tcg/plugins/meson.build index 61a007d9e74..561584159eb 100644 --- a/tests/tcg/plugins/meson.build +++ b/tests/tcg/plugins/meson.build @@ -1,6 +1,6 @@ t =3D [] if get_option('plugins') - foreach i : ['bb', 'empty', 'inline', 'insn', 'mem', 'reset', 'syscall',= 'patch'] + foreach i : ['bb', 'discons', 'empty', 'inline', 'insn', 'mem', 'reset',= 'syscall', 'patch'] if host_os =3D=3D 'windows' t +=3D shared_module(i, files(i + '.c') + '../../../contrib/plugins/= win32_linker.c', include_directories: '../../../include/qemu', --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753552; cv=none; d=zohomail.com; s=zohoarc; b=kiTEOxeUAw8FzQ70v0SO3zeqHxubrx1Jry6vAUoJOcE4vJSgx80le0m7TfFIkaKI6jfAAXaccmad32YcuswIhvJFqRSQ2lkPe/PG5rA7wfdCD0d/p5aSSPGeAkdilKkdiHtkqXr7vC/ztEGcEsGqQLk+i6y0Q5aC534WFFy4Gps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753552; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ObwLZIKrEvZcuWDrp2icwNOmPKMnNUeUMaIT0Oe14hw=; b=ckSA+uhXU4U4weABVll3Yj71zPmeoffHEYhA0hAq0kCI0Iisgl7Vq+WmJic1DYWENB9Bjk7VLYxh3qLyug7DdVUUdfl7fXFkn7j1HOi+1xrH/2IY1d60MS09xusswKOO29fIYl0xi4ZRk1NxJDeraV7kdHrKbmQ2WmrraCe1hqQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753552766704.662825997667; Wed, 29 Oct 2025 08:59:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8ZI-0005zE-Lk; Wed, 29 Oct 2025 11:58:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8Ys-0005nT-4m for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:58:11 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8YR-0003YG-UK for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:58:03 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-b6d70df0851so6120666b.1 for ; Wed, 29 Oct 2025 08:57:37 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d85369697sm1510782666b.26.2025.10.29.08.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:57:30 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id CC1D060F82; Wed, 29 Oct 2025 15:50:48 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753454; x=1762358254; 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=ObwLZIKrEvZcuWDrp2icwNOmPKMnNUeUMaIT0Oe14hw=; b=lFa5LO6S14+n9X61QWEXoV1RQ36YkRyPXaANP5ywXS0Cr/sPM/fCSRG9jDpDk5BBJy 1k5iHjJdHj/hwb6o0IbTHXTwy47v+L/Br6TQ3AejZhmwJN2s5jAt1aqXqXtmO+Z/d3OE M0kiWj7n7MI3z8oyKuLabTHloje6HsrBqtKalPjSG4PvW7ejxjyRps+KsK6NgYUwscLT aCDVYt7QPI+HnG7qGbAsgdM4tjY/XNAO4OgbV6NV1nV63DJouqj4NnU4cfswJZ8dJVWy ydGaqh73lD/km43a00Yk4ERpf7e5PsjRAoY1QNDFY/bjTavpamnLse9x3jm8vrnojrE/ ELPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753454; x=1762358254; 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=ObwLZIKrEvZcuWDrp2icwNOmPKMnNUeUMaIT0Oe14hw=; b=jFUVAif+8AcT6xhifptUDpLah1KV8To4AwEabXbful4FUgilKN9yq6y5FeQq3vc0lF 4AaehzfPdqS+zjXrCEU97xe7K/1FIKegYAU4KLsZjYlk/Y2MplVtPOsyml/nqUb58JQL nIGUA3+mDW75gyMwNeGkk5Z7bM5uZZGKoM3M+lzspIUiUfOtrkWqzpwbueH5tdZRALF2 MOBDJD7bKPNN4soEh5Mc+Qgp4PgHUhf2hUK0pQKBcphtB7VklNTGRWRQHhD6Yd7tP/Ba q3E+vT8W1fQqoNrAB8uE8sG0ZCfjmI4lTCJzSt/bVqXSiIqk7q0LT64pSxF5pCziDvBd buPA== X-Gm-Message-State: AOJu0Yyg2dB0UhyeKrVyTcc7Zd2ZkRaJadZi2G3zp705sBq+4nX+upRm hJ5nuQ2fzP+1rewrSWkyKW1otnCPDa59eHPSuvXpWPWpWoZJmeW8KtpCs9DovDe+z9ZTWfxJ0Gg HR7zreFw= X-Gm-Gg: ASbGncs1pqbOQVhCcGm1k5LsSvMLFBu/sPrOCfnNaSzXj7n9mLOLZJwtlsC/eZRvbyh 7GIMgy1i7CENRIgh89g278whtZGoLG3MU98lSiMB8g5WwW9QHLXEQipMuadV45UbGwe3efgx3IH MKKCUeRtFUWqFJpkBnGzo/8uC7RJ4L72J6D2aeNAGXD+/dir6xMIL6lavr8Ww7dXO3dxHq3jEt1 0G+XcHRLSscQ97L1VJ+2bFvrbECg0r14tK96XOHsZa+jZxqKq8311YOfdLeZWVEqgJAZJ5uLI9/ 6pFIyK7U6rm4oZ0U2yrpaRDSEnp/RkBkCNu6B2adF6lw2Kvrv7oq8SlUjttNmKHQYvhdQOyxf+l p1xl32kF8N/wO24sZHE8sp66B75HC81IUl5Q12JK4yAhV7C+3WwJI8ruvERU2UdXVsHD53dUpu8 HB X-Google-Smtp-Source: AGHT+IFy2mD1I+kh3rUvLv8rKFFdvHT/VpfbJVaiwtXxxx3DiZkZDvOIgps5s+pl/0LsPaayx1gDJQ== X-Received: by 2002:a17:907:94c3:b0:b0e:d477:4972 with SMTP id a640c23a62f3a-b703d3840dcmr341769366b.25.1761753454030; Wed, 29 Oct 2025 08:57:34 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Daniel Henrique Barboza , Alistair Francis , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Palmer Dabbelt , Weiwei Li , Liu Zhiwei , qemu-riscv@nongnu.org (open list:RISC-V TCG CPUs) Subject: [PULL 30/35] tests: add test for double-traps on rv64 Date: Wed, 29 Oct 2025 15:50:39 +0000 Message-ID: <20251029155045.257802-31-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753554027154100 From: Julian Ganz We do have a number of test-case for various architectures exercising their interrupt/exception logic. However, for the recently introduced trap API we also want to exercise the logic for double traps on at least one architecture. Reviewed-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Signed-off-by: Julian Ganz Message-ID: <20251027110344.2289945-31-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/tests/tcg/riscv64/Makefile.softmmu-target b/tests/tcg/riscv64/= Makefile.softmmu-target index 3ca595335dd..d9c0036eb4b 100644 --- a/tests/tcg/riscv64/Makefile.softmmu-target +++ b/tests/tcg/riscv64/Makefile.softmmu-target @@ -24,5 +24,11 @@ EXTRA_RUNS +=3D run-test-mepc-masking run-test-mepc-masking: test-mepc-masking $(call run-test, $<, $(QEMU) $(QEMU_OPTS)$<) =20 +EXTRA_RUNS +=3D run-plugin-doubletrap +run-plugin-doubletrap: doubletrap + $(call run-test, $<, \ + $(QEMU) -plugin ../plugins/libdiscons.so -d plugin -D $<.pout \ + $(QEMU_OPTS)$<) + # We don't currently support the multiarch system tests undefine MULTIARCH_TESTS diff --git a/tests/tcg/riscv64/doubletrap.S b/tests/tcg/riscv64/doubletrap.S new file mode 100644 index 00000000000..b61089c9c1c --- /dev/null +++ b/tests/tcg/riscv64/doubletrap.S @@ -0,0 +1,73 @@ + .option norvc + + .text + .global _start +_start: + # Set up vectored interrupts + lla t0, trap + add t0, t0, 1 + csrw mtvec, t0 + + # Enable sw interrupts + csrrsi zero, mie, 0x8 + csrrsi zero, mstatus, 0x8 + + # Engage the double trap: we trigger an machine-level software + # interrupt, which will trap to an illegal instruction + lui t1, 0x02000 + li t0, 1 + sw t0, 0(t1) + + # If we still not went out via the software interrupt route after a + # short while, we failed the test. + lui t0, 0x1 +0: + addi t0, t0, -1 + bnez t0, 0b + j fail + +trap: + j illegal_insn # Exceptions + j fail # Supervisor software interrupt + j fail + .insn i CUSTOM_0, 0, x0, x0, 0 # Machine software interrupt + j fail + j fail # Supervisor timer interrupt + j fail + j fail # Machine timer interrupt + j fail + j fail # Supervisor external interrupt + j fail + j fail # Machine external interrupt + j fail + j fail # Counter overflow interrupt + j fail + j fail + +illegal_insn: + # Check whether we really got an illegal instruction + csrr t0, mcause + li t1, 2 + bne t0, t1, fail + li a0, 0 + j _exit +fail: + li a0, 1 +_exit: + lla a1, semiargs + li t0, 0x20026 # ADP_Stopped_ApplicationExit + sd t0, 0(a1) + sd a0, 8(a1) + li a0, 0x20 # TARGET_SYS_EXIT_EXTENDED + + # Semihosting call sequence + .balign 16 + slli zero, zero, 0x1f + ebreak + srai zero, zero, 0x7 + j . + + .data + .balign 16 +semiargs: + .space 16 --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753182; cv=none; d=zohomail.com; s=zohoarc; b=n4+zJ/ZDiQwJhUj++IdMaMCGrEB59f4O+qEAlytFtLbMkVCkhwmqpnc4J+FSat+Xx4bwQshDQzGOkGMgpm4Tzmf4PAjojkgU7QxbjYGXDMv34Y7O3/hr8B0UR+6XAhBYJJO0R6F3Lj4IXjGRO+siN9laOT7oQe6YZv/OOAn7mqw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753182; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=64uzFuglk4bHde6NA01qGjQHIOCA617Oktb15rTiY1Q=; b=KhYMWfvsQgVn3n3XYL4/0F8arRadjwnGDhPen7ILZw68VW8mfsBGIKAmITbLKuD4brPkaey0hZieedKs4Iyz3qwFnddJHhcW4gjAJoOGCqJpN1J9OTfMEknlda118ZSCYLekRDQ5XgA9FgNmI5FnV8xaVpuaoAXeeDoDuRtyx6M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753182292906.3819367708721; Wed, 29 Oct 2025 08:53:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8SR-0004aP-LC; Wed, 29 Oct 2025 11:51:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8SM-0004Wc-NG for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:26 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8S1-0002uY-7t for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:26 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-63b9da57cecso11446001a12.0 for ; Wed, 29 Oct 2025 08:51:03 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d85ba3798sm1472546166b.39.2025.10.29.08.50.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:58 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id E673B61208; Wed, 29 Oct 2025 15:50:48 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753061; x=1762357861; 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=64uzFuglk4bHde6NA01qGjQHIOCA617Oktb15rTiY1Q=; b=qGJuFfr8XGefrgBpVNGSBBlTy1wDvDE3FRcb9WV8An6b4To7KUYlGqcK6Q136CBdju UlDSEmmATWl0aKAMhLm2ZFtb/Kjkw6pfdDHufPjlPo+zqBs/ZEotzk814AkieQhCmhBs AId2HAdC9KLGnhJo8ASk5xYdSt6RDx1PDFfGt2x7xXsZtbE65fC8kbt8t5Jwdp0uZh65 4VvyDHoqe5kUuphYO3zJqKYCGxlYF8TlGJo7nhsUHSQNM28srnUZowbejRxdxVku4TJU I3HzcsViobjqTfaFX0Gl1daTIP0+UEmaXTtKaXTHJlGWjnwXUeOW5RNU0ClKJgUjXWuk ZzTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753061; x=1762357861; 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=64uzFuglk4bHde6NA01qGjQHIOCA617Oktb15rTiY1Q=; b=dUd/DMZT35DT212WXboMsG6qW353qnneeLCwV/L2F7fWHc+zUTKERQeuYV/anMqRnv PZ9eJIewz8qkq6HJlt0yvsKXhy1NfGBqYKEiVPP1576QR52HDdUbhqKplc9n334+gbQH hj5U8/OcJ/PpTOW10mN1mIQeZK6ZzeBuFkvburVxJ3Zc45WFGaOfrKaeSkmJSW5EuxYU QsAe6J6fkkoxdffdefOVHTXEglL9ySF46aIku1lDe2JhDqttfSqY2/4GNezkJXf0yhUD ILD/gagC3m4BKFwJAS2/7OSU0E6RmRlverhLCD4hIzsQzIdjKhgIMmGE455i5itipU2/ rIsQ== X-Gm-Message-State: AOJu0YzKXWljgCwfmQ/1Rb7trl53+2kqJncx81NKTD3LqPutlX4wuitI 1Ur6RloXHKO3HNuBHCJQTY+LpCXB4PnxWsotThJGK+4QCzg9q3xRzquSxE3ATAIY9FM= X-Gm-Gg: ASbGncvwM2qJBY6vsE0dqPUhq5IzLFyDG5WSWq/wmxt6jpZaTFJcNTWalScdT2Yh99Q tgtzYFCixGDU07BxxiWZdKdFqO9qfIDLdoHZY4sgV6c4+muiaCjTvB86V0NE4qpxL2o9xXVptRS sZmcqiqSZDNtO3+HopDSTEiMY08QvQcIKk3qc17at0aYELnE+STl+PCkIUTz7zmytW3+KlpchEj VPOLaA3M3uT/bdqyhntpOMS4my2KbPvCCD+CRP8Pyq0gfGVPvpIBN41U2negl6OnU6qBG9MiLu1 Ln67scMnpjBQySdBlRSKHK+CgqQv+XGyqaZhIp0G9QjcCTKEVl1lrQK0cZL/XN3uab7elcF53e9 bS2LxvF+MBfnZ1EZeZUOU44CrB04lyHyffXoeEeLCzfeGCWPl70BDGXedmoWIkYxkhsi4WqajuE Q9 X-Google-Smtp-Source: AGHT+IGz4z6aiC4cMd00DKOxniMT1FGr/nDAki9jLYLnKjqPv3EKQsCigv+sIV99S9BDqtfKy7lyRQ== X-Received: by 2002:a17:907:3f21:b0:b6d:5363:88a9 with SMTP id a640c23a62f3a-b703d2dc7ebmr309686566b.9.1761753061457; Wed, 29 Oct 2025 08:51:01 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Julian Ganz , Daniel Henrique Barboza , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Palmer Dabbelt , Alistair Francis , Weiwei Li , Liu Zhiwei , qemu-riscv@nongnu.org (open list:RISC-V TCG CPUs) Subject: [PULL 31/35] tests: add test with interrupted memory accesses on rv64 Date: Wed, 29 Oct 2025 15:50:40 +0000 Message-ID: <20251029155045.257802-32-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753187245158500 From: Julian Ganz This test aims at catching API misbehaviour w.r.t. the interaction between interrupts and memory accesses, such as the bug fixed in 27f347e6a1d269c533633c812321cabb249eada8 (accel/tcg: also suppress asynchronous IRQs for cpu_io_recompile) Because the condition for triggering misbehaviour may not be deterministic and the cross-section between memory accesses and interrupt handlers may be small, we have to place our trust in large numbers. Instead of guessing/trying an arbitrary, fixed loop-bound, we decided to loop for a fixed amount of real-time. This avoids the test running into a time-out on slower machines while enabling a high number of possible interactions on faster machines. The test program sends a single '.' per 1000000 loads/stores over the serial. This output is not captured, but may be used by developers to gauge the number of possible interactions. Reviewed-by: Daniel Henrique Barboza Signed-off-by: Julian Ganz Message-ID: <20251027110344.2289945-32-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/tests/tcg/riscv64/Makefile.softmmu-target b/tests/tcg/riscv64/= Makefile.softmmu-target index d9c0036eb4b..eb1ce6504a0 100644 --- a/tests/tcg/riscv64/Makefile.softmmu-target +++ b/tests/tcg/riscv64/Makefile.softmmu-target @@ -30,5 +30,11 @@ run-plugin-doubletrap: doubletrap $(QEMU) -plugin ../plugins/libdiscons.so -d plugin -D $<.pout \ $(QEMU_OPTS)$<) =20 +EXTRA_RUNS +=3D run-plugin-interruptedmemory +run-plugin-interruptedmemory: interruptedmemory + $(call run-test, $<, \ + $(QEMU) -plugin ../plugins/libdiscons.so -d plugin -D $<.pout \ + $(QEMU_OPTS)$<) + # We don't currently support the multiarch system tests undefine MULTIARCH_TESTS diff --git a/tests/tcg/riscv64/interruptedmemory.S b/tests/tcg/riscv64/inte= rruptedmemory.S new file mode 100644 index 00000000000..cd9073ee314 --- /dev/null +++ b/tests/tcg/riscv64/interruptedmemory.S @@ -0,0 +1,97 @@ + .option norvc + + .text + .global _start +_start: + # Set up trap vector + lla t0, trap + csrw mtvec, t0 + + # Set up timer + lui t1, 0x02004 + sd zero, 0(t1) # MTIMECMP0 + + # Enable timer interrupts + li t0, 0x80 + csrrs zero, mie, t0 + csrrsi zero, mstatus, 0x8 + + # Set up UART + lui t1, 0x10000 + li a0, 0x80 # DLAB=3D1 + sb a0, 3(t1) + li a0, 1 # Full speed + sw a0, 0(t1) + li a0, 0x03 # 8N1, DLAB=3D0 + sb a0, 3(t1) + + # Run test for around 60s + call rtc_get + li t0, 30 + slli t0, t0, 30 # Approx. 10e9 ns + add t0, t0, a0 +0: + # Tight loop with memory accesses + li a1, 1000000 + la a2, semiargs +1: + ld a0, 0(a2) + sd a0, 0(a2) + addi a1, a1, -1 + bnez a1, 1b + + li a0, '.' + call send_byte + call rtc_get + bltu a0, t0, 0b + + li a0, '\n' + call send_byte + + # Exit + li a0, 0 + lla a1, semiargs + li t0, 0x20026 # ADP_Stopped_ApplicationExit + sd t0, 0(a1) + sd a0, 8(a1) + li a0, 0x20 # TARGET_SYS_EXIT_EXTENDED + + # Semihosting call sequence + .balign 16 + slli zero, zero, 0x1f + ebreak + srai zero, zero, 0x7 + + j . + +rtc_get: + # Get current time from the goldfish RTC + lui t3, 0x0101 + lw a0, 0(t3) + lw t3, 4(t3) + slli t3, t3, 32 + add a0, a0, t3 + ret + +send_byte: + # Send a single byte over the serial + lui t3, 0x10000 + lb a1, 5(t3) + andi a1, a1, 0x20 + beqz a1, send_byte + sb a0, 0(t3) + ret + + .balign 4 +trap: + lui t5, 0x0200c + ld t6, -0x8(t5) # MTIME + addi t6, t6, 100 + lui t5, 0x02004 + sd t6, 0(t5) # MTIMECMP + mret + + .data + .balign 16 +semiargs: + .space 16 --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753347; cv=none; d=zohomail.com; s=zohoarc; b=gvetjHlUuC3IU5n7tESt4zuaMiwEfcKhpFg1Bv5o4dD1u9lgQgzXJw2GAd2BclacAv2NeRhg8izbrEOkn6ZcQZ1PHo24BvDoq1QXeN1AxHLmWhPs/Btp2ZSyltJU4VKmHXCTL4nbNKl+VSCnQWlXHq1foB0w1sHB/jCmL8bhjWE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753347; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sYa79bBACSHKuE0pZ4iXVTr8fHkW5hyXRoUJItryceQ=; b=TjSoK4pIkmWfW4G2iWFUcKkB5UpYyd8uXxuppuk5jp8m9Zm7e3n2TErGRfYzuv37JVMHV50coEiz8phYsCgwVY3Lt+eAah/p5rbgTfrRzRQjfPIk2aqZGJlq3xg/p/6sDnuMo9E6QvXr9Bwc797RYtfSai1BLWUadtP+NeF6CkM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753347320821.5293631607808; Wed, 29 Oct 2025 08:55:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8SQ-0004aH-Gs; Wed, 29 Oct 2025 11:51:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8SL-0004Un-G2 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:26 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8S1-0002uO-0X for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:25 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-b6d345d7ff7so248221266b.1 for ; Wed, 29 Oct 2025 08:51:02 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d853696a3sm1458499966b.27.2025.10.29.08.50.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:58 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 09CDE61502; Wed, 29 Oct 2025 15:50:49 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753061; x=1762357861; 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=sYa79bBACSHKuE0pZ4iXVTr8fHkW5hyXRoUJItryceQ=; b=mkvN5+c2R/8o6wfpg1U5s/lCbqvpSsn3iXoou324N9ghbph5CODmzxDhtHwWenY0vq 3CoBoORceNRLEqQWiFhXAUHM04EuYMKE/JTiT/iH4CRQeBV22th/dMz7rcAE8wGLCkCT 2Bg2R0f4WU1vodjiKBJgvfIKyr6WpCsCDWQHSVul6Lmzyegb8bcuyZAqszyF2Xe9Dtkq 5ud9ejU7JDIxTYXDCRnAFFDkYLyVQ6fRcbiwqGAdnU4jD+wK7VekbAxgX0DuA1bm4YJz qw5HWCiaeRk1liPppFHzCebpInnfz9mzY1ceSTHN5ccS+Kyt6efVxiPv/l0PodUM5UVo reng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753061; x=1762357861; 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=sYa79bBACSHKuE0pZ4iXVTr8fHkW5hyXRoUJItryceQ=; b=KlxCkjRyPyPvgQEFTTvLgsrHAHD9I+8C2FnKupre4upnevT8wqrUvEGgvyymJRuynn BE0xH/MBOqDr+7zUBwtrKkomMAJlY4xejSFXO3dZRxVQs1QSiQMu1//HMUvhkXy+trH2 BZcTUhhrYl4UUnBPVa8kmAy2MpSRadkzeTI//p9GdQ8r15N9YNLduBpu/kQg3TdtpE+U OA/sr9aTzu1Cr8GiS7LrUR51m62beU6LjFpeyIen7zPOIO0ZE/DKTN39F+Xk6jsYys8B qhxLvMGiiQ+0axZBsOcwKfbqMV6w4bWA6pyJQmLkxoz8fH0vqkE+Rlx0PnDs4LKu4Rdk GYAw== X-Gm-Message-State: AOJu0YxnQk6d2aQCDKosOn30FlkRlEkzdm6NQ7FRvfs0uuSeaYq3YVRe 0OoWesRb4xD3j8vxFtdeeTCMB8STpwXRXGB1Q7c4hKrpSXgsyv0e69/cWK8TF3rHhq4= X-Gm-Gg: ASbGncs9iOsRU3gaqEteur/tHPliEky1tfl0NO21lmh6Y9yLttIloJpBvfxKv8uOveS htk9EKMPi6y455F9rr5DxEyct3G47jxrqt+OMxY2h1lB5M4uM0gIn7EYcIBNpAFt4oHdbCV3ske WNj3O9dUCLcT7OryVAF+Dq62hlkBHdWswd5Gyd1G+Ohj6/6zWWbpTJak/hSOs79IRjqEfBOIKcQ CjJfs0wbX4BwSmhvIEjNNoNDH68HXaL/u4LC5SomvkeMrfJj/OkmefxTDTnpXK8A6B596mu6Z0B MTGmwvv2/6Xz6AIO86o7/P9VZPDM/tnZZUrxNQsU+/Cy83Bw/JOIYLf5QpRKFVUS1mKqH8iTTxZ TRsuLuF37D3F2Ta3cwidPii0XTdp5K8KSCmKexlntJI6X+R0ih670MlWFbsnXEhqrtMRg0pv4U+ sF X-Google-Smtp-Source: AGHT+IGIeUByh2IK0sfxB2LNBgWWquh+c9uJUD3+I6ncNhqMB22dJ7G4NVDCsTEXywasLNBfpxh4jA== X-Received: by 2002:a17:907:7f94:b0:b3d:e757:8c36 with SMTP id a640c23a62f3a-b7051f28d17mr10480866b.3.1761753060791; Wed, 29 Oct 2025 08:51:00 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Peter Maydell , Pierrick Bouvier , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 32/35] plugins/core: add missing QEMU_DISABLE_CFI annotations Date: Wed, 29 Oct 2025 15:50:41 +0000 Message-ID: <20251029155045.257802-33-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753349433154100 Most of the memory callbacks come directly from the generated code however we have do have a a direct from C callback for the slow-path and memory helpers. There is also a reset callback that calls out to plugins. Like the other plugin points we need to disable CFI as we are making function calls to dynamically linked libraries. Fixes: https://gitlab.com/qemu-project/qemu/-/issues/3175 Reported-by: Peter Maydell Reviewed-by: Pierrick Bouvier Message-ID: <20251027110344.2289945-33-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/plugins/core.c b/plugins/core.c index 35a252d2729..8f8bc7219c2 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -668,6 +668,7 @@ void exec_inline_op(enum plugin_dyn_cb_type type, } } =20 +QEMU_DISABLE_CFI void qemu_plugin_vcpu_mem_cb(CPUState *cpu, uint64_t vaddr, uint64_t value_low, uint64_t value_high, diff --git a/plugins/loader.c b/plugins/loader.c index ba10ebac993..0dbe7bea263 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -318,6 +318,7 @@ struct qemu_plugin_reset_data { bool reset; }; =20 +QEMU_DISABLE_CFI static void plugin_reset_destroy__locked(struct qemu_plugin_reset_data *da= ta) { struct qemu_plugin_ctx *ctx =3D data->ctx; --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753160; cv=none; d=zohomail.com; s=zohoarc; b=kbQ/xFDqGg/q2vML5Yflon68oOX1sO0hQosZFFlBNonCbhtndutyoyJYQ5F9DGVfGcGUu3Qz04uqZEF2PMEMxP0ybdigNIHXMrdzqenWslMYMNc30Jt5QYAiSAwESC402jnBuQ1vckJ/eYPH3e3AwNklrnF8SI0UrLj2zJELOZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753160; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=p0oKZMPUxXOHcd3Nkbe0wu3ZFt70OnkgenyYFKHZZPE=; b=BR8YljWxk0DpwoTl05HfsLkiSxZKt9/Dj8dg6sbIG5hppGtsl00XmpCT9p/wWvN1rsgRV4FMoenmEIGbhkqTynF/imuRx7qd+x1N7yq5hrMH0N9G9e3yu/juB5R0KF3qr81tKfKMra0euaqaTzWcAoWq2DayY/ccfX/FHwUFyzA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753160571767.0495355880751; Wed, 29 Oct 2025 08:52:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8SR-0004aL-L2; Wed, 29 Oct 2025 11:51:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8SG-0004MC-Rs for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:21 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8S0-0002uD-Gg for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:20 -0400 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-6399328ff1fso12650467a12.0 for ; Wed, 29 Oct 2025 08:51:02 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d85445d48sm1452505566b.65.2025.10.29.08.50.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:58 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2319E6150B; Wed, 29 Oct 2025 15:50:49 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753060; x=1762357860; 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=p0oKZMPUxXOHcd3Nkbe0wu3ZFt70OnkgenyYFKHZZPE=; b=D0b30bfyGZ9u9jcGTfetc123EXHvmdcoc8O+OfNus57q6Le80A/HOdj/s/wH2gBlDC 5gEhZkNUXjre/wJJgxZplnl9xqedZaTCXlfGUbaHd9N/NUxHMOJVgui8AKSZyfOFQxM8 NFIpE0PZShhMJ4UIC87rtvsiGadARDHy/GY5NktqEwJhxOSuNJYfWZrzQVj5dRmGo1lp MMnGC68F5cDe8edx01Dy5zJwo0o6V6hzXsXaErVIQuZDR3awLdz4mxosgddFDBuCowyu 0ZiUsJ9gYbdlYIBfErRIkNJHje9jfsW9f34wKCYQQO9pDgTO+pBQTwnNUz93DEJ5dx7q 1W3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753060; x=1762357860; 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=p0oKZMPUxXOHcd3Nkbe0wu3ZFt70OnkgenyYFKHZZPE=; b=CYvf6LBXt6Ux0vdjjtUUx/jvX9tnf4c0JSv0xbpj0nkbWosaMVvwbV5lXWDLLm31WX ukxvItOv/FcjzCstGU5aP/1eHFGa5Jb+R/4XWsje/Udw3N9YudjNDZRXKS7llt0EjtW3 YomgUJOhVvUVZ5QPUX/666zsh0nsSdNHs8jxsf7XhiNNB1whLGnN/nsiQ4Flu82e/oGE U8hZF5GFAk7DkxuzXRSb9uHtTKNDKc4LIhQnxqXK7bvliGHItrlam/k+3cWoLWBSvn4C Z5Hr2fXzb80EkYmgo1dEX+j7c1yL9lDVN2etwkLLPWPnZSETwbC1i7amMDHs/5eeXsbq 5cGA== X-Gm-Message-State: AOJu0YwVGqkOv7AqnnWGaQzQnuEhrZULciuJKhNL3HOKJMFUJUYzVtnm CHfAMapToboaLS7n/KfbecW873VTeVBe3mN8qyN93kygyxKs/4bFjZhPO6pc9b+nJ+Y= X-Gm-Gg: ASbGncupB2ELqCDVkhCh3nkwF1VnDrSn9Lq2YB4W3cLphcQCTSQiBorOiU2PnKnxfBA cwaQmFlIkfyuM+bqcMN+56ieT0NZKG4dwNqNXv/FM1FJIoo9rQRKf7eR8OQBNAhtl8IAnpaYLy3 dU96DU6iJ+zNG385NL9fl7t22hCS2y9u3s6Rd8yMSi6dbMVJfbUuaiITDLYKd4lqsLDElgSPpOl C56JBWlfW9fvHiDCTfj9sUR79ckbUTq7qJovnKBtGMWJ1IvJ2fyd3vn63PQvU9WOOT7wnzN5C/R hVIjdjT4ibww+/xTFo6sIkAcZTRack3xx6VO3YXsEPgah3jQTwpGpF9trn7zdT+pxwaj5+Zwi4q 7bbgF3H+DiGTeSH+QZzybexPOXN08mYOJBj+Sjx+N7SV47iwb0Xaop96bKYKt9BuBI6vI3rUjkk xF X-Google-Smtp-Source: AGHT+IGKuvBhEy79VuHblpKUso6vTyb7NAr8KP1H2BIiVsfZaD/Sv0DWtN6XfpJUP4uskjc0ivVjEg== X-Received: by 2002:a17:907:94c9:b0:b3e:babd:f257 with SMTP id a640c23a62f3a-b703d2e3f5amr385537866b.10.1761753059621; Wed, 29 Oct 2025 08:50:59 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth Subject: [PULL 33/35] configs: drop SBSA_REF from minimal specification Date: Wed, 29 Oct 2025 15:50:42 +0000 Message-ID: <20251029155045.257802-34-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753163421154100 The whole point of SBSA_REF is for testing firmware which by definition requires TCG. This means the configuration of: --disable-tcg --with-devices-aarch64=3Dminimal makes no sense (and indeed is broken for the ubuntu-24.04-aarch64-notcg) test. Drop it from minimal and remove the allow_failure from the test case. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251027110344.2289945-34-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/configs/devices/aarch64-softmmu/minimal.mak b/configs/devices/= aarch64-softmmu/minimal.mak index 0ebc1dca561..3c8582e12cc 100644 --- a/configs/devices/aarch64-softmmu/minimal.mak +++ b/configs/devices/aarch64-softmmu/minimal.mak @@ -6,4 +6,3 @@ # =20 CONFIG_ARM_VIRT=3Dy -CONFIG_SBSA_REF=3Dy diff --git a/.gitlab-ci.d/custom-runners/ubuntu-24.04-aarch64.yml b/.gitlab= -ci.d/custom-runners/ubuntu-24.04-aarch64.yml index 46db9ae0138..ee13587d99e 100644 --- a/.gitlab-ci.d/custom-runners/ubuntu-24.04-aarch64.yml +++ b/.gitlab-ci.d/custom-runners/ubuntu-24.04-aarch64.yml @@ -107,7 +107,5 @@ ubuntu-24.04-aarch64-notcg: rules: - if: '$CI_PROJECT_NAMESPACE =3D=3D "qemu-project" && $CI_COMMIT_BRANC= H =3D~ /^staging/' when: manual - allow_failure: true - if: "$AARCH64_RUNNER_AVAILABLE" when: manual - allow_failure: true --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753178; cv=none; d=zohomail.com; s=zohoarc; b=P026ut7tXidj8c2GPlX5xv2+487i7RA894wz6AeC5Yk/o9d7vBzMlyXbSKyh9N52OZtI+bsA2jAwCXm351a5HhzwhRk4ob2OZLkNWQNklFxs2khg2661SJalMo2hB5egSZ8P1lduyDz+EDohE0NI4fmQT8D/rtxrohNMGD3wbZ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753178; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+sccIOnlRollRBUEGlbrGT/jg0uNfttKz/lur3Ex3hg=; b=gFO3dkpJ3EfNtDl0eb9B3Amuo++zmUEn7TidxJj1KaApdY7fcw7zOduquMgBrzWX0ciI1RJuSvg5nAPHjrVY9LSLXcrzAimKKSn2dgNA40kWr2Fx2FugJEJgR/a22LmlFw5UwM54bR1+J1sMA7wjlC4m1eJkTACNQdvRpi1ud3M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753178225148.5427608151557; Wed, 29 Oct 2025 08:52:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8SR-0004an-Tq; Wed, 29 Oct 2025 11:51:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8SN-0004Y5-JX for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:27 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8S2-0002ub-JT for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:51:27 -0400 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-63e0cec110eso12904269a12.2 for ; Wed, 29 Oct 2025 08:51:04 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-63e7efd0bc5sm12269706a12.32.2025.10.29.08.50.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:50:59 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 374B161528; Wed, 29 Oct 2025 15:50:49 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753062; x=1762357862; 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=+sccIOnlRollRBUEGlbrGT/jg0uNfttKz/lur3Ex3hg=; b=MIr/claFZu/AxLwx393RY4PKkC/38qJbTkPfxgpA/vjK+cIPNvrja/V5H7B49Ivfgv 9jw1BNK+//sR4E5pDZ9IP+mTHOmFMxNSN9et2ElqGW062fF5/7Y3SG0bfJo3ZMB1yVLi ca5+NKm/S1rB7YVRm0PF+bhnVbySGeZJn22S94euHDiVam+eSPgVEqrXfa1fViWTllce owDp2xkkeXNCRG9Q16mVkyhl3YJ/wF6eEdbnqbQGXR3Bl3YmqU92/ecXQ6t45PEk2Arz 0fj90LbOF3UtqgCpj7naZHQ38ngR0r3jBzev3G0x1/3BsJp4NMSTsMMRTVoAZuADJzFr yl2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753062; x=1762357862; 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=+sccIOnlRollRBUEGlbrGT/jg0uNfttKz/lur3Ex3hg=; b=KLRTtI0oy1uBRjqKvhwUpaLToepxkmcL9kdR8VVF6haHxJTOHlCUyBvEXLxQQi8qHP 1GzsGeKc0zMuXVf8DFwiLjTeRp8dYc0yo30UdjnTzUkIW3ENbqGTnlzCplYKUoZzT8v/ +BJFhcXScuGukStS2nVcVsBT+JMfEfbhzSY+ctQAEUbRDCWVZlu/qS+grrT4v+DFZlZo 7md+v7HSF+p1I/12bFQnf1NqZQWbSukeJIOTc+MpE4vkkYG19C9ric+QyDMFDXiO7TJt 5LLLY/6l56N3ECN/snFA3HBpVLc8YQdDqvorNpLI8iHzcmgFiOgmIDhSf9eCvJk8d9+Q jCjA== X-Gm-Message-State: AOJu0YzDFOV66owNZTyjIpUOi6P+wK/mleGoSsxaLKMQvuYNVLh7plZf tG0NnbJKLJMbsiuQ8km9+ZXKWiQF/8hwGFkjv+ZeZsZKGl4aM8NY+LjpfPDfcai+chY= X-Gm-Gg: ASbGncszFuzMigO+MC7f6epZ0ZFLcSO7jdtdR1BQXwGDoY9oQXze/0pLv1hbn2nDR+q oJmzAZ1ySRWdJG0q794TBRAASOUuLRN3ktVqN71r17XBQmjLZ5g6uS8X4JDzaM/xn/KGi8NKtlw 1IlCkX2E3pQBHiUFcYIqRykxpYICLw6Ow1GshiaP4uMVMAnbu3JmYeP1KyQx0WyFf2sM7yX/x9C iW3O++sdL5Cc7LjAGdMw1OJYjxI1TyURD1glcg7nYyUXC8m1v1xSd8nx3VM+MnA1Kq/PYHn3qKO KPkXlZHMLRB7A62E2ebvmCXjvvOMGSag0cDDnStEPdGgcO7Txcsw5hutSDEjHJLurjkcp0H2IIZ XkhEy29j7tvysyT5ixAlHMIizx2DHK1r5YWb9WVSlHOBed7qMn7lQN5JBd/xCaB8juO9hHrWr+S s0 X-Google-Smtp-Source: AGHT+IE+shmBgrMHRl7Pd04VR/EgZUFVQFpPy0OcMwEDJ/bqP+izozEZ06Nk2AfE/rhzFXaGbcVyUg== X-Received: by 2002:a05:6402:2794:b0:639:d9e7:8051 with SMTP id 4fb4d7f45d1cf-640441a9aa0mr2560321a12.10.1761753061956; Wed, 29 Oct 2025 08:51:01 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Sean Anderson , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 34/35] gdbstub: Fix %s formatting Date: Wed, 29 Oct 2025 15:50:43 +0000 Message-ID: <20251029155045.257802-35-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753181512154100 From: Sean Anderson The format string for %s has two format characters. This causes it to emit strings like "466f5bd8/6x" instead of "466f5bd8/6". GDB detects this and returns EIO, causing all open File I/O calls to fail. Fixes: 0820a075af ("gdbstub: Adjust gdb_do_syscall to only use uint32_t and= uint64_t") Signed-off-by: Sean Anderson Reviewed-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251027110344.2289945-35-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/gdbstub/syscalls.c b/gdbstub/syscalls.c index e855df21aba..d8bb90cc1c7 100644 --- a/gdbstub/syscalls.c +++ b/gdbstub/syscalls.c @@ -127,7 +127,7 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const c= har *fmt, ...) case 's': i64 =3D va_arg(va, uint64_t); i32 =3D va_arg(va, uint32_t); - p +=3D snprintf(p, p_end - p, "%" PRIx64 "/%x" PRIx32, i64= , i32); + p +=3D snprintf(p, p_end - p, "%" PRIx64 "/%" PRIx32, i64,= i32); break; default: bad_format: --=20 2.47.3 From nobody Fri Nov 14 18:17:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761753567; cv=none; d=zohomail.com; s=zohoarc; b=eW0uqsANoCQ2zualaUJqsJIzBQ++n0r4LzuY5uOXkfBpernoHfPl3yPh+re8xzd+ogiDLRa0QmHpqc2ryiKWWr2p015WeVNcGCAV4K5ZsOH/T2ZmnSEvYU2CQXKAEAvzLxHSf98rjc0xaxgJQfpeOgrdMoOmiNb+wkpE5Cb2TPg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761753567; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZKs9IymYP3ODl1NE7QfWzofFOmRouDqJpq+t2KFOV+0=; b=eFcYaWNz5TmjKwwPnoFNA5R4Q3KsJsvMOvTzWQuVk8iNE/pxDTXt871IlcXX13XO12AJczIxhPPSVLwSdSHFIh0TBDNpL93K8gD3LEXwx3g7FeD3LEG4qAnNdMXnNebz2+Zatks54xSjXjbodCvrKczIQZETMgiWvuJzE101CCk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761753567529693.3097387145259; Wed, 29 Oct 2025 08:59:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE8ZK-0005zf-N9; Wed, 29 Oct 2025 11:58:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE8Yf-0005Mn-9a for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:57:59 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vE8YR-0003YO-Tz for qemu-devel@nongnu.org; Wed, 29 Oct 2025 11:57:55 -0400 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-b3d196b7eeeso7790066b.0 for ; Wed, 29 Oct 2025 08:57:36 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d853eeea7sm1478969966b.47.2025.10.29.08.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Oct 2025 08:57:30 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 4DFC26152D; Wed, 29 Oct 2025 15:50:49 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761753455; x=1762358255; 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=ZKs9IymYP3ODl1NE7QfWzofFOmRouDqJpq+t2KFOV+0=; b=iRUPGe4QX2jlt7BB8JuKB3+T3zh10xOxpyoemn2Jf1mBDE1rjffo1w/1F/c1J5Igx9 1z2swUFbYc0n0WLdyHc54CWcX9+MsAaO2ItsFD5aX6mokVyzgkz7lwobtEbsriDKaZ09 ZSYaO1b69v4ZjGv21WsLGRupCcJbJQOZL+S+QXk8F9OOGBCPAN4qLALLtbsC/okbq7ZA vNa9+IM6WbqMfqCyiKJ4bSI2arUOh/e0grjEzeVM07Bqj4CgEabipTeg+2rpFAjFX+7O XSJC/tbUUW3Jq2s6VuGPPa/eE45+SxOoQCZSLrfVia/UO3fdRW/L1T2Mf2+hr4LvpBin Qc/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761753455; x=1762358255; 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=ZKs9IymYP3ODl1NE7QfWzofFOmRouDqJpq+t2KFOV+0=; b=XXqREOpEyiy9VU81gb8Iq9i1YnvtD0CPFlzoZcQU/oFKxsL4Vj5Ju9HQFmG+WoCKl9 iZWDh77ObVdehySy6zg1HMbadolUmnakgzTlq8RUWnhRf/aqTHqN02kvD0bxwluRj+LN XPYgu4nSfe7ZW/efP3UkSDIJPtf6mqvKIRWVIo1MT6xwxioShgOjF6Dw/5CCU4rUJHD2 y/vATHUJ9qc2MuxkRoPBUw8o83toad+/3OaFmzn1fG8V4MdU9IbnU8bPMcN7OHL0rAfG aVRK8RQvYihk3WtTrSwRkzNCPDTzRqQqF+mdFvMGcDMdno4vhYoy4dSnBk5ynQG59DkY jG3w== X-Gm-Message-State: AOJu0YwNir8dTU/2rkmlLz0WISmlIVPaJMG/45yQCl008kBkS7tM/iXM +clXV+30vKwfElvpJb24zJFAE9Akc/TTt2Q0AuFomJpa57UZrZRJJEmOvC7c7FVFhq4= X-Gm-Gg: ASbGncsW+lOtPbLEV+rZy2GiLJNB2OzLJGM0OMTbuNtoeuYX5jenKwfz8dEr0BORrso 7wybDyNE9bwGtMuJu/2klU6bghwmKPkydnuskYeo+eXOuJul/JNiM6IWypcZejZFsiNX5cmNMlA ccmLHYScVeD9xMruNCXxH4tHeTDw8DeR7YM+0RFcVh2bbBiWKvb24AgiRrevOgfN1LGpbq7uy0k rdRXUIf75rs25AhQECLciQ/reyXVeGccY+La8/8Z7bB0+fIzmngjujYnFMt75zaX5uL3GfthjdE 2rNrAwf6EHdO+iIy/9jscDahKkQWyXGZEgRHqN+zJbOuCaTt9nfbZIFK6ALvF5y9f6klEjVO8il 0edsaoLi6lxVNDSAGJcjVqRch23RfQGvuZT0jBJwQj61MGzVLyrOlhIJ4HdmXO7hVUOR5DSib5/ bG X-Google-Smtp-Source: AGHT+IFojTe/OzwaIUYTq8wn2EYUW1xDmzk+/vGb2Yylt3ska4cqbz4mJtyYYxM52PPSXHkdy9eJhA== X-Received: by 2002:a17:907:3eaa:b0:b47:c1d9:51c9 with SMTP id a640c23a62f3a-b703d5f8bf0mr347879566b.62.1761753454695; Wed, 29 Oct 2025 08:57:34 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Sean Anderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 35/35] semihosting: Fix GDB File-I/O FLEN Date: Wed, 29 Oct 2025 15:50:44 +0000 Message-ID: <20251029155045.257802-36-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029155045.257802-1-alex.bennee@linaro.org> References: <20251029155045.257802-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761753569967154100 From: Sean Anderson fstat returns 0 on success and -1 on error. Since we have already checked for error, ret must be zero. Therefore, any call to fstat on a non-empty file will return -1/EOVERFLOW. Restore the original logic that just did a byteswap. I don't really know what the intention of the fixed commit was. Fixes: a6300ed6b7 ("semihosting: Split out semihost_sys_flen") Signed-off-by: Sean Anderson Reviewed-by: Alex Benn=C3=A9e Message-ID: <20251027110344.2289945-36-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index 61001267965..c5a07cb947b 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -316,10 +316,7 @@ common_semi_flen_fstat_cb(CPUState *cs, uint64_t ret, = int err) &size, 8, 0)) { ret =3D -1, err =3D EFAULT; } else { - size =3D be64_to_cpu(size); - if (ret !=3D size) { - ret =3D -1, err =3D EOVERFLOW; - } + ret =3D be64_to_cpu(size); } } common_semi_cb(cs, ret, err); --=20 2.47.3