From nobody Sun Nov 16 01:07:14 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=1744204837; cv=none; d=zohomail.com; s=zohoarc; b=OMLzcgNCvJ4ILiRu3q+oPwpNuEaeKO/RGLRFWEdhMwPjz4fkT4C6QvREVnK/e9J/Sbtl88BQ5uUDYYgi22HoUCj6gaVNIFSoyW+tbsFQp9SSxotLY25IrXcdp5KJOZIewrCuqNnqiUCdKTsUulSRrcb6E0f4gOH0t1JE/naD9XU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1744204837; 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=SXmh4Pz+JdKMkMoqi+bpTEVJj0ToleTDtvfkr+bT2oU=; b=NguxYxsCjqBkHAkyfxrHGHAMTUPHD0wfimUmGpEY/7xnbrfzGtxzAenJBgo9r9w1Gi+4fwF+9pLGCLDncmpEo0/ukSho7WuIA/jqx2Ww/lDpe6/AX/66LClEJmdZRt/ctCtAz2QoneyYqmDIwK9amufWYtRiL7Lmsm5nubRYC7U= 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 1744204837048402.8972613100881; Wed, 9 Apr 2025 06:20:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u2VLN-0003qB-AK; Wed, 09 Apr 2025 09:19:53 -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 1u2VLJ-0003pH-EP for qemu-devel@nongnu.org; Wed, 09 Apr 2025 09:19:51 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u2VLG-0001OH-FS for qemu-devel@nongnu.org; Wed, 09 Apr 2025 09:19:49 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43cf257158fso47655045e9.2 for ; Wed, 09 Apr 2025 06:19:45 -0700 (PDT) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39d8938b5e7sm1659443f8f.55.2025.04.09.06.19.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Apr 2025 06:19:43 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 84A0B5F8FE; Wed, 9 Apr 2025 14:19:42 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744204784; x=1744809584; 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=SXmh4Pz+JdKMkMoqi+bpTEVJj0ToleTDtvfkr+bT2oU=; b=zXm1MRXO1FdSGbBHjVkjn48Pw87aG7ZvY1wYcev3hrdWlSpSyOH5RSVVtbgSWja7HB Z1HmAtiTlKDBIzYTZZpOgshsYU+JrXjjgLBesCrMfqUypJ8Wi6VXAtvtKm2DBRzwGjiC lCACcq3fk0pIeIrqGtlz5Ye5ih7QxbeQEGmmOvDYHey4dhOKIkz+YCabOJVDi9iX8Uv7 gQQB3Dw1b7dQpoKo0xTg4OGJ6nQ09Y5KvDidaFLxxieFZ5VY3VefGWtRo0hwV0jkKlVy brWQcx8jiWZviAdWhYGIAswxaalGWjk0IxKjVROxwrEKLK+iZGmPb30ncXPg2v+gJjAM SdUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744204784; x=1744809584; 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=SXmh4Pz+JdKMkMoqi+bpTEVJj0ToleTDtvfkr+bT2oU=; b=XWznjHc8ExehPBF4kXcYlfcPu7XtbrdHsQXx6dzePEAR4Qm3mNa33AceN3pOO0+qsD I79TwhHpLRCTefuodu0/uhCc208CKCOR1MB04j06TKCphNtowlkEhH7L20abOQhr8mCr EagwouRa0BNHyE5Chf3BblCFwTJWk6SgDGKF3S/uV8isJ3Z+giZGjfrAoVgATKZl7786 Y6wzre95tIW0R+JJ2vEigHiOmqstKblIOWPBd5TgxpBrB8+inIR8I4m6faOE4szF0bvH fBRyx2sgsJH3L5oFfjssJRfsvQXpIqYQqpu3U49MjqK7Jes/7QqyIRiha7lTYytMIySV HJHQ== X-Gm-Message-State: AOJu0YzMnL+9MgQugOZt7Y+V6IKfoI3VUkmM05h7/NqmVnv0yl+LbWgx 8IECYpA1jDfcdplPPTMr9W5YVOvcwlmj0PSeDg6H7bcJtcjkAqW3/RSvFNmtEhA= X-Gm-Gg: ASbGncvBdEDw/x70cHwCLeKMIFtpKVXz/ffVcmZFCOkKHXR4mPuukZr63ULQ+meOIoA GiJo5fPhOsoPMWypBCu8PcFIMQ2T7IMjGM/xmayxDcBtfj04+LDJZkKvFNVY0DtphIJ+liRVe1o 7uyzlw9XLKQzYqx7lO5kIFz8NQxc+rLWUWuDeiaAhirAq4YzQjhN2ke/VaensES5doaoScZqSwJ 2Qo397Fe0VNUy2P+vMMenZ6ezinc3H4pj+gvr5QDY1T8ZUHQtY9AnCSmzUN3A9hrCrZbWcVrkkr XvVJHq8xH6Cdyh++nHXaTSYVMpR2pcQ+3b8PfEV/lT0= X-Google-Smtp-Source: AGHT+IHYpgKexWRdwsFyKGnraCSE8mga5rua+aPA1nHwnn17ot5chqURInbbVaP5X+nvu4/I5cz65g== X-Received: by 2002:a05:6000:430c:b0:39c:1257:c96f with SMTP id ffacd0b85a97d-39d885652a9mr2349953f8f.59.1744204783833; Wed, 09 Apr 2025 06:19:43 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Peter Maydell , qemu-arm@nongnu.org (open list:ARM TCG CPUs) Subject: [PULL 1/3] tests/tcg: fix semihosting SYS_EXIT for aarch64 in boot.S Date: Wed, 9 Apr 2025 14:19:40 +0100 Message-Id: <20250409131942.1706923-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250409131942.1706923-1-alex.bennee@linaro.org> References: <20250409131942.1706923-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::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, 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: 1744204839912019100 We don't expect to hit exceptions in our testing so currently all the vectors report an un-expected exception and then attempt to exit. However for aarch64 we should always use the extended information block as we do in _exit. Rather than duplicate the code on the error handler just branch to the _exit handler with a failing status code. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Message-Id: <20250404115641.258048-1-alex.bennee@linaro.org> diff --git a/tests/tcg/aarch64/system/boot.S b/tests/tcg/aarch64/system/boo= t.S index 4eb1b35b88..a5df9c173d 100644 --- a/tests/tcg/aarch64/system/boot.S +++ b/tests/tcg/aarch64/system/boot.S @@ -73,9 +73,8 @@ lower_a32_serror: mov x0, SYS_WRITE0 adr x1, .error semihosting_call - mov x0, SYS_EXIT - mov x1, 1 - semihosting_call + mov x0, 1 /* EXIT_FAILURE */ + bl _exit /* never returns */ =20 .section .rodata --=20 2.39.5 From nobody Sun Nov 16 01:07:14 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=1744204890; cv=none; d=zohomail.com; s=zohoarc; b=LLmmRVaOcSXf1nxYlzhPWb9+maYDCjk5B4P+n95cNvlzR+ax2q0CEgPFYtUNzG2yXvrGl8fqXgN7ZkDxlTuo6IjEf/mIGenFpfNXka2C/RzLpN7ym1TTENwBi0+W3w1z3CsrczXt+KSpPh627AsPS7/8diwAqLI1WXeO/N2rtkE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1744204890; 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=GgHci5TdeWB9Jnt/+CYG1K2MnKTxniGuWHN5F+y5RDQ=; b=CxUUsYbnHp5bgs9VgpkqI3QJkXpZw5rBnaO4Qu/WiNuaulRVKGVHfKGUYtYZlVHSiSoX+Gjl5kOKxMw3bXp2dByHRCsWgGrRSILmJZ3/mC9Md0XFUpiseE0r+9Co5HBdaLZy90U7w9qZ8OaV/i2qIAVLu3BMVPtQDIuOeVTX15w= 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 1744204890465989.8556791393626; Wed, 9 Apr 2025 06:21:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u2VLN-0003qa-Kf; Wed, 09 Apr 2025 09:19:53 -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 1u2VLI-0003pF-6Y for qemu-devel@nongnu.org; Wed, 09 Apr 2025 09:19:51 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u2VLG-0001OK-F9 for qemu-devel@nongnu.org; Wed, 09 Apr 2025 09:19:47 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-39c0dfba946so4317000f8f.3 for ; Wed, 09 Apr 2025 06:19:45 -0700 (PDT) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39d893f0b82sm1626392f8f.66.2025.04.09.06.19.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Apr 2025 06:19:43 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 9C4D05F9E3; Wed, 9 Apr 2025 14:19:42 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744204784; x=1744809584; 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=GgHci5TdeWB9Jnt/+CYG1K2MnKTxniGuWHN5F+y5RDQ=; b=iLyAwMoXtXXSEVbNprhkeumXRGhMgA3xlmFQuZyr3YXvGcJAyu5+Cm/HEDs9mSAaRi dZGP/TwLeEdF3gnD1HdPuR4NLbbT0XcyxvIaQOebdcJeWDlVdAv7ghGR+bNJVi4qc54q kWvHXEzRMyRhGUmgLjcyP1yS1uWuCW7m4bpPE7TMOh38yWQuUn4ehoLoFnQdr7Uli1ta bYymgSJmrsKre+l0lBSmZk6eUiaNINR+cOU7mHeG7O7ZHTIGbV17Ofx670T9Vg1Ldd2M KKFDGWqCqmvnGKiCrrFHyWGSAIkfIij7n4ImJEq2mKGLrxPQOcHvhUX2KhcdgNFDeIu9 8WKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744204784; x=1744809584; 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=GgHci5TdeWB9Jnt/+CYG1K2MnKTxniGuWHN5F+y5RDQ=; b=K4QkrV6mCBsUgydUj+W4XRxqSH/GLO5Rvwy6f8S2aO4KlVpmmfH0VwomZtwtWY09gs ty7QcrhdyEK7Jovjmnxf0uuRt7iyhwQp6N/Bwexl8kStcF/9TCYMNPq9JKXN0I6/TSzQ 1Gl02ydUNPjRfZ41EJ9OVmfo9KsPB5mHeFCv6pMcdC3/FW7zpiLvG3HOf3EQVVhTsYK8 QGHRMtahQIYVMqs4j9JzhgH/ykdwm2NG0EYd6dIuYhfV0DSTtCOUJYE7yWfJQonLK0iB y8hFzm99oaGIOxKm30qt4pQcD1e8U2pMpLXIb4XFNpt329L0nMgKYXQ13fs2+nNq2y1p 0Q2Q== X-Gm-Message-State: AOJu0YyNLcg8UKRG7X8dKMg7as8fx9xB2oYDChBMQNXxbA7WzQunWjwq e0HeWisRf46xPROfMwhrx8Je1VrxmpJWTcvI7mhQCND6MqB4V8/Zz/Ho8aMWEpY= X-Gm-Gg: ASbGncuGbo+bZtqnCwCz/9gwCsnNLtC7F5Ftj6llUP1wAMOJq3JUsX+4chIygVQrIW3 ZDrbpPPfW4oh4m1J0vmqx5t4RYSNxvcIxeU7iA3yXFX+5zmybXNaZekYh107l63HYXryoiqx++y WzA9PM5+VVPiREjm5+wql5nXKSUbMkrUG3RgvTSKPfhU7Zb0dWqghX/zO3GGqbtQxKyfL85A4OY XDZagKbscf51qz6MNPOUNk73ufXezZIjjiEI3BTjmce6yy+aozQBhqYdAkvKvSBS9gbi94orsyg LVKINF+7xMaBbYkJvwtkcGfEGhfkrfJOEFmAyqCzwhbZmLHSVSMMMw== X-Google-Smtp-Source: AGHT+IGn9rx5/KUUNL8CkgqvjYLC2lH0ye+ydSVMbj827edbwDuHbC/pV9tOl4VF8MXq4YtRsdULfA== X-Received: by 2002:a5d:64eb:0:b0:39c:3107:d68d with SMTP id ffacd0b85a97d-39d885626a2mr2229181f8f.49.1744204784141; Wed, 09 Apr 2025 06:19:44 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 2/3] plugins/loader: fix deadlock when resetting/uninstalling a plugin Date: Wed, 9 Apr 2025 14:19:41 +0100 Message-Id: <20250409131942.1706923-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250409131942.1706923-1-alex.bennee@linaro.org> References: <20250409131942.1706923-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::432; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, 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: 1744204891819019000 From: Pierrick Bouvier Reported and fixed by Dmitry Kurakin. Fixes: https://gitlab.com/qemu-project/qemu/-/issues/2901 Signed-off-by: Pierrick Bouvier Message-Id: <20250404032027.430575-2-pierrick.bouvier@linaro.org> Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 diff --git a/plugins/loader.c b/plugins/loader.c index 7523d554f0..0d6e082e17 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -370,7 +370,7 @@ static void plugin_reset_destroy(struct qemu_plugin_res= et_data *data) { qemu_rec_mutex_lock(&plugin.lock); plugin_reset_destroy__locked(data); - qemu_rec_mutex_lock(&plugin.lock); + qemu_rec_mutex_unlock(&plugin.lock); } =20 static void plugin_flush_destroy(CPUState *cpu, run_on_cpu_data arg) --=20 2.39.5 From nobody Sun Nov 16 01:07:14 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=1744204888; cv=none; d=zohomail.com; s=zohoarc; b=XZ3x6ozDkyjdmnF+0Hhkeo32zfiy+8Wq/LcZRSLrPEqQ7mPoBR5YFlgNeDHPvf95hofgO3+FrHOuKmNbcVYyPLN7MEQwCP8lQsFHyjobzBMAdqOZ8vQKluJZL33/Rot/f4UjqMcN3IbWArq4z/9VQsYVHZpUqId7zz00tFWrxkQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1744204888; 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=LPim0OCZ4SdNm+PdrMyC88tt/xq9iIkHytGr1uhNXmY=; b=IxyksK9N6sjJCoAb+ujbT+240apou45kgZKW5y3DqJDU4j4sPw4c/ELU4ZauSoDV2PhPONIWCWGfm3Emv84yRd46lmS4itGpHFEZ3b4PuHKH5XwzxHujDHsuGrPakJTWIXlmmhtGQtHHGvY9AimwI02G3oirzDsBhWXZtAc8uJs= 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 1744204888027489.7898192270734; Wed, 9 Apr 2025 06:21:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u2VLR-0003r4-Gq; Wed, 09 Apr 2025 09:19: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 1u2VLM-0003pi-0E for qemu-devel@nongnu.org; Wed, 09 Apr 2025 09:19:52 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u2VLG-0001OM-FC for qemu-devel@nongnu.org; Wed, 09 Apr 2025 09:19:49 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-39ac56756f6so5678112f8f.2 for ; Wed, 09 Apr 2025 06:19:45 -0700 (PDT) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43f207cb692sm21103135e9.40.2025.04.09.06.19.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Apr 2025 06:19:43 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B335E5FA4B; Wed, 9 Apr 2025 14:19:42 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744204784; x=1744809584; 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=LPim0OCZ4SdNm+PdrMyC88tt/xq9iIkHytGr1uhNXmY=; b=HH7BmVS9c+xGd0Ju8AlYwu1FzGs0/HQ8/yl8Qw7ArbRj7AYyepWVi47RuoKKXduws5 Ny9fl2CkaU0CrS1EebDT3vpDbvyCKxplm5n0uloyPii4SgiQZU+8bWCSgybURMwXdiVW Wh+B6JBgORby+aCHlRP56iFAWmECOmLNUr7h3mJNXKZB6UF4ZfsRH9IUg3VUSLdaIddo z3imM1EOPw1q1T+TQB4KX6yplhG0Mzsyydq7ZJj+2qF4r0GKO+G5YG6Hnagy374cmW5X RDgYcwl0+DMLVZ/Y0S44j53Oh4H0KKvH41aiy8i+Fzv33sV+tgts7OqkpAU/tyGf/4K5 yc+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744204784; x=1744809584; 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=LPim0OCZ4SdNm+PdrMyC88tt/xq9iIkHytGr1uhNXmY=; b=QAF4/74bQQpIXxXG6z4ufY2uLsi/F1g5z1MHLYNOPEWQpzNhBiQbC+ZewI80RmRagJ Mizp1nnVXZjYcPiNfwP8C7aXV9gfYAmaXnGmXZW9xiyo49q6PhsnLu/o1A1ol0t+pjmW gzJz7cxHSsueBg5Oc5lib+5B1jtnFXtgQ7njlYjljf5Jk0xjfDvdqLv9UHb32TsmBZHC TDlUl0kThWSJOb8um2OLANYF8f5gcUVijOomgBpZBfCJ1CMfEdHRy9Zgc78/9M4ax8Yw wVIfWzxjey0LvAc+TvGneld/fC4PIzPd6QnZNz7ZYELxybpIIiT+fshnfiSFHXkC2csT TtJQ== X-Gm-Message-State: AOJu0YylxKtkBLK9s/s/kIu59Tgg9fcvLs42lxbtEaX7PGiOfdcZWRSV oGoO+9bVS8LSibzV+ttE5HAeco/EtwD0Hox6OPVT1maKxj4NU2P5O8/6vtkqESc= X-Gm-Gg: ASbGncvxyLW0joEo+isvytclgudcsoQZqqJR6bj6SMiZvQBYMUpsTHn7JJVtjJKlUdA sx8qs9jK0OmL1mRuf5ci5Bvaqwb0WJp6NmfLiEAc2SC+kxGhA+0U8Eo64P5TVl6HmOqzTOOVYn3 FmX4K4rmfTRSISjC6UBvW4HUx//zJZRC3ydnb4cn7bFcLofz3JUSIT6LRS+FNUFr/YishT5GIPq 4x/SR9iUVRn4etkuwKo50Zk/fYDvz2tLsLZ9wyqTLdjMnXDw8oAJq0KmKSdsrGO0NoECGX2/HuJ M5+4WzWreiCZq2MvSn2c7LazO+TVTuqqXfjblII55Qs= X-Google-Smtp-Source: AGHT+IEARGnNAxxnnuzeewKTYHrS044Q6VjpWNYmCyPnR8TT45LX9p/qiLKUx1gyPPRLxBupx+Nxwg== X-Received: by 2002:a05:6000:2913:b0:399:6dd9:9f40 with SMTP id ffacd0b85a97d-39d88524404mr2322897f8f.9.1744204784436; Wed, 09 Apr 2025 06:19:44 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 3/3] tests/tcg/plugins: add plugin to test reset and uninstall Date: Wed, 9 Apr 2025 14:19:42 +0100 Message-Id: <20250409131942.1706923-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250409131942.1706923-1-alex.bennee@linaro.org> References: <20250409131942.1706923-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::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, 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: 1744204890888019000 From: Pierrick Bouvier We perform a plugin reset, uninstall, and make sure we went through those steps. Signed-off-by: Pierrick Bouvier Message-Id: <20250404032027.430575-3-pierrick.bouvier@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/tests/tcg/plugins/reset.c b/tests/tcg/plugins/reset.c new file mode 100644 index 0000000000..1be8be2a4b --- /dev/null +++ b/tests/tcg/plugins/reset.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2025 Linaro Ltd + * + * Test the reset/uninstall cycle of a plugin. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include + +#include + +QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGIN_VERSION; +static qemu_plugin_id_t plugin_id; +static bool was_reset; +static bool was_uninstalled; + +static void after_uninstall(qemu_plugin_id_t id) +{ + g_assert(was_reset && !was_uninstalled); + qemu_plugin_outs("uninstall done\n"); + was_uninstalled =3D true; +} + +static void tb_exec_after_reset(unsigned int vcpu_index, void *userdata) +{ + g_assert(was_reset && !was_uninstalled); + qemu_plugin_uninstall(plugin_id, after_uninstall); +} + +static void tb_trans_after_reset(qemu_plugin_id_t id, struct qemu_plugin_t= b *tb) +{ + g_assert(was_reset && !was_uninstalled); + qemu_plugin_register_vcpu_tb_exec_cb(tb, tb_exec_after_reset, + QEMU_PLUGIN_CB_NO_REGS, NULL); +} + +static void after_reset(qemu_plugin_id_t id) +{ + g_assert(!was_reset && !was_uninstalled); + qemu_plugin_outs("reset done\n"); + was_reset =3D true; + qemu_plugin_register_vcpu_tb_trans_cb(id, tb_trans_after_reset); +} + +static void tb_exec_before_reset(unsigned int vcpu_index, void *userdata) +{ + g_assert(!was_reset && !was_uninstalled); + qemu_plugin_reset(plugin_id, after_reset); +} + +static void tb_trans_before_reset(qemu_plugin_id_t id, struct qemu_plugin_= tb *tb) +{ + g_assert(!was_reset && !was_uninstalled); + qemu_plugin_register_vcpu_tb_exec_cb(tb, tb_exec_before_reset, + QEMU_PLUGIN_CB_NO_REGS, NULL); +} + +QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, + const qemu_info_t *info, + int argc, char **argv) +{ + plugin_id =3D id; + qemu_plugin_register_vcpu_tb_trans_cb(id, tb_trans_before_reset); + return 0; +} + +/* Since we uninstall the plugin, we can't use qemu_plugin_register_atexit= _cb, + * so we use destructor attribute instead. */ +static void __attribute__((destructor)) on_plugin_exit(void) +{ + g_assert(was_reset && was_uninstalled); + qemu_plugin_outs("plugin exit\n"); +} diff --git a/tests/tcg/plugins/meson.build b/tests/tcg/plugins/meson.build index c8cb0626a6..41f02f2c7f 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', 'syscall'] + foreach i : ['bb', 'empty', 'inline', 'insn', 'mem', 'reset', 'syscall'] 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.39.5