From patchwork Wed Jun 17 21:02:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 1311603 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=eeIjDad8; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49nJSs4Hf8z9sT6 for ; Thu, 18 Jun 2020 07:42:37 +1000 (AEST) Received: from localhost ([::1]:32796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfpK-0007aa-Cd for incoming@patchwork.ozlabs.org; Wed, 17 Jun 2020 17:42:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEz-0004kL-11 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:05:01 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:44362) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEu-0000Pw-Gg for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:59 -0400 Received: by mail-qt1-x842.google.com with SMTP id c12so2732467qtq.11 for ; Wed, 17 Jun 2020 14:04:55 -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=E8xOKg6zl9lpl0+sHu1MbBAzWMqSY0gf0lTzZwybF5o=; b=eeIjDad8QZZSwiPDJPlhK/CUYY5xjxWhWsCKEVDRwD3prmDhbP4OuHsTXGFXpyrqcq fgL/59sa1tTdZYAx6uk1lLa5Q+Se/972AnxrO01Cr8/UbSGVL7bn9NSGDkTMTMbicdhQ aH/doqCOF3vW6zSGP+7cYoR2f1igNxpmw1+vimHRxx+divzGubxR3ypvQNKYjIj+oXwa 48NS/Hj43H6dv3L/tKAC9jBK21DOMfFZlfHZ4LAGuFfFQdKm6EdjWN7e2YQTkxIee/fu vOU7ri095drXYoDMfOlLhttYnZPJTQZHypybF08Lqdh60s/NBK+ZJVNp/n6DyPSKPbae PvPQ== 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=E8xOKg6zl9lpl0+sHu1MbBAzWMqSY0gf0lTzZwybF5o=; b=sK5Gk8ZWfHUjZaOIMN5+6k6nwzG3NAmRgUnZJdh+omn0cPJxYsflrqjKUxytgBWIqc n090WGK/hOT3DTGCzMVyu4yQzfzOyI/Ref6/5wNfuuBdByS/6NAFL5VoaLMSA56hQms/ JfnMUYRjmCl1dkZ+s0OYdfRXViqX6AuVXnkEgEawo1PMSzuL5SDky5+uvCwIwY81MeHk XXCo+JNaK39KXtTKcGOO2oAduPEK5Pj8jwyNFaFRodU2cBVhheT9a0cfmQsnyJFCap/s 9E+syn7r6E390Y09vM3cP8Gedxz9/BZMjjCWHc3OGOTKDh0nGcahLErK5o+Zz9IzU0bF AeOw== X-Gm-Message-State: AOAM533Jfeu8PiAaqTpp248VUgzbsJY8qiZiCFa5s0mVqlej560yD1Gj +IbCxTG3ri1EGhuiK4CKo/t3f8jsWJMQkQ== X-Google-Smtp-Source: ABdhPJxNIzeZBOZW0gNtxYteNvYRgBJc+2t1LbJsDe88yOKZZbS2v0yNUfFBlPV9NqI3svqHVeS7nA== X-Received: by 2002:ac8:4281:: with SMTP id o1mr1113527qtl.322.1592427894841; Wed, 17 Jun 2020 14:04:54 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:54 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 69/73] cpu: rename all_cpu_threads_idle to qemu_tcg_rr_all_cpu_threads_idle Date: Wed, 17 Jun 2020 17:02:27 -0400 Message-Id: <20200617210231.4393-70-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-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_HELO_NONE=0.001, SPF_PASS=-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: robert.foley@linaro.org, cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.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(-) diff --git a/cpus.c b/cpus.c index e070bffbff..2e9c19ae36 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; @@ -642,7 +644,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; } @@ -1320,7 +1322,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); } @@ -1676,7 +1678,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.