From patchwork Wed Apr 9 13:19:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 879360 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp5979283wrs; Wed, 9 Apr 2025 06:20:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVk2GTuyGPgJbgLjtASkTKGmu4ZKZFHElh0qh2vBFici8dHtrWZOcsgDmLYER6d+J5C0M+bhw==@linaro.org X-Google-Smtp-Source: AGHT+IHAL5r4MC/k6IWoNOW4FbmHM5WGv4MCf7skmioJSGeoNKdQ2gJ1eIrEtUujvQGubDpPo/dH X-Received: by 2002:a05:620a:658b:b0:7c5:ee84:a575 with SMTP id af79cd13be357-7c79cc373f0mr321526885a.46.1744204836715; Wed, 09 Apr 2025 06:20:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744204836; cv=none; d=google.com; s=arc-20240605; b=Kdket42O6c/RBu1vviib9r8xA/GyAkpXuyQcak0ag+8qiloD2cjdpFeIKvV4ZykKav ja86/A4FQSDpExSi/d2YiHjov/NC0NCcZaEQ1svqrmRX7QxQtrPd2RmAc6dnYxZ+kg1i fqFN6qAwGAkeENnjpn6XhjLmf7dq5MhUS/2DrfPeGxX7TLLxS71EKKMY31Q3uwdz6la2 dbDagvYYAAzvgIir6llCgrQAEdESdM6e1AfzU3KWqE6USZKc9wR08StLtUjUip9zvR1m PSLRPBdY8oeMXdqtnw1M2P3r2Z1ZJtM9hCYrOFjeuuMBTz1IAAq1peJ7Rf2J83TJvcgJ WGcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SXmh4Pz+JdKMkMoqi+bpTEVJj0ToleTDtvfkr+bT2oU=; fh=LkLRa2TvX96vEhUMtmPTVSftmtuj5rc3ChuwgSxkkQw=; b=Ic3JZECfxkwL8Li+L2gq8QGgDs9EpQ8XWTcsSDGMSPF+Jq1NXJpEFwiU4b+sBxNpYd 5zAA3oSz43UDIK0FeItvnPxLk773TLTDXZuoSf+4g3Z4uVDDBDbyiJDp36u/SoTLSz6q IsAHDx415TW98kY5g4NDIDNat6xRTbAQUvJHnLfwoeavbm8hI/WRSlGnl5i70uCEcnni hHtYaNZzYUnYpz+EZcfDOx17GBIj22LKOfmaL5RRXf/8ssHCR6oOeps4VvL/U5L/gjop GE4j7+YAHHlF3Bhio9B/V687GDdWu/xu4yFnAaZgWiSQo3GYgAn5odFnLS438w4Q4B0X jgOQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zXm1MRXO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c7a10b2771si94517085a.46.2025.04.09.06.20.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Apr 2025 06:20:36 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zXm1MRXO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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ée 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/boot.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 */ .section .rodata From patchwork Wed Apr 9 13:19:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 879363 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp5979771wrs; Wed, 9 Apr 2025 06:21:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXzLbEhv3XRAayzBWPtWIssenW0bDPYJmFlfjTGywfuwDH2suB4BGgr/laKrVYrZLXUwKnpKA==@linaro.org X-Google-Smtp-Source: AGHT+IFD6taoceT9yAQ2jsLmOIX9h3Le+2F14kVfAXmwDVLU7rQoDFCu+RNZCcUJ7eH+VRnv6eik X-Received: by 2002:a05:622a:1892:b0:477:1f58:e18b with SMTP id d75a77b69052e-4795f2db23bmr28931641cf.29.1744204890285; Wed, 09 Apr 2025 06:21:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744204890; cv=none; d=google.com; s=arc-20240605; b=lxzn/xL+kBlHzE33cSCMYEiMqT0nIdjP5Qd+21jeikcsQKBCqmvtKGkGr8YVJ4roJq 4KJZrLpzmUjOuIaK2fSu8mdpT7CsvALm4R+ocj+JlwdX+6p+215ofdswcazPcHlBL9Dp 4UP1g40bNzShEsHiFX9aSHtgQRZHVU+FMYqfZddf78rrSJCZkxiT6xc+NAvNnuxI7rkK EDkme/2r50alFnQSoCLvG2hB0QfmKfNQIoTZ5p1OdwhHrCCUTCXbzs+jTBylcTrjN1VO YJ6RWRLczFomC104y2jU6JamYFUh7rpcbihYZrYaut3qcGoh9Avewe//8x6mKUojy+S9 ILxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GgHci5TdeWB9Jnt/+CYG1K2MnKTxniGuWHN5F+y5RDQ=; fh=T11j6/yJ1mQ1jbIvrAgmAYu42JybinRMk9AEEVQ2wpo=; b=isve1Lfhd1s/uC4W6odOeFwLHqttrzv3iVxgxuwOvfyl7nTdseWAfUmXT8pStHNeAc He+exZk2FwxdT2I1PLVd9849HWprx/kjKXXATIFQc/SWb0F1tNpRR0u18qEyrdFEPSeK KdN1xIPOi92qpop5TNeKRd6zeAH2AbFzOWXlsrVrHGabKbzPCtWubme9HjSeumuHRmRT +EWeLnGej08T+2G1koJZ23wE3uO59GJhm5Lf+7YtH7d4XKqpir8Z3ZC0vF898DjzJO4w uGgcR8Wc1+wDdiMIRoicIep4v26h9Uej9DXOEOT6nmD3XzpcZMwedevBUOHI77wxiC1H VKSw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iLyAwMoX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-47964f633a4si9542801cf.612.2025.04.09.06.21.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Apr 2025 06:21:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iLyAwMoX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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ée Reviewed-by: Philippe Mathieu-Daudé 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_reset_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); } static void plugin_flush_destroy(CPUState *cpu, run_on_cpu_data arg) From patchwork Wed Apr 9 13:19:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 879362 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp5979747wrs; Wed, 9 Apr 2025 06:21:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWsrHHP6qfnsGb4TU7KPxmAHN0WHgVLVyVmkUugSJLfC6u4fg+bhq+B4tKFQmdPOOycp1l5Ag==@linaro.org X-Google-Smtp-Source: AGHT+IHlmpIC2bngHtrOiQm+9i5zRlB/q10Pg3XsTlEmOT3HVX0MDT8ha2/Q0HmTKIiXh6WrYUJ6 X-Received: by 2002:a05:6122:1826:b0:516:18cd:c1fc with SMTP id 71dfb90a1353d-527a9deb365mr1166336e0c.8.1744204887808; Wed, 09 Apr 2025 06:21:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744204887; cv=none; d=google.com; s=arc-20240605; b=k5dq4q8u8bOr1O431UFP98yWT9myZhIvC4sZ0FmBZL88MySfI/5DrWhDgUHSRVc1bo rHkHavbex8sKN1ySQWdVbX4HYdhGmHfbR0eQwK4t3OLJyKztKpAcaCDdr+thhc6o+vJ/ xADGotmtOHlo54reXRrDWNkKpMhA7GzbbIMe2iVChDZowThkFvJWYUttY6q+vlS76KJ/ bENsE3B/zVEzlx8S5LOuZdcTHXiiL0tn9IPiJ/+EoDj17DuvaZjIzh26L66NNRoVHJr1 nvVGePqCK9z5Vympbo18THVZWQp3HuGpshm5l9z03oZeregd2ltHhrY1iVNj5pqdogA7 2Seg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LPim0OCZ4SdNm+PdrMyC88tt/xq9iIkHytGr1uhNXmY=; fh=tsEijvkx1NbT6Ur0mdaogUfqsbV1AR4G4GAX7WVZ83s=; b=jhEfBnyV3lEvxT3w5RqKbVfSWlBMNIZwG300Zq3eU0ROe6NsRn5zZXp4JonXOjfHN8 HIQGgvSfVjaYTx/kd/2CQBMCNWA4lUgqJK/3SO5eHRwZAuqQVhkVkw9ckF7K2U7gPEiq pbNrFHo/2Zn80zQSKmeKxkV5r0AHR4aR2b3kanCY9P+q3hNn9naQ05KIf147dM52DBZk 01zAKRAhoXb63G4JR64nE+8Mp9ynrsxfW4xUl3cUjKY3NBs4lIa28jHG3xXfJjxrvWSW 7gn+3ks6JaD37ak5t1Ojslxscm8wyhKudCJ8hQeJ/gLrCWa4xZipDC8i/N+fh1aaKg8k TpBw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HH7BmVS9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-527abeac81esi265511e0c.252.2025.04.09.06.21.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Apr 2025 06:21:27 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HH7BmVS9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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ée 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 = 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 = 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_tb *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 = 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 = 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 = [] if get_option('plugins') - foreach i : ['bb', 'empty', 'inline', 'insn', 'mem', 'syscall'] + foreach i : ['bb', 'empty', 'inline', 'insn', 'mem', 'reset', 'syscall'] if host_os == 'windows' t += shared_module(i, files(i + '.c') + '../../../contrib/plugins/win32_linker.c', include_directories: '../../../include/qemu',