From patchwork Fri Dec 30 00:01:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 637845 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp3181905pvb; Thu, 29 Dec 2022 16:16:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXuyTpcCQ9RWA36tr/thH149aoaawx8mZe2Uo+xHh4s8Fl1Y8I4vax6gjOCYhOqDzpIJsvSG X-Received: by 2002:a05:622a:59cb:b0:3a8:299a:9843 with SMTP id gc11-20020a05622a59cb00b003a8299a9843mr42158134qtb.39.1672359407058; Thu, 29 Dec 2022 16:16:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672359407; cv=none; d=google.com; s=arc-20160816; b=hepYhKyClbrnfiad4BLkBc+aMyC0SYQWf19gJuiDuE4ZWHpOJ9x7Ctr9WDAlVAQDen FE01lFpu4Siyb6cSPj4O0VPXRjKNvD7sQlO1Ztv5vCHZHvWktLoB+5I+F9XcCOsfy/5N wgVqKgmkzQ57/eL7swG9ICeEgvvQTrGBouXRa2yyo8qazNhFTNE+Gst3E/gt0u4Xpj3d Dv3ntSSUL+UBy0tbxWm3bP65ZmP8El/pQ1NQ7Vim8SU6xS4cd7+3bXcZ1qmF8GHk8Zxu ronJ5WR5hczHKTLK2oyERUwi1YxXFCy194oTX76fKONL0JTmEKsA2NSQSAfj+yMvy3CF +tAg== 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=plDIoOrc/jMHxHch1a/joN0jkJOzT26vJ1hDyyzmh0Q=; b=tbqW4510LRpBe5vmRdkgWDYY2mTUzW42Ckop7lGfXFPuQM9LMLI63/vqt+eEC/Qt7+ CylUAw8qqgpX3W8fNXnb+t2t4lP4Dv5yuk7E46ADP/+BguF0qbqomEzLKgwU98YVq4zT BT3YR5/gzhp5a6llNDcUt4NEbqGZ5KphHrQ3WlMWi+GgDwAAlrJB8jc49RrKQkqCSpG0 NeD9ccgOfunB+z9vMGS3VWvynagGAIaTeriOsSe6fUq1qo4h+0Zzm2Er/nwp2V4ZFFcm 4dMyOwOuZ9H64ImJAc1V8BUji/gXnYE/dTcN9ODVnWVhzIk/cAXSUbVOvs8PoCsYhBLY qfAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p4u5hdCM; 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 g1-20020a05620a40c100b006f8aba9d693si9593222qko.628.2022.12.29.16.16.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Dec 2022 16:16: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=p4u5hdCM; 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 1pB2rA-00031u-9k; Thu, 29 Dec 2022 19:02:40 -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 1pB2r4-0002xu-64 for qemu-devel@nongnu.org; Thu, 29 Dec 2022 19:02:34 -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 1pB2r1-0002fp-WC for qemu-devel@nongnu.org; Thu, 29 Dec 2022 19:02:33 -0500 Received: by mail-pj1-x1032.google.com with SMTP id hd14-20020a17090b458e00b0021909875bccso19548950pjb.1 for ; Thu, 29 Dec 2022 16:02:31 -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=plDIoOrc/jMHxHch1a/joN0jkJOzT26vJ1hDyyzmh0Q=; b=p4u5hdCMy8oC0Ynk7f8yKar/cGWI+6wyXmZZCVKoNxQAZR4p56FhZYFnFb2Wu9GLLl 3d/vxWSrml9v+3jOSaw3RkLSkzf4g7rQIC8NqenaLDVaJmtQBuU0jj8GPUXgtv4+k6Dz eF3iN2b3iJZrOeMxd3HBX7XuRHjWF2UITh4YAMhikbQSKKS3coAUiaQjYv/0UzVqOJE9 LS/8bukLbzziUvXl17Bhg2DnpwQGbPRn8LncmtlieW7hKDaGcpa2GzFsVMZ3PRBgOSsT yD29g4qZcg2ODAU1yJi6u9Y8F8hT5n4oNbJIUJn8TRJPnzX4pRMsZJGriOcdpBbTRDlS ev6A== 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=plDIoOrc/jMHxHch1a/joN0jkJOzT26vJ1hDyyzmh0Q=; b=tR/fZx5lgouzRzlFuktN7I5GsS3Foz7KN4swJ3xSQRo7LYz0aXc6dmWtIvSuDeZ4Cp 35y/wEH+U9dkei5cMPMoizsAuweAAw7zf2tQMx6eFNlMsa+Tt9oON7jZg58ldzI3xJKZ qrl6ROsWe2+aa4FH5MFTJhaiU1lpYid5rMG76EVZnq2zSmDOjFLjJ1Qn1qlj4o0scHtH DmGQ2uiIwzGXLEPGMyabUdAghwNQlmfX4p0kXDl45OXDJJhpdsz4NPvY9/yYN0+Ghpny 2H9AV3QddNbKLCCRYcXbzN8k/BOCIQFJ6hbvyotwwtwQxrVCVeKQhfC7JCpR2YjampMg kKQA== X-Gm-Message-State: AFqh2ko6iPUFHrazszkEHR3sca+EvnSbJBrj0gf7Ee0AMi1uT6IajSkC NZdgpmHHJkv/MST4oQCkALISswfO1NuroHxQ X-Received: by 2002:a17:902:aa85:b0:189:894c:6b48 with SMTP id d5-20020a170902aa8500b00189894c6b48mr33155026plr.59.1672358550462; Thu, 29 Dec 2022 16:02:30 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Dec 2022 16:02:29 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Daniel Henrique Barboza Subject: [PULL 08/47] target/ppc: Use QEMU_IOTHREAD_LOCK_GUARD in cpu_interrupt_exittb Date: Thu, 29 Dec 2022 16:01:42 -0800 Message-Id: <20221230000221.2764875-9-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 In addition, use tcg_enabled instead of !kvm_enabled. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- 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); } }