From nobody Mon Feb 9 21:00:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) client-ip=209.85.221.46; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f46.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1632476345; cv=none; d=zohomail.com; s=zohoarc; b=kXL3xCskmvw5BoC+sPR8v3edFoz6ZeFGIe1u0Kf7a0Tp5tjy/mjwloLAEveYMhDzvsAFQTzj/gWvdqSZtlD+ER6UVyIsf51+LFIB6/YY2a2NFev15V2YzGXa6Qls4/nf0hMWJUKN+ySSzPJqhE6TR1A5AdPkUUGuy0/OYUhHRHU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632476345; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tcpBP/9O11lxH2OkY3DQ1OAE3IFU4nJ2jfhNdgzdGjo=; b=BM32qdUjLB5T/hWbxjai8pyh1K/AsZ4NnHDn0kt2hnr4I82Tn1WQaiP3LjbjTH2HOmIhwQl5enThYlXHqR7467aY6mC6+8uErvBtLMufhhpGNrWgs3WM/DRY9yv5iHPO7OVBWS/8IcIEhqgUZs+/ggjrg61zBYKvBpsRHHvFEjg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.zohomail.com with SMTPS id 163247634537082.12287317374876; Fri, 24 Sep 2021 02:39:05 -0700 (PDT) Received: by mail-wr1-f46.google.com with SMTP id t28so12094088wra.7 for ; Fri, 24 Sep 2021 02:39: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 n19sm1325752wms.47.2021.09.24.02.39.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:39:03 -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=WLY7+TOk/x3MxGIBWFNhGUNSBik56JD0m+P7Kt0ZcaeIA9YpEwGM5Qsi+S5zh5nrHr UbpgVVcAgadzYKqxRs/bZ3nHkFfj3jWBRiFSocCVJ0B5kuQEuV3XkfFa0DYCI5qacq9k wejFgzHUtWnGvsj6ZFIp1tt6z1XeFjEWbDrzwFl2PSCDfl6fDVsfq1ow039vvRsRRM5s IhOdjr1dToXzmRu4Eo0i7eW+5wb2Zx1c2uF9YQE4fGdKMNbYihwEMXbWATSE5zH2Ov2t FmuOFunbalKKu6IzesVW2HqbljUPQ5dAsltiq8dqmHq0BBf4UuRx6oDN8Fx7/qo1oFFt iOPA== 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=wB9O1AjJZKJsIoncDLAVOt8UAcofLckRFdgcdIDqqKZVNczCWZeVDrFhsaiKlrZ5NJ APjbExIXrfeZg7dAMH1wAP7A0NXzXkZObdhdFxTYEDjyqEhyNtWXnIdJ0cb63wiNCTPX kXDBoXaDF9eu+6EVNPxOoIsQCZeDgT6W92IBIxV/CgcjRSPZDwpwqrThkY8HApq2wkQr PrfrWiqZlUN0DNPCy7BJ1FttGtDS9NKqLw0FR3rAJ3Z7FyI3sH8EdnL5scJ4MK/NCTt8 dzOFFgDOjNgy2PpRzlnRI1IXO5668X5Cp1VnNJYitr4qtozR4IIdq2aUq7tCBTcx33m8 KgOQ== X-Gm-Message-State: AOAM531SICfsnmeIAYA4MiOoJLd9ZaZ1pq1JpepiS36W6WvYFVxURXWu G0wfVUulooDdkEXp9kBykj0= X-Google-Smtp-Source: ABdhPJxw76TXcxjMtX6av9tiKhPOijBdHW9A/O/opESJjSyXGHgMGLoZ8t4VqmFCpHCnAM53AweWAQ== X-Received: by 2002:a7b:c20f:: with SMTP id x15mr1053776wmi.59.1632476343524; Fri, 24 Sep 2021 02:39: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?= , Eduardo Habkost , Marcel Apfelbaum Subject: [PATCH v6 03/40] hw/core: Restrict cpu_has_work() to sysemu Date: Fri, 24 Sep 2021 11:38:10 +0200 Message-Id: <20210924093847.1014331-4-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-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: 1632476347130100001 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