From patchwork Fri Nov 18 09:18:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 626092 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp21075pvb; Fri, 18 Nov 2022 01:19:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf5K+PkmHDOqQItYJ09g8I0+7qryu6aciU/C21tSxTtXYhuxoN0QU2y7npqRjTaDdgxzDG0S X-Received: by 2002:a05:620a:132c:b0:6fa:774:2822 with SMTP id p12-20020a05620a132c00b006fa07742822mr5076269qkj.410.1668763187412; Fri, 18 Nov 2022 01:19:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668763187; cv=none; d=google.com; s=arc-20160816; b=MeMMq8SfsA/HYZLQqormCFjXOWJW6iFE6oC2v702AVmq06cakRUs/GPAF8zSu18hcN npKjZdZtgGTNzvrPZ2qp1B5NRJCphClArgrvFd0KfcJ954qJrbePc3fPW/U07FHk5X78 SMhI5NzGyeWe7OLeyrhfc4vXLTxLkRJ1mkbN9vsO3p+IaGO/c7o1gsaeNDW6uHJmddgz jwREuoyrpBMC62LpxUL7fYR45YUorUrxSMNkxTwxtuRb+Rpd2NRbmC/4hPNpvHRQ6qfZ g5+LFe1GvY690n5N7O6eOCY9crzpj0i6YweAfcgB8FsrVGvtvafBnG4kZvV/uBEpRg+Z Aa+w== 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=klMV9QcwxtW012k58NMnkKEYmz5AJ4MFhRIGSfHup4Y=; b=us1t8nfg2Pso8SNJwlV4VS+tk1GWsACSCSdjlRmdmhGxNZkt9QQABGdktB2Sl9VMMK VWX4bo5pbL2jZkMc5no8fkKmKvnNkgDooGvsikCMYhHtDBYvoDxOVpRd9fxqrBRpJhtH GDAPoKNdE6XLuQb/B8RbHuEWYodiFbNtitqJf8qWa5nVcu1oT4VqE7mSgtpuWNYXJs9R 5imqDZ3SFIvoBCgoTxrzmKDQ+m6P/iwrZuQ87Vbo+JDP0cMF9nFD2zgnfPXFd5k+l74/ xkdCG30PCymcRQIPTEQ/0g4oAM+TAdUGDO9l6tjeoq33kZydT/Nl2FoDj80iKaqTvVu/ e2sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JXozbtKb; 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 s17-20020a05620a29d100b006fa4acda6c5si1808786qkp.201.2022.11.18.01.19.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Nov 2022 01:19:47 -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=JXozbtKb; 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 1ovxWz-0001KS-Bi; Fri, 18 Nov 2022 04:19:29 -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 1ovxWt-0001EP-W5 for qemu-devel@nongnu.org; Fri, 18 Nov 2022 04:19:26 -0500 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovxWp-0005wa-Ql for qemu-devel@nongnu.org; Fri, 18 Nov 2022 04:19:23 -0500 Received: by mail-pj1-x102a.google.com with SMTP id k2-20020a17090a4c8200b002187cce2f92so2577677pjh.2 for ; Fri, 18 Nov 2022 01:19:12 -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=klMV9QcwxtW012k58NMnkKEYmz5AJ4MFhRIGSfHup4Y=; b=JXozbtKbs72AyOGMZJoXbfa/EJoyArSa+5fH/65HcnasY/JEmLkOWLG4DDwUOJfN88 f+CgQTbVD3HMi9Mux6VCv+/r5ojYfu0m8NZVLFdl6fj+OoXjtc5vtJ9Y7OCthVcrRCxV +JBkq6aWT/+DHnbyeyfDlBgVxB6RIQZoAKAcTW8TYjyOBDPF79w/UCNayz+PnMPPuisa 3z6Il0OUMqL/DekcuigUlIF6DfY9POhnirEvqXDaLDzpQ/zxF78WJaWigk4xNOi31nwB PgbOzVc955842mG5ya/KeEJyPyoBi0oPxTtx2dwknYagztRGK5Ypttu98H4JEPo81UTJ bSgA== 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=klMV9QcwxtW012k58NMnkKEYmz5AJ4MFhRIGSfHup4Y=; b=pai7Gs+h7uY71ISarRnk0OOio0yOrUh/UJGkSegujLiAonOAqn4PQz5OfY82ypw233 dW3E8huiFxK7j8f4uPuz8vERWCv6vbGvfWzacY4YOOX/uEEUKdEpMMkJ4LjWApfZqy9n IUTvuEvpuzZFiyW6Sj5IH6DpJcoSHZqa2VYns6LBfmtOID1X9Di51reygLPNzOvAjCyi UbhIh4eK69xOj8awQwsea7GXEPYDEIP1JIhMXincEGzvCSM5DSo9GWX/J9sq23Nfnd9v 5ub4u5Y5Ztz0HzNCZbRDSNMq3s+3SUZU1Cuj7ZFMC4HyEVab7wUEkv7XMN6Jtsr8kEF3 SAww== X-Gm-Message-State: ANoB5pk+OE8t0ZfL3+XgCGIGggW31PIPBSBovVhoIziEKmkSr56P6W/G BFfky8vaWIfdfboo+pmkBxmDwq9mxG6cog== X-Received: by 2002:a17:90b:4d0b:b0:214:1329:dec7 with SMTP id mw11-20020a17090b4d0b00b002141329dec7mr12947722pjb.91.1668763151823; Fri, 18 Nov 2022 01:19:11 -0800 (PST) Received: from stoup.. ([2602:47:d48a:1201:90b2:345f:bf0a:c412]) by smtp.gmail.com with ESMTPSA id a27-20020aa794bb000000b0056e8eb09d57sm2672305pfl.63.2022.11.18.01.19.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 01:19:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org Subject: [PATCH for-8.0 6/7] hw/ppc: Use QEMU_IOTHREAD_LOCK_GUARD in ppc_set_irq Date: Fri, 18 Nov 2022 01:18:57 -0800 Message-Id: <20221118091858.242569-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221118091858.242569-1-richard.henderson@linaro.org> References: <20221118091858.242569-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson Reviewed-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé --- Cc: qemu-ppc@nongnu.org --- 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 */