From patchwork Thu Mar 26 19:31:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184924 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp482000ilr; Thu, 26 Mar 2020 13:14:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs991NjcC095i7cr2ri0muaMHZjoQBv38nOsOmYeMT3vywjIBLaJHHK/+D1x8QROh0s3mkt X-Received: by 2002:ae9:f511:: with SMTP id o17mr10757101qkg.367.1585253670979; Thu, 26 Mar 2020 13:14:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253670; cv=none; d=google.com; s=arc-20160816; b=RsF6LAgeY/vUoTQxfnDBhkPQkFbb1bL7XNnlvcViNyLTH6FIKA5VmsyKSgOWLdOcBU soJLJmyX6yOStl+A9QbgzLI4vshd/HjZCI7m4Du4wpowmMr1QhlIto45MGe8TM/Ic5zP VICOZBhV8wgWrYvxvxf5Pbvi9SWa5+HrT/+YLnDZmSoWlUFYczJeSIYet4naxVv5fr28 X1uYQbfzU0FLgYDg03e9mXTMVAt99mNwITJsOWWR3UrX5mmGerN+7u+/JuNevKzw8HxG PbBgXIMYO3nHp3W5QYzFjGbm2lDGot+BdmCBhW6OL04gXy0S6kKFbLFA/ORPqp2RmDTP TS9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=hXS64xfFQVpKibsj9LpVhJbK9gFfN+Viw10h78ZF2Vg=; b=My4kSMQp33GxP9nwD9eufpfBwkqdl+cmv3rCQkqD9PCbtRKefYfvNZMzyjeOR0VuhP +git4wagBEVAnd2f/5d2YH36saMxhYDkDzxz1dyoJzwE2xPpRkZel8cFkdZ+/Uc9M8uG Fs0QdLr4RLfkkSjIZ4NVK8LPHTvTAv/hD1uMCYbLIYZ7LjXyOKIUkxwOoHYZHOfiB5jB qz05eQ7vtyJjiTQTg8poiAfD7pE9K6Gok3Nbx8bB7Hya8ebk5gM378NhyilwRm86g+Ql G/vWRnFj1wlbxX0H+r7YVDPVhD9GBI3WMdzbG8AkZB4xnEzfgJwsyB20eL4uDJvCHMPP vk9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=E9zgmuKx; 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=fail (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 z24si2132505qta.38.2020.03.26.13.14.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:14:30 -0700 (PDT) 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=fail header.i=@linaro.org header.s=google header.b=E9zgmuKx; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYta-0003dW-G9 for patch@linaro.org; Thu, 26 Mar 2020 16:14:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59443) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLR-0000Sw-2y for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLP-0002Es-V2 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:12 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:41685) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLP-0002El-RC for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:11 -0400 Received: by mail-qk1-x742.google.com with SMTP id q188so8167815qke.8 for ; Thu, 26 Mar 2020 12:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hXS64xfFQVpKibsj9LpVhJbK9gFfN+Viw10h78ZF2Vg=; b=E9zgmuKxYSK0VF+OHcKpZMN5Quqt4ZtwwOOyy+HnVdwmgxWDlDjrwjYSwgnOO8bvwq LyILHWqzwhVFkJGJNru3QIuWDvrvSaw1jEzhI/w6/SGfNUa1TNbeMMQk2CHlWe6qBE8o otaIjLoKoqZbyhN9MXtKwfckI817FkMl9UVyYvGb67QL7udL+fKpbxeC5rN61HFAPGV9 vTv+dnIfBBQtNp4XobXLlNzkar+MBo8C/yW6Pt5cl8nVnohC2xE/Qkp52qBNrihpgmjO sadr+T6BhVJot1p/pu9kcERYtfsq+K8UTjYEc6XRvfIM+Rt+Ux5ydzt3w5vnkUDlMlnG iBqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hXS64xfFQVpKibsj9LpVhJbK9gFfN+Viw10h78ZF2Vg=; b=A0QicGhx8v/lnc53JP/BwEzUKXIoFXL2MbMZCv1LM0QXxRZRidhhuRjluaXcnuGMcs SWfLPXT8CNT0VEf/QYbxLEcVAb8ndtv+JDAEZyj1RjefujzXrU62DDzHoF8a7puc4FAs h5gNPbzaHx1pAnR7OiI6TmUSmYmEgMQgWnYocV4/t+dSlDAD9lwvfeQNTHYagg83ylch NMPSqiysDpWGdill8SBZTDQD32Kgr0IgGuVbC24md+QYVdNz9lBTxpDjBqSnE7C/AxFZ D9CPfDO3qwo1vlsB2qGEcDugYkuNg5TJoMiYRxQr9kHEpf60J2CccnaHaOIyuatanUYm 0JSg== X-Gm-Message-State: ANhLgQ1oKS1KW08TFekGBIToUH7MMDo24663eDoJno5mMN1XQRCgh1vS 2LE7tC3EACuKYilECznb9q+oM7AIO2Y77g== X-Received: by 2002:a37:410:: with SMTP id 16mr9858852qke.485.1585251551100; Thu, 26 Mar 2020 12:39:11 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:39:10 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 70/74] cpu: rename all_cpu_threads_idle to qemu_tcg_rr_all_cpu_threads_idle Date: Thu, 26 Mar 2020 15:31:52 -0400 Message-Id: <20200326193156.4322-71-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: richard.henderson@linaro.org, "Emilio G. Cota" , alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" This function is only called from TCG rr mode, so add a prefix to mark this as well as an assertion. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- cpus.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/cpus.c b/cpus.c index 50ced4369f..05de56bd53 100644 --- a/cpus.c +++ b/cpus.c @@ -232,10 +232,12 @@ static bool cpu_thread_is_idle(CPUState *cpu) return true; } -static bool all_cpu_threads_idle(void) +static bool qemu_tcg_rr_all_cpu_threads_idle(void) { CPUState *cpu; + g_assert(qemu_is_tcg_rr()); + CPU_FOREACH(cpu) { if (!cpu_thread_is_idle(cpu)) { return false; @@ -643,7 +645,7 @@ void qemu_start_warp_timer(void) } if (replay_mode != REPLAY_MODE_PLAY) { - if (!all_cpu_threads_idle()) { + if (!qemu_tcg_rr_all_cpu_threads_idle()) { return; } @@ -1295,7 +1297,7 @@ static void qemu_tcg_rr_wait_io_event(void) { CPUState *cpu; - while (all_cpu_threads_idle()) { + while (qemu_tcg_rr_all_cpu_threads_idle()) { stop_tcg_kick_timer(); qemu_cond_wait(first_cpu->halt_cond, &qemu_global_mutex); } @@ -1651,7 +1653,7 @@ static void *qemu_tcg_rr_cpu_thread_fn(void *arg) atomic_mb_set(&cpu->exit_request, 0); } - if (use_icount && all_cpu_threads_idle()) { + if (use_icount && qemu_tcg_rr_all_cpu_threads_idle()) { /* * When all cpus are sleeping (e.g in WFI), to avoid a deadlock * in the main_loop, wake it up in order to start the warp timer.