From nobody Tue Feb 10 03:38:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) client-ip=209.85.221.41; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f41.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1632476406; cv=none; d=zohomail.com; s=zohoarc; b=MUQXVivw4n6EG5LAYCxOdPAmWH2MW+FcbSv1s3rduujtZWuOPSpc9jhQX6cC+sEfp6S5sZRPmYNInsr7Cxnxn5jewqxHufIpmIBv6mHhucj5Ni+K2FicZIihETDd/tF3tKRW8/htq+vQUJ+XzizNQbrMleimqmG+zXi7QRPJkrk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632476406; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JRKOlLYiSGogxCXK7W1sZhtnHuRe58y47UC3DXkXm/g=; b=VXt1UIW1R9kcVzpk4I9oPaWcSFv8Y+djr6NxodVFdnlnRui+NX6amsU7NBBdxN46V1JM7dVNZuXiIaw3qygAoYHsF0y7zNCwa9y4Fm/7W3+OVSqGAmN/CnwjYSHq99E43sfp01kNIoSNV2WMH9vEXc7ryPAYvOCGD12mNQnpOKc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mx.zohomail.com with SMTPS id 1632476406820249.53401859496546; Fri, 24 Sep 2021 02:40:06 -0700 (PDT) Received: by mail-wr1-f41.google.com with SMTP id w17so25394580wrv.10 for ; Fri, 24 Sep 2021 02:40:06 -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 v191sm7786345wme.36.2021.09.24.02.40.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:40:04 -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=JRKOlLYiSGogxCXK7W1sZhtnHuRe58y47UC3DXkXm/g=; b=B3in8lo5Ftj1ZWYW4d3iRbT6My7HPS9340+n8jYee0PG6H3f1FWsaxbQ29hBXTsR96 S5ylV6RBV6667ZFItiMgghyH4+172SWd1bkQC0ZmSogm5rJDoGmGmEtK0KHO3f6HuXpn CWPlShK2FnjnqBTgjEbcIMOookkO3/65IbnMHsLm69rTcuGZwidgn+eu7tK8i9PXD5i/ xa8zQz2Lgvh996KoRx0bYi+n52RGzBfxpYHrTJMUO4ubBOddewTjxSEmlm6JUaHE8K05 1LDYPwRVmypRiErPoeyvNS3CjRrF33D6sD0jrp78MXs+wYepXxRQpdY0iHQNYRLnTh3X O0Bg== 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=JRKOlLYiSGogxCXK7W1sZhtnHuRe58y47UC3DXkXm/g=; b=ADvn976VkPx+PWzTzJHhMxHQOiaME4fcl/Ow0zRZaxVtbjKFpveB8cbq0+NSh5PSGh McISdcSTkijI1rrHU8/hAM5XtEVEdgItsHESEjbWiKbogo/vZ7JQpRjeFBzUPpw1KllV hRVPDVD8Bqftv0wapkMKndY/c37QPOrzIUQwknsYfXsbklc3rL/TQULWUjOgDY4wI6Ht 168BzpeO01+W5qtSEA3Zw7pv2SeZ67qT6LGxRyc0vpBB5j5LkxXYHVl1m3MtNTvWRtCO IsK7xj22yVI3y71p+oCdQz5ytIycay5/BO/e+jq5WCsvWF8UT+ytCtqsuYgVzbd53LkD GgVA== X-Gm-Message-State: AOAM533vxdXXUOGZxGsBq4YhNoFaw4A1Ou6qzXxzzyN5Yk8hdJ3GcR8E fLgZP3LyCS3KAgSvk1tE1ss= X-Google-Smtp-Source: ABdhPJxSsi7GocfHNhpK13aPvafIyRTlD02upQgzK1BlcjNSRQVC4JWnZMwFlNu2os4BXMV9LBa9Wg== X-Received: by 2002:adf:f207:: with SMTP id p7mr10524041wro.166.1632476404945; Fri, 24 Sep 2021 02:40:04 -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?= , Paolo Bonzini Subject: [PATCH v6 16/40] accel/tcg: Introduce TCGCPUOps::has_work() Date: Fri, 24 Sep 2021 11:38:23 +0200 Message-Id: <20210924093847.1014331-17-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: 1632476408368100001 Introduce a target-specific has_work() handler for TCG. Eventually call it from tcg_cpu_has_work(), our AccelOpsClass::has_work() handler. Inspired-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/tcg-cpu-ops.h | 4 ++++ accel/tcg/tcg-accel-ops.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 55123cb4d22..4a4c4053e3b 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -66,6 +66,10 @@ struct TCGCPUOps { void (*do_interrupt)(CPUState *cpu); #endif /* !CONFIG_USER_ONLY || !TARGET_I386 */ #ifdef CONFIG_SOFTMMU + /** + * @has_work: Callback for checking if there is work to do. + */ + bool (*has_work)(CPUState *cpu); /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exe= c */ bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); /** diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index ebaacff1842..cd44bb6d0d8 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -32,6 +32,7 @@ #include "qemu/main-loop.h" #include "qemu/guest-random.h" #include "exec/exec-all.h" +#include "hw/core/tcg-cpu-ops.h" =20 #include "tcg-accel-ops.h" #include "tcg-accel-ops-mttcg.h" @@ -80,6 +81,9 @@ static bool tcg_cpu_has_work(CPUState *cpu) if (cc->has_work) { return cc->has_work(cpu); } + if (cc->tcg_ops->has_work) { + return cc->tcg_ops->has_work(cpu); + } return false; } =20 --=20 2.31.1