From nobody Tue Feb 10 06:26:51 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=1631467684; cv=none; d=zohomail.com; s=zohoarc; b=ZcyTunkEnJwxg4loGR1ad3KlqF0n3o4l1KPINgKkiKxlL8CVeWFUov2kD0XjhzrQkwVi6RQTiFGpx8WL8pww2Sf/Xn5FvYf6ItWBxFzrDgcecLXnCuY0Rj53GNKige6iWUCFaBXi3vv6MRpFkNzzzrT81O2/7ccQBu2g5UeEBvY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631467684; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WTlRxPmHW1MMBzxLKQbK3V9oXhvEdGh1iTdPd/VuorU=; b=jxvyuKvDd6D8qIelxrgCks61IIV7s5BG6OjWDZpOS4P+r1DX3+mEt34YK6r2w2TF/vLs6yJkx0b87ElojHzQq+QruCOHkaVXmdj79d4Yxw03suB4A5yqNFtOko9CS4kHczYvdapJexTQHBo6hOfGpadMGSWtrsB3GaEyI7jPfSA= 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 1631467684667802.6327943449496; Sun, 12 Sep 2021 10:28:04 -0700 (PDT) Received: by mail-wr1-f44.google.com with SMTP id w29so10161793wra.8 for ; Sun, 12 Sep 2021 10:28:04 -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 n26sm2872141wmi.43.2021.09.12.10.28.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Sep 2021 10:28: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=WTlRxPmHW1MMBzxLKQbK3V9oXhvEdGh1iTdPd/VuorU=; b=DhYgYpEAEWJcnaaKKWlUEGAGFTdtbCfP9xsTmf9HzAfGe5hEtahL57cWM6F8YCBt1f Lu7jrYAL5ZMRxevRYG71IYREH3fzlMDtaZvj42jZZxmqbECY/V2ePRuDRoGUaAK56nFT UW+ecqqg3OV8WoWAPhVJT11Rx8G+TnRAfQGdsUxdOFMpfkImlx8WUM+Lgg+wdg7VraC2 KOkY3FJcfztorlRTkWLqqFO4mFcliVn/W4oVrowA7vz5P5LwQFq6ZIgYgH+nE9S0l1RF fkeNp37IzfvOIPcwM4TwcyRHyYVUPIhFPw+W9/6TpSr1nynwbNVfBbG7Tnp1dFgzOtmB h0fQ== 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=WTlRxPmHW1MMBzxLKQbK3V9oXhvEdGh1iTdPd/VuorU=; b=70AIK1wQsnBX3sqdxhchvJyfMlM6gV2AGGFygXLBczQADXH5Vn6ZOTz4bbIfMKhFGb KYShhXvRz50Gp1PSRRiPjmj/ldPlxhE/YdLAlO46u8uiDuKPpcGfAVs3nAA+6S7fNAH8 xxAiw2Y4CQECEWN99C6aNiPWg4TfCVdRRuNQWGYG+SqXvZft+tzmxm3ybi/Cmp0z1tYP 8ERWTmZe8G/qtHiAozdCk+e/5KUE4EnvN89ZeZL7f022MIaxOYfKp9eS5sUDNnp/Qlmd d6/svgNK1RjvUghvbCzMaQq7fJ/SWR12/SmRG9cRKIi864b5LUmnjCpGvMgalEkrwkjF MHKA== X-Gm-Message-State: AOAM530Xld+ynSOUAZJHDSGXWnMzaG4Q0sZ/4Y5BrFzZNba2f7oyllEx fRSWotIKZ6KUB7wRcxJwoLU= X-Google-Smtp-Source: ABdhPJzV4478kF6HL6N3eMFNnVx/0ZGwoc+WwakP9h3V+WNiSG+Jpd9ENWLBwzg9c1dpGPhqRXFVDw== X-Received: by 2002:adf:fd12:: with SMTP id e18mr4291840wrr.275.1631467682937; Sun, 12 Sep 2021 10:28:02 -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 06/30] accel/whpx: Implement AccelOpsClass::has_work() Date: Sun, 12 Sep 2021 19:27:07 +0200 Message-Id: <20210912172731.789788-7-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: 1631467685328100001 Implement WHPX has_work() handler in AccelOpsClass and remove it from cpu_thread_is_idle() since cpu_has_work() is already called. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- softmmu/cpus.c | 4 +--- target/i386/whpx/whpx-accel-ops.c | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 3db7bd4eb4d..6bce52ce561 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -41,7 +41,6 @@ #include "sysemu/replay.h" #include "sysemu/runstate.h" #include "sysemu/cpu-timers.h" -#include "sysemu/whpx.h" #include "hw/boards.h" #include "hw/hw.h" #include "trace.h" @@ -89,8 +88,7 @@ bool cpu_thread_is_idle(CPUState *cpu) if (cpu_is_stopped(cpu)) { return true; } - if (!cpu->halted || cpu_has_work(cpu) || - whpx_apic_in_platform()) { + if (!cpu->halted || cpu_has_work(cpu)) { return false; } return true; diff --git a/target/i386/whpx/whpx-accel-ops.c b/target/i386/whpx/whpx-acce= l-ops.c index 6bc47c53098..1f9c6d52c27 100644 --- a/target/i386/whpx/whpx-accel-ops.c +++ b/target/i386/whpx/whpx-accel-ops.c @@ -83,6 +83,11 @@ static void whpx_kick_vcpu_thread(CPUState *cpu) } } =20 +static bool whpx_cpu_has_work(CPUState *cpu) +{ + return whpx_apic_in_platform(); +} + static void whpx_accel_ops_class_init(ObjectClass *oc, void *data) { AccelOpsClass *ops =3D ACCEL_OPS_CLASS(oc); @@ -94,6 +99,7 @@ static void whpx_accel_ops_class_init(ObjectClass *oc, vo= id *data) ops->synchronize_post_init =3D whpx_cpu_synchronize_post_init; ops->synchronize_state =3D whpx_cpu_synchronize_state; ops->synchronize_pre_loadvm =3D whpx_cpu_synchronize_pre_loadvm; + ops->has_work =3D whpx_cpu_has_work; } =20 static const TypeInfo whpx_accel_ops_type =3D { --=20 2.31.1