From patchwork Tue Nov 22 20:57:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 627518 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2723691pvb; Tue, 22 Nov 2022 12:59:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf7T8d/ou6PJSKPRKCVM2Dv6LqlH1goZdnuB+RfTKfcgiL0OBW77exBAxdndV5PtkLZjeKM3 X-Received: by 2002:a05:622a:22a8:b0:3a6:3756:c684 with SMTP id ay40-20020a05622a22a800b003a63756c684mr9408865qtb.10.1669150754137; Tue, 22 Nov 2022 12:59:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669150754; cv=none; d=google.com; s=arc-20160816; b=zRGfPyJN1kOm/8mPDuSPHxJelcTrk9eaoYM0+I0OZnjUndvgEwbG4Lh8zofMZ9GDlx F7Rje8cPC4iuVQCk1uoqKqAzJMnXBl7XzcZPYTy1rrudjHBm/XjpqbuFEvObKXgtpWHr GpWGeW+/Rq995YGZ9otGnxycWV+kM0lFMntGSH9zGPOJ6xIoLj30tlz/qlYSWLZ0akr6 RGBVR2V68HB17ODqUd9KHs+U47/nFv4kPpCzR2/mPyl2bmdPYuoFzK4rn8AM8vRIxTEn sN/WsiM9uzALYACEdEw5DdD7cj63+RZjuausm98qiLlq0tXDrPltno98tT4WktoLSNwX MwSA== 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=OQs4PX8mAmo3ud+ztM98k++NoSQ+C6IEic73PWAugco=; b=E2Ps0ptDPIZ+37CyJJMYBneIFI4JS7dZM5v+AEySj7+a2cB41DlQ6oJBtrDmUyBAMn c2Ax3ULyTEaWPHU7q4u+m9zbZCbc8CcAs6Yn0Tvgm0LOGzlt8W0NRBmPWH0wzS0ig5h0 bCblHE6JAIIvrkCg7EGMQB3BHqEVxKSDyCZmfx/nxA+XKj2HzCNvTmZvOJ4qSlcg2l/i yKQ3meisXK888PATEK40T9i+1HEvbtFeitmAPIzXSXHbZALcCchhEJwVeEMDsDrigvGv J5ICFx165d5nnl5x4Nyp2/u6KhBEGjQAyiR8Qa5isFWWNRgnM+0X/Qoh0Tt0q+F5DVMB k1ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JqIOfIfr; 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 i6-20020a05620a248600b006f582368e97si9562174qkn.368.2022.11.22.12.59.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Nov 2022 12:59:14 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JqIOfIfr; 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 1oxaL2-0007Mm-Li; Tue, 22 Nov 2022 15:57:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxaL0-0007Kq-Kd for qemu-devel@nongnu.org; Tue, 22 Nov 2022 15:57:50 -0500 Received: from mail-pg1-x530.google.com ([2607:f8b0: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 1oxaKz-0003Ul-2i for qemu-devel@nongnu.org; Tue, 22 Nov 2022 15:57:50 -0500 Received: by mail-pg1-x530.google.com with SMTP id q71so15058996pgq.8 for ; Tue, 22 Nov 2022 12:57:48 -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=OQs4PX8mAmo3ud+ztM98k++NoSQ+C6IEic73PWAugco=; b=JqIOfIfrfJ2WYbtWU3dXp6OX1IlvRFsvRgKki8dfBCQRE79I+i5Vm80f0WhyY6GrdR /hoQoPasTJd4ugMH8YFkPmhDhuyCVp4ixv05OT5RpTVp6U46UY06y+n0XkUvnOk2WAFV Vdk3ygSuC1EcSN9MsuTChU8A2c3TqBm7D9eZT3gzsHvnwZOE9Oozbiq/HQElWHXzGj4G RijyK/FkNzQCnNZWm04VAkSn6BRe/SwYIArdbO7zsRqDHF9Zrlud4Db1ndfkamLRe5Nm a2Do176wSZcleMX1JsXxSo14RHhD/XBiNG9lLtzM0gUmdZmkGyE4yd11OcShrrqtn7YK NwIA== 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=OQs4PX8mAmo3ud+ztM98k++NoSQ+C6IEic73PWAugco=; b=t6habXfCLjnCSw99Jyy+Xwt2mW7RmwAoP/AbadPNpzIdiPczHLiKxFCiv7QRkJAtUD d2KlY/V6Ihy1iFpnczSYoW0GsjX4WyPSKRZBR306Ir5DrfUapX3vua2XnYfdQxLe/fB8 VAmzo6TCIG6wEFywfx9MH/6s18vke9LdqpuSDkHnmrhzx3Q38y2TODFJ6XcioBCBTD4V TrKeQg04MsZIycRw4v6tLlEsn9MmFAc0AaqmHAZXYJdxxTBbT6hQHacVkK2qkZ5LpQWL w72T1+zBokpnviB70ydfI1/co3eBEKsoc6+l8xu6PozQp6A8k36BbK2ERwqVnNRCGOWb o0EQ== X-Gm-Message-State: ANoB5pkVjFSEwELoKKjtBBxtQfLajTlrfH8QaMDoIWY/qwsM4ARD+Zpk MrRDeFnTucTr5X9G+RAoBgKOxJpv2tkVwA== X-Received: by 2002:a62:8648:0:b0:56e:cbe8:9353 with SMTP id x69-20020a628648000000b0056ecbe89353mr5598773pfd.5.1669150666263; Tue, 22 Nov 2022 12:57:46 -0800 (PST) Received: from stoup.. ([2602:47:d48a:1201:90f5:6f8b:e78a:4a0]) by smtp.gmail.com with ESMTPSA id d19-20020a170903209300b00186fa988a13sm12383807plc.166.2022.11.22.12.57.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Nov 2022 12:57:45 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, philmd@linaro.org, alex.bennee@linaro.org, Daniel Henrique Barboza Subject: [PATCH v2 5/7] hw/ppc: Use QEMU_IOTHREAD_LOCK_GUARD in ppc_set_irq Date: Tue, 22 Nov 2022 12:57:37 -0800 Message-Id: <20221122205739.603510-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221122205739.603510-1-richard.henderson@linaro.org> References: <20221122205739.603510-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Reviewed-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- hw/ppc/ppc.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index dc86c1c7db..4e816c68c7 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -44,13 +44,9 @@ void ppc_set_irq(PowerPCCPU *cpu, int irq, int level) { CPUPPCState *env = &cpu->env; unsigned int old_pending; - bool locked = false; /* We may already have the BQL if coming from the reset path */ - if (!qemu_mutex_iothread_locked()) { - locked = true; - qemu_mutex_lock_iothread(); - } + QEMU_IOTHREAD_LOCK_GUARD(); old_pending = env->pending_interrupts; @@ -67,10 +63,6 @@ void ppc_set_irq(PowerPCCPU *cpu, int irq, int level) trace_ppc_irq_set_exit(env, irq, level, env->pending_interrupts, CPU(cpu)->interrupt_request); - - if (locked) { - qemu_mutex_unlock_iothread(); - } } /* PowerPC 6xx / 7xx internal IRQ controller */