From nobody Tue Feb 10 10:55:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.53 as permitted sender) client-ip=209.85.221.53; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f53.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.53 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1632174304; cv=none; d=zohomail.com; s=zohoarc; b=ZdDDj2Fc6zpQslJX51NddSAYWr+N2s/aRH6jiTrtXJVyrjWNobjXWw6xr37DQLDReGyXx/IswYFsQ3Ifj+PJCGPWX4UEXCIh2CslcBQm0y3/g91EIGp7Np1Rs/MoGmFE94bUjQEQ9/eFIBzowGX5dFVw5dbmgepGw0t0LlDmnzQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632174304; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tcpBP/9O11lxH2OkY3DQ1OAE3IFU4nJ2jfhNdgzdGjo=; b=gC0BtGuK1VeaUnjeqjRO+kpNblXX8m5UXXJuu84RMTz6uRnmSuITWoSJhO3VECzM+Ap/iZ3RSm0iJ1/OoRMJLTBHRBMvZtkDI581d0Jh4OTHacxFHgad8c9eZfj04PZsSsnbozEWpW9dLzHzBoRDMOK58G+k7GkOVMNM5xp9geo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.53 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mx.zohomail.com with SMTPS id 1632174304791585.1891457104427; Mon, 20 Sep 2021 14:45:04 -0700 (PDT) Received: by mail-wr1-f53.google.com with SMTP id i23so33592337wrb.2 for ; Mon, 20 Sep 2021 14:45:04 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id q126sm657539wma.10.2021.09.20.14.45.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Sep 2021 14:45:02 -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=KNqaiPJJG7+8+0l9g/i8xd7y5CGN1e7IVj1XOui33LadYMx2Z8YehyaRKhXD5digSn tl3Q7iNGMk9aAmX69HGPDQiqk77kZIULOi5KiaB7HbE3HQ73MzjTWoYs37ONzjANdc9W 6q21G1DIFF9i+YGQqKt14lYzth4J+s8pnDyYK3xIq2ZWLn68FXRCtT3+HwMKtTmJPUdQ +cBVoaHUPqqHWx63F2wM2EcvDVz8k6ArZHxbNruyl+bFVUqng0kJkLqb/FNxma0/rdd6 0H2oYKnwtN4nhltlyN2ZQtWqeNm/9jUJJ6FkV5mzwmh+a8WraVr/LwalgnH+E8oFRnqy FlkA== 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=2rJo7YNkSkeCYPoYfzjfcpA8RVyRqw5ND18OnvGh2CV24D4ClIzuG1dQjQtwNjEk98 vR8nUfOS/lHcCJw/0/VakVJsE99gc7lKJcagE8Fx2DfLv2hVmwN4TRX+dp3AWDTjJCHn yQmZqGVoL4pDk3i3ksQQJ419cKqDxGEmmWUjGU16sy412il2U+CLFYzGXrOBQuETV10m hiKDy2gHP1iDxKLlx4irBsO6GRurLpRUeIz1NMSWK9pyEKAxxLSYRiehP1dUnyLO2uiN IgwOtl3H8Cj9A1+tazW/xx+QxqcYf2tHQ4Z3ULlWWg4yoQInYQeLx20LG7gMl4gzKZl6 AVUQ== X-Gm-Message-State: AOAM5321fQUhyS8TAf1btqSNqpp2yemyzUuKvwyz6s4DsIRZGgwZ8uAZ xiz9Xv6IEiFLa1u4XOYg1EdBeEpHM0I= X-Google-Smtp-Source: ABdhPJy61JGIBHdffCz52LmMSIW9jUKu7fnf0C0ppuOp9o6+JyYGfGk2UuP4emp/jz5ltlCzDpefHw== X-Received: by 2002:a05:600c:4e86:: with SMTP id f6mr1104874wmq.166.1632174303059; Mon, 20 Sep 2021 14:45:03 -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: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v5 03/31] hw/core: Restrict cpu_has_work() to sysemu Date: Mon, 20 Sep 2021 23:44:19 +0200 Message-Id: <20210920214447.2998623-4-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210920214447.2998623-1-f4bug@amsat.org> References: <20210920214447.2998623-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: 1632174305792100001 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