From patchwork Sat Dec 24 23:56:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 636671 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp929276pvb; Sat, 24 Dec 2022 16:01:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXuCMb6sJX7oxOrpQ0J2TUTkYVUgvcbxZrDSH2ye5CFpCOHTpZQHLRNj3MrDfHv8C9ZX6lWy X-Received: by 2002:a05:622a:1e17:b0:3a8:21cb:11d2 with SMTP id br23-20020a05622a1e1700b003a821cb11d2mr17949516qtb.1.1671926483379; Sat, 24 Dec 2022 16:01:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671926483; cv=none; d=google.com; s=arc-20160816; b=ddnZN4GuLtY7DIBLY242Z8YaY3Vkl/nPsKwlTcymU08oxGUamftcDu34Ev+aN7CWzO /kTkBKBjqsYPNwvN4RYUMoeXHm8frRzy1/pMQpx2ps+s+kcyByy2xjZNXcdvt0ZdRld1 7syWNwVnTN5ZKyjp4JpSPlWdIYGYqTTxoOcdDCCEzV8JIcG76V2uNeI5zma/NNDTcSSC cgjGdUlrqxi4f9Q8ikh3XZOaQ6Mf4QOM8FLTKXUpaEdiCWzxBBZW68ObOlI2hbHN8YgJ 0GFmq4dVyII3ErUaRktpWZ27772j7jjLTUwBRtx1cHxjBANXutSLsAx/pITlWFEfU0qN LvGg== 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=PiphfV6qoculAuFjVyzNdxaGNuwqxurq/DdXCMuzFHRvc5n9vsGT0U9SDXk+TYpSRi YUx3KMj/NlbZpcfivZuHnvwytOp0tKjT8TAO7n7DEvSCK2yTTTl7fJY/RmiWVoFqc81N HKfpXFI47q3/oxCad7UcdD+X5dWF6mS7mzzzpZdiAS6T5igOMl1jdYT/0lXvkt3hlvXt +ebubyltUZbuFBNDZ8eyaPbTwcpz/Si2ojglLSvpf3+H14RniDnpikHkv/WuAaXomV/D DyK2j4jrb4cCvQzuNw2lormUZMM4CIQwFX8ibsfYMpALo35rcmiNHq0a7kWwey26D/il k73w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gSOKXzHU; 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 g14-20020ac8468e000000b003a81f5be2b9si2581029qto.293.2022.12.24.16.01.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 24 Dec 2022 16:01:23 -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=gSOKXzHU; 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 1p9EOU-0002IM-TW; Sat, 24 Dec 2022 18:57:34 -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 1p9EOS-0002HR-Nl for qemu-devel@nongnu.org; Sat, 24 Dec 2022 18:57:32 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p9EOP-0006Gr-Ix for qemu-devel@nongnu.org; Sat, 24 Dec 2022 18:57:32 -0500 Received: by mail-pl1-x62f.google.com with SMTP id 19so1057917plo.12 for ; Sat, 24 Dec 2022 15:57: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=gSOKXzHUlob4/XFdvy6zVrRqgy6Kn+0xjuruKXOb+Kh9hceluI8yE7R5KBMYNSP/E1 1G46aQLSJmbwUzdGIs5sSYvDq9ErjdUe9A9FTV2fqINzcUXojHeswUHPAYU+h8rYgkif AheLTANcinF/vIf8CM0X2v4M4mwp3W81AzQDm7Q12v9Up783qvH9IOPZn3mCjZnbCbO2 75GOTCZU2O+HK9dZBv2X6vENR1BYPfGKw5cc0txf1ufpmwjjmCA5mbzFNfx3gtKs4wuu YS72044HjlY4nnltPYc9NEDZjOg8GtjXF7dStOpgidot7+qfXVBPgzog/FI7KTs9jzml 4elA== 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=w5N6YKhXN3frybR27F5HEwMh39f908L/BUeXp6177856Y+hsbkfGmVcKYSpuCXrb92 1TmeRDJlkt4YmzbFExWnSIh6aVy5MMMiX0MCFKOMPe1ir5oUJ5hsRI3pk+J64Cp/d8rG tT7NrVFH1Bxa0zctjIJynZSHTMjvCzgCJExQ4377sbX/owjz8+R/AxtKmdLgbVMCyTqA wbeFHI87Ufcx5VdQdTvkCykQjsCLRV0s2p3jF/gETPr4ALpDaoHe/Zg0TwAco47htrlI egJX1jTnhWfNWZCo9RL1D3qDT7J9FcJV/ANxt6eT8Ku0zYWn4os6T9NWsYig08wiQLhN D52w== X-Gm-Message-State: AFqh2krvPHiGtrvdExkcL52ekGYCdLP/pqKdWHtXVMx954f+jRcfPvqY qkZvIZ64Jr+Qv2H1lkz4wLz0nY86bllmprAs X-Received: by 2002:a05:6a20:1455:b0:ad:e06f:9540 with SMTP id a21-20020a056a20145500b000ade06f9540mr22269325pzi.4.1671926248344; Sat, 24 Dec 2022 15:57:28 -0800 (PST) Received: from stoup.. (76-14-210-194.or.wavecable.com. [76.14.210.194]) by smtp.gmail.com with ESMTPSA id cp12-20020a170902e78c00b00187022627d7sm4599716plb.36.2022.12.24.15.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Dec 2022 15:57:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, philmd@linaro.org Subject: [PATCH v5 06/43] hw/mips: Use QEMU_IOTHREAD_LOCK_GUARD in cpu_mips_irq_request Date: Sat, 24 Dec 2022 15:56:43 -0800 Message-Id: <20221224235720.842093-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221224235720.842093-1-richard.henderson@linaro.org> References: <20221224235720.842093-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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)