From patchwork Fri Dec 30 00:01:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 637824 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp3179529pvb; Thu, 29 Dec 2022 16:09:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXtFnkFm7pv8lFSQ+zaCh6WLegfduo/TcNBzIQCq+gfY0qIXLNyI92QiC6U5ggIW2+UIK6az X-Received: by 2002:ac8:74d6:0:b0:3a5:2644:bcd2 with SMTP id j22-20020ac874d6000000b003a52644bcd2mr41555574qtr.8.1672358965546; Thu, 29 Dec 2022 16:09:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672358965; cv=none; d=google.com; s=arc-20160816; b=0w2G8zRHavoYNxYstr0WQ7uF0ADMKcH1REl6HnOsB56/jttUiUbXTqZDLeXPCKI9qG lTYEKisxdg7VI7w7BxgOo0Cc0MpBE5fZCtdY17ubFSFhFwHAOGHqlhv+0xh0un0OR72c fQx4Vr09H5OeMAWwsUkcG8nc9+VK65xjTUtBKBLXKX3c1ffK3st9cHf+eVSph8282ZBG G0N0fm2EfGS4bmLpWt1xj0lSpPCr/vv0QtHUP8VNMO3PiE9G/+a/n2x9Dj5mGZymGt76 uVepeKabVtGRosrLoM2j/bLX2b/yEc2x3iu0BFVsFhyIZz3BvJSnpzRGFH0NQgGwuYn0 hqlQ== 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=J5fURURdpD95K+AiPWNLzyWdmAHAOzWJ7x2HA9bfmtE=; b=C8hhcKnpcG/11w18gQsujJfAlHQsFgBwoRWGT3fNzflF4/7P+POyfjyVcdApvWRqYl gkXgNTND58VQOlOE04rS/H1HMjmeOfzyTT8iHfiq/3fNeZaRZqVFWa4TUIR9LBnfr9si 1/heyIIJD4AfjChWlZQ8eKS7yhcKrdrDQUG4KeZZ2QziYN+bDzrbt4aDYx/heniBOY+0 gEHdx+he1Rp6f+1Swp/vr5VeFGEykoRgLhUbizlJHTCCtvVYLevplavP2PWg3q2vJLqD cy6C4zOoyKMxASkGiST+U1qkVhItOXrYIDvLklIonQUPuwt8GbMghP3hij6HUqm0OulR M9Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WBBAfHYF; 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-20020ac813c6000000b003a54f492a47si9103425qtj.762.2022.12.29.16.09.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Dec 2022 16:09:25 -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=WBBAfHYF; 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 1pB2r5-0002zC-TO; Thu, 29 Dec 2022 19:02:35 -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 1pB2r2-0002xK-QL for qemu-devel@nongnu.org; Thu, 29 Dec 2022 19:02:33 -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 1pB2r0-0002fT-0D for qemu-devel@nongnu.org; Thu, 29 Dec 2022 19:02:32 -0500 Received: by mail-pj1-x1032.google.com with SMTP id i12-20020a17090a4b8c00b0022632104a6eso2926223pjh.1 for ; Thu, 29 Dec 2022 16:02:29 -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=J5fURURdpD95K+AiPWNLzyWdmAHAOzWJ7x2HA9bfmtE=; b=WBBAfHYFqRhMSfloB9ZphZXOebPiRU4uPUGjadi2DNkRE7cafnAzSt88hKj9fAk3ry W3/LXFyr4W8f/d2h1JCvhTWmqkhG6o8pcqAXWELnSyjDNBCOysoJuUOZtGaPamfhx/KS FppZNVJ3evaM2GDX4Qfzie44EpexAqR9aubTiQGDUZdWdv1+V9tKNWruhTox4/uszkBT errTush2g2cbntfmBMim4VLmofeItnChnAIJ3kbKLG9pY5i5Ht/4KPbZEQaWOPCTBZGp KhW1u+OFkqKX9KbgpWfCmRwbVjtxXtY+hef/MXT8i4JXiizJFS72gWL7Mw7SLSvEPDMN yXBg== 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=J5fURURdpD95K+AiPWNLzyWdmAHAOzWJ7x2HA9bfmtE=; b=feZRV/PcPgpa8v+mLvV4Eb4ZWJfLUOAYkGaH7Qx5iUPwAi44CyEz0UvBxOTcb2d1GR IV/oN86L3EQDMXoEzLDHtMFs8PUAz7S7AA2O/vg5gxPzsOjQVqhUnjefU4qs3sDHPPf6 ooDYbTG71Iy+/A30jL/6wOV4oNIBcAP9pwVkhdtw9xM/bgMhnFNaKb6b3g3ahROlowyl sGB8UIibzYvi/LMDfomUoHuST62y1TJt8xOlMHCwqDFLqEbxxXe3TZflmrbX4orB5tHG 0eC2qm26JPtdoyqmazOeMOesTMjMx8PxFgxRWlvAe+SgG3mOhrQWTc81hWRz8rkn2nSj l7tQ== X-Gm-Message-State: AFqh2kpByVYpQJGub2EHeMqA9vbb58eBOIC391O8hIX6YzR9TrIKWwvQ 9QX3jR5ZlefPUo1yby9bubkmvjG2GBD3eQkT X-Received: by 2002:a17:902:cf0f:b0:188:f5de:8908 with SMTP id i15-20020a170902cf0f00b00188f5de8908mr31181127plg.65.1672358548710; Thu, 29 Dec 2022 16:02:28 -0800 (PST) Received: from stoup.. (76-14-210-194.or.wavecable.com. [76.14.210.194]) by smtp.gmail.com with ESMTPSA id j14-20020a170903028e00b00192849e1d0asm7343953plr.116.2022.12.29.16.02.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Dec 2022 16:02:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 06/47] hw/mips: Use QEMU_IOTHREAD_LOCK_GUARD in cpu_mips_irq_request Date: Thu, 29 Dec 2022 16:01:40 -0800 Message-Id: <20221230000221.2764875-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221230000221.2764875-1-richard.henderson@linaro.org> References: <20221230000221.2764875-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 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- hw/mips/mips_int.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/hw/mips/mips_int.c b/hw/mips/mips_int.c index 2db5e10fe0..73437cd90f 100644 --- a/hw/mips/mips_int.c +++ b/hw/mips/mips_int.c @@ -32,17 +32,12 @@ static void cpu_mips_irq_request(void *opaque, int irq, int level) MIPSCPU *cpu = opaque; CPUMIPSState *env = &cpu->env; CPUState *cs = CPU(cpu); - bool locked = false; if (irq < 0 || irq > 7) { return; } - /* Make sure locking works even if BQL is already held by the caller */ - if (!qemu_mutex_iothread_locked()) { - locked = true; - qemu_mutex_lock_iothread(); - } + QEMU_IOTHREAD_LOCK_GUARD(); if (level) { env->CP0_Cause |= 1 << (irq + CP0Ca_IP); @@ -59,10 +54,6 @@ static void cpu_mips_irq_request(void *opaque, int irq, int level) } else { cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); } - - if (locked) { - qemu_mutex_unlock_iothread(); - } } void cpu_mips_irq_init_cpu(MIPSCPU *cpu)