From patchwork Tue Jan 17 03:56:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 643393 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp951271pvb; Mon, 16 Jan 2023 19:57:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXse4bRdLSAepXLt9MuYsDRI8ASUjDC9PuyqjxP+oQqIBwOmvSTME/tjwcH/Q/BHFQa7dZpy X-Received: by 2002:a05:622a:a09:b0:3ac:fba0:cde with SMTP id bv9-20020a05622a0a0900b003acfba00cdemr2030996qtb.22.1673927866500; Mon, 16 Jan 2023 19:57:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673927866; cv=none; d=google.com; s=arc-20160816; b=ckFlWiNQHO20KeXg5FmE/iVXmKt3eVtlquTGSaAedZZpOtXowbTkc1zjZuDeJZS/+3 qdJnfRnw5EmXDjmlXdN9iKcZLXjUNY2sOVCCuk+mtGGsPu/8C5/nCwVLNivTPMNFOSl3 geggWkdk28Ki7c/lTnSF5YGQezUC3mrxq7cM/KgLz0cBvKoTuYkHCMTEpIqcM+DsqmoU dzfdW78jJUlHM9jWJf+VXhUy73hLFntNpmLhGsUNgahZJX/VJ5SM58pHS3ef1FcnRHEg yyj71NgrVJKmx104wZ+7ugatKv4/SDzDxc/ifp9hQbVW6kJhadDzVVWDSz+/VtQ3TV3F wrKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=m6MPxEUMXrC89FYEjdJ+17kvnFvsaHy/DYKnQJ+XOEw=; b=BTPvCVJLxSd2qT7bzrsWkd+hY0ZpDRYNN1xv7p37D3OEVydYKJNY1YazNpW1s5e5ad os8m99BHMDJlq0ttosPtHDnpOkmF6x2yHU2+vX1HcWbD9aOQaZ9lcQgSXqE/ngCwgxKW xEZ68K6MOojmJYRGbdmVS0/tdySSFYwKM+Z+MHl0sKOgG1JJH3A+/a2bcC7hbMwXtw9Q 96wjv533FVc/zAB8tIkdHSsxolaxUnoD5yQPmNBbjHrCCiE8WL2rPbzxtSORk4abjt9d AFD/IBhgaC/9zO1sUXkCZEyzGa8+8qQq/jnDzX889NITnwIE5YUIW0jJK1JjW9IplWWm 8bnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="KKjEzz/4"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d62-20020a37b441000000b006fcaae20037si16988214qkf.741.2023.01.16.19.57.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Jan 2023 19:57:46 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="KKjEzz/4"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHd68-0000Vd-84; Mon, 16 Jan 2023 22:57:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHd62-0000Rv-P6 for qemu-devel@nongnu.org; Mon, 16 Jan 2023 22:57:14 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0: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 1pHd5w-0005dy-QB for qemu-devel@nongnu.org; Mon, 16 Jan 2023 22:57:12 -0500 Received: by mail-pl1-x62a.google.com with SMTP id y1so32268399plb.2 for ; Mon, 16 Jan 2023 19:57:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=m6MPxEUMXrC89FYEjdJ+17kvnFvsaHy/DYKnQJ+XOEw=; b=KKjEzz/4dd13/uDD9dlBwfeDYngrfh/knUixTMF1xclJe5anDN4uunnKoaQRc2NO7C q/Q8hz4T/SuEr86gzz7dg9uUpvbmvMtgs92+ZLBMUY1sUrb3ENmMxXtudic0xG71vX/W sN/yYFjV/sZjynbBQgPa1OlvegpjrhfLLbJ/R7UcN53D3vISIR8QAujRcnZ4rrS9V09J 63GXVRB+w++L0kW00LFXkIT1OZSgDwVV1eSAFk/+Kcf6972y003QHkbMca9DCKFzBNb5 PqTEuMjNJKS5coW/HF6bbt2ZF2xQrX2TLDMw+KuWpFCDzlCpq3gq0535+uF4aVcPrGVe 5xow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=m6MPxEUMXrC89FYEjdJ+17kvnFvsaHy/DYKnQJ+XOEw=; b=Zzu/aJxKLxzqxKDNSaUtdJeC7E18iHdNWFQ20aYgvM6kkjZboCO11EupuhC4sZU9tE 9srZevzXcqcC6sVHNmvUv8X9C9C1tPSKu0EO2bF0u/7uLYf74R3cTxiTpybo0sdT/8dZ oFvP/xD58AOW4+3j2jxsPUHY4SNrixSWjxxXvWvYWPJ6v+t82kKa1wSBsj9a9AfK8Iow vpOCZHN9B3APl9DlKNO+U8/51RXK07L+rbtI7NnKxnHMo3n0wMFPjaCOYFuWSrhfAwm5 Smt0zL1wUd9R4N7Gu6/7OwRNLrOfBQMKQTyJNa1SzfmEDyUC326rdjNiF1CcXSRvcikr SVbQ== X-Gm-Message-State: AFqh2krNUJq1UrXeuXePwGlH8a0TeZ3PK5pkrX4SuBFkay02yNKR4mr8 ZDUyGW6eviY53W1DOyCmOcpXByCg+U2BIWvf X-Received: by 2002:a17:902:bd85:b0:194:9984:8085 with SMTP id q5-20020a170902bd8500b0019499848085mr1770539pls.40.1673927826034; Mon, 16 Jan 2023 19:57:06 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id z15-20020a1709027e8f00b001869079d083sm19991531pla.90.2023.01.16.19.57.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 19:57:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org Subject: [PATCH 1/3] tests/tcg: Use SIGKILL for timeout Date: Mon, 16 Jan 2023 17:56:59 -1000 Message-Id: <20230117035701.168514-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230117035701.168514-1-richard.henderson@linaro.org> References: <20230117035701.168514-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org There are some tests for which SIGTERM appears insufficient. Signed-off-by: Richard Henderson --- tests/tcg/Makefile.target | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index 14bc013181..a3b0aaf8af 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -54,10 +54,10 @@ cc-option = if $(call cc-test, $1); then \ # $1 = test name, $2 = cmd, $3 = desc ifeq ($(filter %-softmmu, $(TARGET)),) -run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2 > $1.out, \ +run-test = $(call quiet-command, timeout -s KILL --foreground $(TIMEOUT) $2 > $1.out, \ TEST,$(or $3, $*, $<) on $(TARGET_NAME)) else -run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2, \ +run-test = $(call quiet-command, timeout -s KILL --foreground $(TIMEOUT) $2, \ TEST,$(or $3, $*, $<) on $(TARGET_NAME)) endif From patchwork Tue Jan 17 03:57:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 643392 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp951269pvb; Mon, 16 Jan 2023 19:57:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXtkSFhfZARmn88HekXcfkHccun7K0wwq1AcSv59kjw+mc1bIryN9DITmOXb2/UiHjgb2N1w X-Received: by 2002:a0c:e8c4:0:b0:534:7cf3:44b4 with SMTP id m4-20020a0ce8c4000000b005347cf344b4mr2993447qvo.50.1673927866385; Mon, 16 Jan 2023 19:57:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673927866; cv=none; d=google.com; s=arc-20160816; b=k5vRlYq0tLQvIVVMMXXlvcbW5eC1Tq6ICcLRJlSjS/y4Q2gTorLILzv/Nn/lzk4BQm /7S+nN7JsSof/V3y2v8QBg+2oaXUSOAuAizqPF2S/CMBco39AuKrOxX2vf/rM4MoQf5V MM3omTfS1NMGm0cUwD77WhhZGuBvX/JjZduWJwxrjy1mg5cw1EMOXxv7OjBaVw4y03wU Dte+gChfznsi4m66v99zhmM02JFXBiFpXDJVRlxS4GPn3LDrBnOJmm4H+jcn5PKXwpPh zqp6BIxdmuX2OldSU+SzqhU6JXZWyaSjSloMNzs0h9cIhQIqBzYl07BlvNttDNsETnJh N5hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=d5N30iQwf9eez9/YSvtx8wfqPKT+MxH+YK1LIg/g+IY=; b=a2bvHXUi7U/5F8h7Wx9+J4g0ZFeNDee2mpr3iv/TKc9inxQlbzbudUsyq7o84/VwW3 rKaY+n0PAGqcGMGvKvWH0mowBAKqZo5CXZgp4CScWhX/qQuZKr468vN1osnp14w00qkT jlx2QWPRVdqWwDVUXA1mpoMXKElcn4KPNmpFAtsnqCBShMrRucGn0GaGbIttMRFn6GSu Zm0nQ/MctyxKyfyEKwl2lfKX1fCINUdGrMxfM7f8quY8goXcbNQwvVxq9kusJOyVsZPL yWzDv39nH/ZBUpHorH6M8EMSVmqp0pJCM3vp2SRB6HkEYtoQK573cgsrTkf4hDUlD40Y LkSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kWOqMUaD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e188-20020a37b5c5000000b006f64a82024esi16870085qkf.721.2023.01.16.19.57.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Jan 2023 19:57:46 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kWOqMUaD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHd6A-0000WK-75; Mon, 16 Jan 2023 22:57:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHd62-0000Ru-QZ for qemu-devel@nongnu.org; Mon, 16 Jan 2023 22:57:14 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHd5w-0005e3-Qk for qemu-devel@nongnu.org; Mon, 16 Jan 2023 22:57:12 -0500 Received: by mail-pj1-x1032.google.com with SMTP id x2-20020a17090a46c200b002295ca9855aso4872174pjg.2 for ; Mon, 16 Jan 2023 19:57:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=d5N30iQwf9eez9/YSvtx8wfqPKT+MxH+YK1LIg/g+IY=; b=kWOqMUaDsgR9c/SLozPJCr5wvkgGK6kvjMh0RXRsjStNWt20EkcCHJaovDLvigr47P 3Qe168wiUzwwi2OWINA2JWtbheTVgoKCdEZjfHeOWe1Z9H7GTkLwgYiprQsfK4MBm2hl yGtWtli9e5yBhI78sRo9Sr0JRk61mKWl5O4XC77sNZoVlcl9/uJ9CErkqWjiGwL6gRKJ w+Vzw0BR10D90fnY9Bdgp/c0ZDbB5UgM+bcRFNbiqrZw5BQdlvu/JFFuH3hOHsIdQbKH mJHFLHiGb2w2I62NqPh+WNdXtUoupU440bSppMy9fjniZnK5wXDrnCo31IwNyvJs3sQG 4+2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=d5N30iQwf9eez9/YSvtx8wfqPKT+MxH+YK1LIg/g+IY=; b=wXVs86fGLUwrOSE7XTY13SlzDDxRM1h/zBxMwpLWbBbLjM/Ea9xtomgDkbkXOrMabc RX9gpSHOqLTaZGTOxvSAS3lOllDs30a0c0WHd3d9JItbmjpqQYBmZm4Ax+ERDT21OlGc Pp1EYH0soUCx1APx5K8VnVMY4jcn83igy/zBlZ4Lmkr8eqmpuynBQiZs3BvgdFbsRRsU Y1twNStMOnbcwuhWSqQxlwBioO8QW17nlW3pu4RE2StRPElOFPiCDJoucCnyTPiNg5d/ Bo1U6nv97eEV67skdtUXEsBGI9T+UGfjLxTfWODwVevYEQon6SQcRpadkQMmMYnhM89Z hJwA== X-Gm-Message-State: AFqh2kqfygvyMCdmaHClyjN6M+r7QbIrOoEH6DKA1lhWK+HKoXefmOHj U6YqLibjXXiZdKqdZ2ILClYhTAjsycIbg8e1 X-Received: by 2002:a05:6a20:6d22:b0:b8:2e75:c97a with SMTP id fv34-20020a056a206d2200b000b82e75c97amr1258235pzb.34.1673927827359; Mon, 16 Jan 2023 19:57:07 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id z15-20020a1709027e8f00b001869079d083sm19991531pla.90.2023.01.16.19.57.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 19:57:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org Subject: [PATCH 2/3] plugins: Avoid deadlock in qemu_plugin_user_exit Date: Mon, 16 Jan 2023 17:57:00 -1000 Message-Id: <20230117035701.168514-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230117035701.168514-1-richard.henderson@linaro.org> References: <20230117035701.168514-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Use of start_exclusive on this exit path leads to deadlock, in particular when called from dump_core_and_abort. There does not appear to be a need for it. While we're at it, skip the entire function if no plugins. Signed-off-by: Richard Henderson --- plugins/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/core.c b/plugins/core.c index ccb770a485..35aca0266d 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -502,7 +502,9 @@ void qemu_plugin_user_exit(void) QEMU_LOCK_GUARD(&plugin.lock); - start_exclusive(); + if (QTAILQ_EMPTY(&plugin.ctxs)) { + return; + } /* un-register all callbacks except the final AT_EXIT one */ for (ev = 0; ev < QEMU_PLUGIN_EV_MAX; ev++) { @@ -520,8 +522,6 @@ void qemu_plugin_user_exit(void) qemu_plugin_disable_mem_helpers(cpu); } - end_exclusive(); - /* now it's safe to handle the exit case */ qemu_plugin_atexit_cb(); } From patchwork Tue Jan 17 03:57:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 643394 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp951306pvb; Mon, 16 Jan 2023 19:57:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXtU4L9kD8XDfgn9BAo5DnrmWcDDyEe5n7UugZt2IBN27A6s0x/C6zE3xVPM+VCX9uL5dqFJ X-Received: by 2002:a05:6214:451b:b0:532:ab2:992f with SMTP id oo27-20020a056214451b00b005320ab2992fmr3720216qvb.3.1673927872815; Mon, 16 Jan 2023 19:57:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673927872; cv=none; d=google.com; s=arc-20160816; b=s7lzOXY5WKrFJX/aBqKhHK1drVMeRveGz0TXaFtRgJm1EoC5GvjFirER6JgM62YepT JTp6vRN/WIlFGkcrR6ijKEfTlQtC6H25ms7W+jZupqnXjTTo4Uf2r1FeReE4fVOjONqK utc6DiXnTN0vKbwNM1DpdNojtDaXBT7ickSXgWQh5JCsd0vdOfE49PSBYtSb4pOnFaGl 7hh6bUu8AtDB3eFn61mTKNxJBMGsdrA0FXVaLMI6ho5ATGfkBZaTDIRHGtyjUTs26rD/ bHYZzEfM9s/nrsKn4RCIfxLhuEoR/TrgyukS+YnvTpwfrJ1csumh5nJGNKXHk2CaLG4O 34eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aGVt08F4UpzpEZ1GVThy9tOfv3POzTFbKCIbVhJ6UWA=; b=fF590N2BUq3Aq+4H1kpnTf/ycUw6Y9hcq9Q1dGh96Kc3X14dUVMWVPCJ4UsWc/Qzz6 w9fB/+IC7RfhiNiMZoogkklZr7Q+C4WIPWrlCS6Tziuq75ADQsHNNI9HelC1Fjr/9lD4 QOJwP56xdW28dirCLjORynL/OIbZDyw0MJjxUSTLYqdseBp47v5mhZge5BpHK0t0UxXp HyCq4Qf8sPT9wb5T7BqfzziNVN9/Js8CrYYD7wJFGXKwm+CFIHdnkwTgrqYjg+4HSXRq DrKxMv9Dafh5QgAwjMrEhAjR6q/pvCbusEHoqLYNHM01Q9Ug1i6VLIxXCX5RmVys4Xgt p1/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ygUbIQ0w; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 13-20020a05621420cd00b004c749392024si19193220qve.364.2023.01.16.19.57.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Jan 2023 19:57:52 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ygUbIQ0w; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHd68-0000Vf-Gv; Mon, 16 Jan 2023 22:57:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHd64-0000Se-9U for qemu-devel@nongnu.org; Mon, 16 Jan 2023 22:57:18 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0: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 1pHd62-0005eC-Gz for qemu-devel@nongnu.org; Mon, 16 Jan 2023 22:57:16 -0500 Received: by mail-pl1-x634.google.com with SMTP id r21so170288plg.13 for ; Mon, 16 Jan 2023 19:57:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=aGVt08F4UpzpEZ1GVThy9tOfv3POzTFbKCIbVhJ6UWA=; b=ygUbIQ0w0isWjuC5WTNZlJhQD8+WzLJjdUxQCeBOFUaR8PPb2IYWaua/g5cBtIBceu cqpmbq5rCW/24Ha0El+wuRvL8991P5FyOSWZ0AhHPZDJ1+RVT/BOc3pGlihrFXRXqKV3 iNd43rGa2o/hxfWB3XAjnr+1yArYALTomVOmo9nxzmbxqpvoYWbzFnJL/PTmllWLzaZw +q4Oi9SqwaJTpArAV7EBj+xdnT00uxIpzv0itSiB3CXa+sVrmDx7RWa7uhIJI4DgGwps rIKR1ofwG144nqmLspMS/jbMXbLx/sKWgN8ypAawhPmh6J60WJ/YqfCXIikJSA30WZzO VrJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=aGVt08F4UpzpEZ1GVThy9tOfv3POzTFbKCIbVhJ6UWA=; b=LsMkdZbAjeoAZhcIe26S0qVzxxyM4e+lIQBpbj7bXOPm1QQn+FlJS42N2PTpbVZ6aX w4IxmsUsG+8YVdGf8QTNMQY6dtYFh/48n8sIqRJeA/6vUkqFoB5/bIIaukHQ1UWeCSNI DFWUcOOzedh3Wzl4xbpe5CmYBdCz8LEmk+cYmJ7MYYNdWzpbTBbIhZUdzEmqAZkjhxxg jG64ng5gl8jfQFQo463Xs8grx6Y5Mv2JCbH0hk0sbep7FNcQP4KFqsFR2hvhEKRxYlks wM9JT2Pd57mzNC6oOyzIujvkhQrsAlYpBZ2gmK3ciDQqnCuFYUZS30B2TAZZ0jw+wfO5 afMA== X-Gm-Message-State: AFqh2kpDQwms2cQVlsnZt5mzA5LQTvazeAhR8xDiYuboJMyWpSykvkmJ 37W0wVy+lbPnFQQdbRYCh3lInfEugJio+5Nt X-Received: by 2002:a17:902:c10d:b0:185:441e:4cfc with SMTP id 13-20020a170902c10d00b00185441e4cfcmr2202333pli.44.1673927828727; Mon, 16 Jan 2023 19:57:08 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id z15-20020a1709027e8f00b001869079d083sm19991531pla.90.2023.01.16.19.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 19:57:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org Subject: [PATCH 3/3] plugins: Iterate on cb_lists in qemu_plugin_user_exit Date: Mon, 16 Jan 2023 17:57:01 -1000 Message-Id: <20230117035701.168514-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230117035701.168514-1-richard.henderson@linaro.org> References: <20230117035701.168514-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rather than iterate over all plugins for all events, iterate over plugins that have registered a given event. Signed-off-by: Richard Henderson --- plugins/core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/core.c b/plugins/core.c index 35aca0266d..f22f8edc74 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -509,9 +509,10 @@ void qemu_plugin_user_exit(void) /* un-register all callbacks except the final AT_EXIT one */ for (ev = 0; ev < QEMU_PLUGIN_EV_MAX; ev++) { if (ev != QEMU_PLUGIN_EV_ATEXIT) { - struct qemu_plugin_ctx *ctx; - QTAILQ_FOREACH(ctx, &plugin.ctxs, entry) { - plugin_unregister_cb__locked(ctx, ev); + struct qemu_plugin_cb *cb, *next; + + QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { + plugin_unregister_cb__locked(cb->ctx, ev); } } }