From patchwork Sat Jan 25 16:05:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13950410 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4914EC0218D for ; Sat, 25 Jan 2025 16:07:54 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbiff-0004Ey-GC; Sat, 25 Jan 2025 11:06:07 -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 1tbifc-0004EH-Hq for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:04 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbifa-0000Xm-1h for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:04 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4362bae4d7dso21563615e9.1 for ; Sat, 25 Jan 2025 08:06:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821160; x=1738425960; darn=nongnu.org; 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=pJfpeIGSlIY2S2DSWTPOeODntCTV2idscj4/VsOkESE=; b=m5g5vPUvVTU28PO/rNOWnQpYVJ7Q9IWKRaYO280B1Bxu3bImx2uUUF/R6FNc1lfR6y cPb0o7nIA2CObw3GmDKuG5xXemI7aKQVn/2c5IQASlPNbz/1K9v9rfkn6jP//HlzJXsE Q38iuDjQOV2H8MTNkwv0Y98GBtcALa+X92QybBvjESMvKh6dfo/IzGntDz/R70B/eScw g0ggOQ1Owq6F+OvqgN2R22pPiVkI/gnIrWtmHAWctStH/wYEdlqYIozRgtc4PLHAGvIN O/LJaJ9hJ7OZsUkPm0M8eFM2sWzrddhX9wUctvMrmKXsuMcJTufl/BlnnGSQQjX0eyeo HJBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821160; x=1738425960; 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=pJfpeIGSlIY2S2DSWTPOeODntCTV2idscj4/VsOkESE=; b=dVVXjWbqBMUCZdqvI5bquXsMDsPLFI60Ufv296NzoC0tjPDyXswSnmDypYLL+mm6zA Nng4tK1qDGu8xRYCACwpsRWTULy2UJrL2+0GDYczkoEHtbuQQOS8nV46M1DkjNgQ5DF+ +n5+6ztx/D7Aa/RkYvq8X6gzqtapYXn6fLfDSo5CifXNPGo1qditDELLByKHmgo3w3tf OXFBFjkGmVlppHgqoheecqUiJlGDDY/fGwLEqC5cbm93JfZ7PkvGvTKpcnm/Ver6In06 ipdssUoNRLdsT3VLIsdoEspKhu0V3pMFNW8Sq9NpFH9ripj62RAe3V+PBAr2SzW8nSze j6Dg== X-Gm-Message-State: AOJu0YwC3HUy+0ivqswMeP+RswHonQrTwGOWu4ewG0fHLjhm1BE6mj0Q 4zhfZt0TFpDjeZ7L2fDjLC15pXcub6bp1NwJO1kfmoDKO+m/t25bdCRkX4hhwz20ozEIlNzAWr/ 41X8= X-Gm-Gg: ASbGncug6CT1y/mVdb/FrCka5ukUW3ymoBZE+rp5Z/pkdexn8DY9Z1KjJ5wjKkiIvMM qIPd0UOlS7zxhWNcadoS21BWgNgthaBZD0V9u8OIC+z0gjECyjrl023i0z9QjDLroNJe0Bx05rI +AJVKsjqpHZOAaFUoYTcu6YfJuSBE5GPVP6HBRP3/dAO753zNT0tTv0dce5FwEWSLVyVtLjmrjr 1J8x9NY0PwuAig9tJ7qdjG5Gj8J+Y2I1LU8iRoEwmoTk/YmAzmFmWmsUdc1BgOPlB2ZFTkdx5Yc +dA7fX3U8ZMQ4OSvGBXzI3Ca2+x0nH2wD6YH79vRL+EOZvWuCXwsiVo8YRocWwVVs3UIsPE= X-Google-Smtp-Source: AGHT+IHAk1+UZkrJv7uDCSyFTymU5qzz37rS87JjJUVKhZT2JFbsaXkTcYMpM2DbMN7Z9CSMF0IsUQ== X-Received: by 2002:a05:600c:4f42:b0:434:fa55:eb56 with SMTP id 5b1f17b1804b1-438913cf805mr337515805e9.7.1737821160078; Sat, 25 Jan 2025 08:06:00 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c3c8csm6008399f8f.90.2025.01.25.08.05.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:05:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 01/24] cpus: Restrict cpu_has_work() to system emulation Date: Sat, 25 Jan 2025 17:05:29 +0100 Message-ID: <20250125160552.20546-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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, T_SCC_BODY_TEXT_LINE=-0.01 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This method is not used on user emulation, because there is always work to do there. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/hw/core/cpu.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 2402706c7d9..e094d54949d 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -748,6 +748,20 @@ int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attrs); */ bool cpu_virtio_is_big_endian(CPUState *cpu); +/** + * cpu_has_work: + * @cpu: The vCPU to check. + * + * Checks whether the CPU has work to do. + * + * Returns: %true if the CPU has work, %false otherwise. + */ +static inline bool cpu_has_work(CPUState *cpu) +{ + g_assert(cpu->cc->has_work); + return cpu->cc->has_work(cpu); +} + #endif /* CONFIG_USER_ONLY */ /** @@ -814,20 +828,6 @@ CPUState *cpu_create(const char *typename); */ const char *parse_cpu_option(const char *cpu_option); -/** - * cpu_has_work: - * @cpu: The vCPU to check. - * - * Checks whether the CPU has work to do. - * - * Returns: %true if the CPU has work, %false otherwise. - */ -static inline bool cpu_has_work(CPUState *cpu) -{ - g_assert(cpu->cc->has_work); - return cpu->cc->has_work(cpu); -} - /** * qemu_cpu_is_self: * @cpu: The vCPU to check against.