From patchwork Thu May 21 16:40:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187067 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1733994ilb; Thu, 21 May 2020 10:12:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzi6joqPWdK5cF0GyrwTvzsYKL78w5mBxTyyj9vx6Y1ztR4hs6GbAAos7d/z+C7YLoUhInd X-Received: by 2002:a25:7a06:: with SMTP id v6mr17081011ybc.152.1590081138447; Thu, 21 May 2020 10:12:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081138; cv=none; d=google.com; s=arc-20160816; b=bRgIzVUAG6dT8Xm8pr7n/AyRqS/5PhEO1Gi2Q/ILyJSpfzjTPFqtc7PJhZ3VxRZHGs DU+qqWZBZSERRcIDkIyUEdwjq9XGEIPmZurMBI/AWpUepEzSYUjLUV0GnJTDUPSB/ngp jPl8JJqTxLOhe61x7qVzeVkcba/EI+aWGHBxW6aQnyL2hdt50Qw+l/h0ThSliaN7NvWC wxa0Bdbt42IQQSF9sj50pqmId7Fz/6RGPdFiK9K0B7qV+4+TjYCLrRPVCC8eGBgQDrfE v/V5+fai3k6rDvdxsDRLCbojMDeR36zCblb6afMNZAlHhZbyT3V61ST535n0k2ZvWCVh +NfA== 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=wDuYpfs9QlEw4aXWAwthoPylqu8S5OXh9Q7CXYLnZi8=; b=psv7legq+0W+a4EUDCuvIGVbeYlj//KobYUqIOJEI2JKVORyqEC/emTop3DDK6OQUP 8QkAq+f4bRhyP3DKBqRZSA0lf65f7ixUhCrbF+2uSuqyAPwlDgAz0hr2Dg9AUDhBFpwm XroyssH+tyewLKGV46b3gr56YLoO7iM1yFCFOuUcS8JHfTtWnhhjpfPhxGKnyGwPxm/y fB0uWhvMgCF1AW1Z+Nvk3HIVj4UC3buRn7JBS4rZjNQBT27M6INIgvN1I+Qh/w/9qowH QcwMVY9MyQRhmKHi8Y1Gim22+Iy/8DywUZFdyfMBQmU3LUeQhNxJBM3RWynXqX6JPAtc GJ1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CZjevvvF; 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 p132si5728957ybc.196.2020.05.21.10.12.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:12:18 -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=CZjevvvF; 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]:38024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbojx-0003h5-Tr for patch@linaro.org; Thu, 21 May 2020 13:12:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJO-0004tf-Jc for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:50 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:36688) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJN-0006yJ-HY for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:50 -0400 Received: by mail-qt1-x842.google.com with SMTP id v4so6015583qte.3 for ; Thu, 21 May 2020 09:44:49 -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=wDuYpfs9QlEw4aXWAwthoPylqu8S5OXh9Q7CXYLnZi8=; b=CZjevvvF6bG4rCc0U5MLQJHndBYJxGCsV3rZ6cqVid5/gU7z5/OLRRXWDlHzJEYLKg MqGFVdFeTgG95hEhesAEUceMWkuoXakdW7it+cVZ5h69dHCvFwMaEQCPbg8A+5hKcNcG PlczMlUEeDA3YFl69KyA+c01SQjvMbmAqmEAuuP1JTv1CkCIoWySh1tT7TmCpzcSMX6O fkSzA7zgf284yCKefG6Rbg3scpsfGMtvtAKkyVXe/ImUy7A74ez1sljGsXCdO0VgXjpg 2makoZ+nIuJgc1D6ykPsxl33oXEG0s8hC33OOOi1A6I/Gtrj88YUtnh2EjaYIuwYH2oc uSHw== 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=wDuYpfs9QlEw4aXWAwthoPylqu8S5OXh9Q7CXYLnZi8=; b=CcXS9E6BAx2Evo+4qB17bEaCJVlXU0IJaLwi9AQloC5fp4/8ndGnh9R2nlx7h4D2Sd ZFbVzl9Z1TXONOSSqGBxFpzp4VnT8meKwVa0if0dDmfYAuwyYhPXOrdmi96zpxXQuNpB 7ucfPCkMLeo3GXhHWGV6DUUNezCO7hKaAF0hFmH5Ev24tAx6pbE1T+0rEq/cVTZOB5/F T5rQcAew7IHNWOJEsgFiUvXiUbYBKsgDKdp08br86PvKjGplqAmjY6KYtXL+UkBL8LW5 YIVD3EVREXoV8bokxX1sgFDjVaxtyhTvSAuejtzDSY9QCZko7HQaOWJImfBlv7MAlHm3 KDQQ== X-Gm-Message-State: AOAM531CW0KuKDOgvyMwtQ/aeJa1MjiZcj+QlLST70KXo1NovrPs2DTw Nqusu2qsNQtKzbU6OM7QOXytv8Bw7fpl8Q== X-Received: by 2002:ac8:393a:: with SMTP id s55mr11528006qtb.48.1590079488317; Thu, 21 May 2020 09:44:48 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:47 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 70/74] cpu: rename all_cpu_threads_idle to qemu_tcg_rr_all_cpu_threads_idle Date: Thu, 21 May 2020 12:40:07 -0400 Message-Id: <20200521164011.638-71-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::842; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x842.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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, cota@braap.org, 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 ff67fa9f5f..bcba0552bf 100644 --- a/cpus.c +++ b/cpus.c @@ -230,10 +230,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; @@ -641,7 +643,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; } @@ -1300,7 +1302,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); } @@ -1656,7 +1658,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.