From patchwork Fri Nov 18 09:18:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 626094 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp21339pvb; Fri, 18 Nov 2022 01:20:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf5oXYirS/9GU9WhtY4tnJookvyBoqXhdt3QlxCuOnvZjelVVRhE0Q6cTzT1TnNZW3Ev6N7n X-Received: by 2002:ac8:704:0:b0:39c:d509:76a5 with SMTP id g4-20020ac80704000000b0039cd50976a5mr5818519qth.382.1668763223013; Fri, 18 Nov 2022 01:20:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668763223; cv=none; d=google.com; s=arc-20160816; b=tY8gIFD3ZkxkI8urGc8IN4HwTKY0yF7c8WORNFIdvHi2UmzCu7uw7jB2JM6355cqhx 29yFU4o7C4iyL8KhBDpt1Qxh4fMt3pkls2j2ZYFQFaSo06oSNpdFygkYBZy4iWtG48c2 nmp13ppoLTt/oIpLd/q/T3trxJV6yIj0A8FZ2QghjClIA3FV6A6Ztujs8mjbHg8ycLdI PYzvQOp42F5W1ToesHyp7mgzsddzbN5+VEIHbrSQAD0IA8OMlFeUzN6x7GoJTMj0VDGU GWtKJR0CXZUiFAvBUZ9t/i2sQ7O3EKmWDjhZLXd8VRTlQbrm3d2OWYsfizm/toLl7JFf sMPg== 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=pFfgs3OCmiINOoIxkAFBJxh98qGAkPlN373hocZd7nU=; b=ptg2b0nzjRQeLo2jkTJ6ZbmU+TFhYaFZepyRR+m9IfGboj+qvJfaTvov4tsFCdZfMq MW5X1Q/QLVjZt7ZlLkRN0MqJ/J3JAxIUBqwfP1+k1HqXWtqXQApdZ08EFKhIaXWlAUDn pr0qgJt0x/LNIOwjyVZeJ83LUwLdC/Nqnxl0qwbMJ8U4qDyd1lR+L7xioY1xZnD8p4dn Y14HSgzquCxoOve0fywAwWJg7dVA+cSAZQmdGa3AQCt4p5gQzF0VRgL/PIvq2MzIqPUz Pqo1AbXRVSp3cfsNxp0PloJ9yJQAyVWILOFnEB8jFO0mtKbTvcNB3qOzF7QsMHhNJkYd 6nhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SraggbNb; 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 fw10-20020a05622a4a8a00b003a4f0b924e7si1709223qtb.329.2022.11.18.01.20.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Nov 2022 01:20: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=SraggbNb; 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-0001Km-Ri; 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-0001Dd-1D for qemu-devel@nongnu.org; Fri, 18 Nov 2022 04:19:26 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovxWp-0005wJ-P7 for qemu-devel@nongnu.org; Fri, 18 Nov 2022 04:19:22 -0500 Received: by mail-pl1-x635.google.com with SMTP id io19so4047259plb.8 for ; Fri, 18 Nov 2022 01:19:09 -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=pFfgs3OCmiINOoIxkAFBJxh98qGAkPlN373hocZd7nU=; b=SraggbNbOXppVluWWPdaxMnqM0dBKiF87StwDWA9shT2a1i0pxlII16CmLLimS8ez1 udbroKWCGLBb+1OMtIKUejsPkK3W/bjnZWV5LCB4bID7cLDXqgoWRecHj11zqIcJioO7 /4JtVtdeCsQxB/JuIm2kt8RdufMrqMFbnBpxQHenSdH5o0vgtbCZh0LyJoq25zUBXDM9 GC3OGj6IaGHipO6wcofw4cvCELq5e3Sa0H/MSCKUyKGNgH5Cspm4CQod9zJN3UL5xAEX O3Se3HTW2r+nWsWKIMCgv/9k4/m9Fuiin4xQpPPr/FiA1/1RPUN5+LCsOaOhthv5HH5l P/oQ== 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=pFfgs3OCmiINOoIxkAFBJxh98qGAkPlN373hocZd7nU=; b=uPlW7xT0VFoT0/U66lgtccNEV+dlYncrcAw4F3bXTZrVwmuJBrDWjsnh79Qc2hgAH5 ip4/L2kl1eYM4a+hAJQZnVc6ZHEURSuSDhHs3pSSLMcDYYgDObjbDao26XXklDLirmgd 3vG/9Tn8+XwOUaqNN9jkN7+Cxe5NWAsVXOTphDT8vLWUpQ1syVcYbupX+ZCnDWg3ck8f Cs1i9U75ABD23ontRGKKtyJO1MPx/gr9QGh9QUtN1IA6WcGPEv6A7xZhUcLAP+P+H4Fh 0xWEKCv7ZrRjV0hLd/GaqkcnsAbes+S9ylNOohBl0zxUtYa3YB3A2hr62bkkqfmy5V2M eRrg== X-Gm-Message-State: ANoB5plwW/XWvh5zUmmXObGDsAZsuUUASKpI6M9aStq5k/3mzHDuTjiY 3QqpDj21ng1Bs+XykJ5WiuTHb/7XqTMRtQ== X-Received: by 2002:a17:903:1351:b0:186:5f82:3812 with SMTP id jl17-20020a170903135100b001865f823812mr6859173plb.51.1668763148770; Fri, 18 Nov 2022 01:19:08 -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.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 01:19:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org Subject: [PATCH for-8.0 4/7] target/ppc: Use QEMU_IOTHREAD_LOCK_GUARD in cpu_interrupt_exittb Date: Fri, 18 Nov 2022 01:18:55 -0800 Message-Id: <20221118091858.242569-5-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::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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 In addition, use tcg_enabled instead of !kvm_enabled. Signed-off-by: Richard Henderson Reviewed-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé --- Cc: qemu-ppc@nongnu.org --- target/ppc/helper_regs.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/target/ppc/helper_regs.c b/target/ppc/helper_regs.c index c0aee5855b..779e7db513 100644 --- a/target/ppc/helper_regs.c +++ b/target/ppc/helper_regs.c @@ -22,6 +22,7 @@ #include "qemu/main-loop.h" #include "exec/exec-all.h" #include "sysemu/kvm.h" +#include "sysemu/tcg.h" #include "helper_regs.h" #include "power8-pmu.h" #include "cpu-models.h" @@ -203,17 +204,10 @@ void cpu_interrupt_exittb(CPUState *cs) { /* * We don't need to worry about translation blocks - * when running with KVM. + * unless running with TCG. */ - if (kvm_enabled()) { - return; - } - - if (!qemu_mutex_iothread_locked()) { - qemu_mutex_lock_iothread(); - cpu_interrupt(cs, CPU_INTERRUPT_EXITTB); - qemu_mutex_unlock_iothread(); - } else { + if (tcg_enabled()) { + QEMU_IOTHREAD_LOCK_GUARD(); cpu_interrupt(cs, CPU_INTERRUPT_EXITTB); } }