qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/9] accel: Only include qdev-realized vCPUs in global &cpus_queue
@ 2025-01-28 14:21 Philippe Mathieu-Daudé
  2025-01-28 14:21 ` [RFC PATCH 1/9] accel/tcg: Simplify use of &first_cpu in rr_cpu_thread_fn() Philippe Mathieu-Daudé
                   ` (9 more replies)
  0 siblings, 10 replies; 23+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-01-28 14:21 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Yanan Wang, Eduardo Habkost, Harsh Prateek Bora,
	kvm, Zhao Liu, Daniel P. Berrangé, Markus Armbruster,
	Igor Mammedov, Marcel Apfelbaum, Peter Xu,
	Philippe Mathieu-Daudé, Paolo Bonzini, Richard Henderson

Hi,

The goal of this series is to expose vCPUs in a stable state
to the accelerators, in particular the QDev 'REALIZED' step.

To do so we split the QTAILQ_INSERT/REMOVE calls from
cpu_list_add() / cpu_list_remove(), by moving them to the
DeviceClass::[un]wire() handlers, guaranty to be called just
before a vCPU is exposed to the guest, as "realized".

First we have to modify how &first_cpu is used in TCG round
robin implementation, and ensure we invalidate the TB jmpcache
with &qemu_cpu_list locked.

I'm really out of my comfort zone here, so posting as RFC. At
least all test suite is passing...

I expect these changes to allow CPUState::cpu_index clarifications
and simplifications, but this will be addressed (and commented) in
a separate series.

Regards,

Phil.

Philippe Mathieu-Daudé (9):
  accel/tcg: Simplify use of &first_cpu in rr_cpu_thread_fn()
  accel/tcg: Invalidate TB jump cache with global vCPU queue locked
  cpus: Remove cpu from global queue after UNREALIZE completed
  hw/qdev: Introduce DeviceClass::[un]wire() handlers
  cpus: Add DeviceClass::[un]wire() stubs
  cpus: Call hotplug handlers in DeviceWire()
  cpus: Only expose REALIZED vCPUs to global &cpus_queue
  accel/kvm: Assert vCPU is created when calling kvm_dirty_ring_reap*()
  accel/kvm: Remove unreachable assertion in kvm_dirty_ring_reap*()

 include/hw/qdev-core.h       |  7 +++++++
 accel/kvm/kvm-all.c          |  9 ---------
 accel/tcg/tb-maint.c         |  2 ++
 accel/tcg/tcg-accel-ops-rr.c | 15 ++++++++-------
 cpu-common.c                 |  2 --
 cpu-target.c                 |  7 ++-----
 hw/core/cpu-common.c         | 18 +++++++++++++++++-
 hw/core/qdev.c               | 20 +++++++++++++++++++-
 8 files changed, 55 insertions(+), 25 deletions(-)

-- 
2.47.1



^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2025-02-09 18:03 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-28 14:21 [RFC PATCH 0/9] accel: Only include qdev-realized vCPUs in global &cpus_queue Philippe Mathieu-Daudé
2025-01-28 14:21 ` [RFC PATCH 1/9] accel/tcg: Simplify use of &first_cpu in rr_cpu_thread_fn() Philippe Mathieu-Daudé
2025-01-28 19:44   ` Richard Henderson
2025-01-28 14:21 ` [RFC PATCH 2/9] accel/tcg: Invalidate TB jump cache with global vCPU queue locked Philippe Mathieu-Daudé
2025-01-28 20:05   ` Richard Henderson
2025-01-28 14:21 ` [RFC PATCH 3/9] cpus: Remove cpu from global queue after UNREALIZE completed Philippe Mathieu-Daudé
2025-01-28 20:08   ` Richard Henderson
2025-01-28 14:21 ` [RFC PATCH 4/9] hw/qdev: Introduce DeviceClass::[un]wire() handlers Philippe Mathieu-Daudé
2025-01-28 20:52   ` Richard Henderson
2025-02-04 13:39     ` Igor Mammedov
2025-01-28 14:21 ` [PATCH 5/9] cpus: Add DeviceClass::[un]wire() stubs Philippe Mathieu-Daudé
2025-01-28 20:53   ` Richard Henderson
2025-01-28 14:21 ` [PATCH 6/9] cpus: Call hotplug handlers in DeviceWire() Philippe Mathieu-Daudé
2025-01-28 20:53   ` Richard Henderson
2025-01-28 14:21 ` [RFC PATCH 7/9] cpus: Only expose REALIZED vCPUs to global &cpus_queue Philippe Mathieu-Daudé
2025-01-28 20:53   ` Richard Henderson
2025-01-28 20:55   ` Richard Henderson
2025-01-28 14:21 ` [PATCH 8/9] accel/kvm: Assert vCPU is created when calling kvm_dirty_ring_reap*() Philippe Mathieu-Daudé
2025-01-28 20:57   ` Richard Henderson
2025-01-28 14:21 ` [PATCH 9/9] accel/kvm: Remove unreachable assertion in kvm_dirty_ring_reap*() Philippe Mathieu-Daudé
2025-01-28 20:58   ` Richard Henderson
2025-02-07 15:45 ` [RFC PATCH 0/9] accel: Only include qdev-realized vCPUs in global &cpus_queue Igor Mammedov
2025-02-09 18:02   ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).