From nobody Tue Feb 10 06:26:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) client-ip=209.85.221.44; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f44.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1631467664; cv=none; d=zohomail.com; s=zohoarc; b=Y+YZrqGeKq/9+7fcUfN2nVRND66hb03jyACd/N36vd86L61+yaHKgK1YR3UUyKJ29SvwiT7H5wkDT5Hj/RTqTQDoXnjjtRHfNiFGVy2cR+TyLEG7jmN3/F/TWv/BFLQDdH4Mehk1LuSmjz5S7/Ir5DImTIq2CoqDY9/0PPCexJc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631467664; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tcpBP/9O11lxH2OkY3DQ1OAE3IFU4nJ2jfhNdgzdGjo=; b=I3zG00PPuftr93vEqsoryax2UtjDJnr+ztQ1gV30Dpe/+eWzphyLCC98OvSKRmMPYPACAbGaH6va6MttgPtkt5MJ0kNHA1M/23HXzuUbHBpwvMNg2x4bi8u1xDoHCCRVrwzsJL98YWansN6rLrybYgQSghAvBaKEYde5B0Q14wc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mx.zohomail.com with SMTPS id 1631467664854733.870543055453; Sun, 12 Sep 2021 10:27:44 -0700 (PDT) Received: by mail-wr1-f44.google.com with SMTP id u15so4871423wru.6 for ; Sun, 12 Sep 2021 10:27:44 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id z5sm4702133wmf.33.2021.09.12.10.27.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Sep 2021 10:27:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tcpBP/9O11lxH2OkY3DQ1OAE3IFU4nJ2jfhNdgzdGjo=; b=JixNNMDnQWkfEOitzmixTeIfAnZe0sufCngbXzLetQsRYaCAKjzIxRyO31pVI14lKE g7ftKDJ3zu92O2KtDcQgXmrK6RvW8NBihJzT4cB834ZEN+7zEVK+WzWTJssM6yX9g5fz auYyfhL9e0Q4A4gwXIG5tfyP/L6QLt86KsB5msdJlF7iLYhPgNuZvFSRwQuT7rdiTx0D h1vZSVfmexa2eIdD2ZaQvM2fJa8gIcpJRX4SUGs/W+k4KfXIuVQ499JcXYoMXLo34ws3 YAMH9ZeL7j3Rox6kw5srQICVp9Qnyc2AUUP3V8xQkhQRlXePVYVqc4o/kygKhBRnJyou A+wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=tcpBP/9O11lxH2OkY3DQ1OAE3IFU4nJ2jfhNdgzdGjo=; b=fYaCzK4d3irxysGZyKDEy37GP/j16QLm9VzPITkJ/0EExi4feL9Dk1QUx0gbDz0nq7 sQR35jYJIT1oUSVzCJLGYUaxWpiXzF0DlNeoGLbpexu7jHuTJJedgMPG+ft8eRMY1Ge4 Z1f36uMOuFeZKhth8HGTMM/v8fZLgWHUfhdkSmvIRh91WeK4YmKW/egEpTsFG79JLZIK JaD+0gGCx3xG/AaxU40d0AWxga409bMNWpnGReFxbgyD61bBo384Ew8x136OquvrFK5Q 76MvkbKKqThLHHo/EKv6jYrYdF6sXsJJ7symm17ImLWJCcKjWULxNhuhZr0ChnC9H+mq 2izg== X-Gm-Message-State: AOAM533VYRse3KpglGHSCyIfAuNqXtQGZu7c7i0Pusp5340bojv09FDT MvIVzeymV2DjnXV3snkpvCA= X-Google-Smtp-Source: ABdhPJz1t0gM78HeLwEXxugyzTvm6uWuK41P4y8OW7ReirZHWuFzlUAR/q1JSQQRRXmMWfbHdwiolg== X-Received: by 2002:adf:90cc:: with SMTP id i70mr8361547wri.408.1631467663011; Sun, 12 Sep 2021 10:27:43 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 02/30] hw/core: Restrict cpu_has_work() to sysemu Date: Sun, 12 Sep 2021 19:27:03 +0200 Message-Id: <20210912172731.789788-3-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210912172731.789788-1-f4bug@amsat.org> References: <20210912172731.789788-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1631467666135100001 cpu_has_work() is only called from system emulation code. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/cpu.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index bc864564cee..2bd563e221f 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -538,6 +538,22 @@ enum CPUDumpFlags { void cpu_dump_state(CPUState *cpu, FILE *f, int flags); =20 #ifndef CONFIG_USER_ONLY +/** + * 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) +{ + CPUClass *cc =3D CPU_GET_CLASS(cpu); + + g_assert(cc->has_work); + return cc->has_work(cpu); +} + /** * cpu_get_phys_page_attrs_debug: * @cpu: The CPU to obtain the physical page address for. @@ -636,22 +652,6 @@ CPUState *cpu_create(const char *typename); */ const char *parse_cpu_option(const char *cpu_option); =20 -/** - * 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) -{ - CPUClass *cc =3D CPU_GET_CLASS(cpu); - - g_assert(cc->has_work); - return cc->has_work(cpu); -} - /** * qemu_cpu_is_self: * @cpu: The vCPU to check against. --=20 2.31.1