From patchwork Fri Nov 18 09:18:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 626096 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp21519pvb; Fri, 18 Nov 2022 01:20:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ZotrDs2OEIkol0Qp7/9nwmXI+GuMt8j8I4ONd4xdVXObqSlqZDWGXUZnBZtHAloCGaNZA X-Received: by 2002:a37:86c6:0:b0:6ee:96d8:962d with SMTP id i189-20020a3786c6000000b006ee96d8962dmr4923643qkd.209.1668763244185; Fri, 18 Nov 2022 01:20:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668763244; cv=none; d=google.com; s=arc-20160816; b=ncKvWObWtjupDHEU6igB9y1O/R1bT9x8jAe7VYa7Yxch9gDfeJ0FP38Yfs2HuQVNVE g6q3ZJ66dkNxpK4SHWKPT9/yElrat40hd4NqNkOEkUA1JayVeRm3z8j1YGz4nSPgATU8 wqMad8oO2vCeQxsPXIaoJSqGsGRwK50GQ9fRpkCXquN80i9rkgIG1bS4TJQfwq62gOsg 0fLg1L1xnIxB1VZEWem+GN0GWXfS7An3V1Q4/iy0mMU1dDM4XcOZhGA8w8jZ6jw8mZ/W fER28lW8vW/AwOafHmlszgOxjwZrOmfVBLV+akcmvnjchcU9HOj8iV3c0BPKwFGvZzoG uGdQ== 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=Gbukfi2lhvW+PuRANNKhuCpHW9NS0bt15N8zWXxqRno=; b=S05KH/8iMA3DAH/CRWAWRtlgUqS9wQuGg890qlTkpfT7o9X5YUBBFcgiprLRGvu5PA voywkPvuKJ6qE2AwSwJMjY5RJA3s/JYdxbYYwYD5/tzQkgwefCASNr1iwuazju1sZUkE zWKd+JmNKZfZtcBDT8ATv4ZcAU5jRvJ6s23AqsXvO8FF3f9YxpCUBSI9krvJ/5EWforz ABtlvttd1uZv3J7N92T3kltCdvTtzwFno/70Qdr9sz2+HiRINaXCXapDvULQJ4iYhuWd DuDWN8TvC0MyrRSZbgF9Jx8CMm2SO8JdnhZcDX72TqpOMt4SfmKnfFE+JaVb0kaYS/Qj HuWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cspZu4R9; 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 o12-20020a05620a0d4c00b006fbb9f26f6csi1479721qkl.737.2022.11.18.01.20.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Nov 2022 01:20:44 -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=cspZu4R9; 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 1ovxWx-0001HX-Kd; Fri, 18 Nov 2022 04:19:27 -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-0001EM-Sm for qemu-devel@nongnu.org; Fri, 18 Nov 2022 04:19:26 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovxWp-0005w3-QG for qemu-devel@nongnu.org; Fri, 18 Nov 2022 04:19:23 -0500 Received: by mail-pg1-x532.google.com with SMTP id 6so4493426pgm.6 for ; Fri, 18 Nov 2022 01:19: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=Gbukfi2lhvW+PuRANNKhuCpHW9NS0bt15N8zWXxqRno=; b=cspZu4R9G/AOykvKay12p6+YkI8KgGbsEPogDxLSet8fbj04DNVaRVZZkk8um9Xj68 GZA4Co9/NwFLNbiVvsmaBthe2Baa2PSNx4dHNweUxTI+Z5soU4XycjFTad4WoScvHGoA yzGQ1THpKfb/4gxVoZiOqYE4WHpfBlVU2OAsacgqxNT/6ZTKkd7SH82bKLMQ0/waUeb6 MJaW0LHTbkfyy3hvVeRmlfqN/qyaT/af66tdnfQcX1vMT8IdfKVSkORHuh7sy0nfcRaD OXbjenNtptA8fMB35/MJH6xqoW7EJfTTpmUK/vn+t7sy5NUsVmVoxqxg4BryRHTNLaUE kZwg== 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=Gbukfi2lhvW+PuRANNKhuCpHW9NS0bt15N8zWXxqRno=; b=KPEMvG4gr0C8WiKSap8c617COZtAvCDuSyoK/QfjS+2aRzSWQLwESghm8evnpoJZ6A 5BXrI/BSg3UiiEcMF7Ksvbp8ptlPy6Noo8OUbiUtYq7pL51bkOGa8sxJcwUKJlI7xsnb 7g0cQ8oTxCqE8N03Nv8jUJqht2vSV2G1rgjlIfT9bFNdLLapZ42PPirZrsks1bMCbSZQ MIzde3pAgnXizKoGuRwStMitBPvBePc7TIpPKwlI6cd5oupViNIr3P1pM0GHSO1quxBB zOsHdRWiZVLr4yoUca9g8H5ncuDt488EA4LBUY4J/TN+cPydyaxPxtmN+8UtZe/DXkKB mY7A== X-Gm-Message-State: ANoB5pk/Q7SyZgUxlJ/9yeXa66FO07F1bL9InpXY4318wzikezWtwDV7 viB9ndIDKTJmDg8R9z+SyV5h7N+ReR4oIg== X-Received: by 2002:a63:a54d:0:b0:46f:8466:745c with SMTP id r13-20020a63a54d000000b0046f8466745cmr5945622pgu.87.1668763146611; Fri, 18 Nov 2022 01:19:06 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 01:19:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org Subject: [PATCH for-8.0 3/7] target/ppc: Use QEMU_IOTHREAD_LOCK_GUARD in ppc_maybe_interrupt Date: Fri, 18 Nov 2022 01:18:54 -0800 Message-Id: <20221118091858.242569-4-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::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.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 --- target/ppc/excp_helper.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 94adcb766b..8591bb3f73 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -2163,22 +2163,13 @@ static int ppc_next_unmasked_interrupt(CPUPPCState *env) void ppc_maybe_interrupt(CPUPPCState *env) { CPUState *cs = env_cpu(env); - bool locked = false; - - if (!qemu_mutex_iothread_locked()) { - locked = true; - qemu_mutex_lock_iothread(); - } + QEMU_IOTHREAD_LOCK_GUARD(); if (ppc_next_unmasked_interrupt(env)) { cpu_interrupt(cs, CPU_INTERRUPT_HARD); } else { cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); } - - if (locked) { - qemu_mutex_unlock_iothread(); - } } #if defined(TARGET_PPC64)