qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 00/48] accel: Preparatory cleanups for split-accel
@ 2025-06-20 17:12 Philippe Mathieu-Daudé
  2025-06-20 17:12 ` [RFC PATCH v2 01/48] system/runstate: Document qemu_add_vm_change_state_handler() Philippe Mathieu-Daudé
                   ` (40 more replies)
  0 siblings, 41 replies; 77+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-06-20 17:12 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alex Bennée, Alexander Graf, Richard Henderson,
	Pierrick Bouvier, Peter Maydell, Thomas Huth, Cameron Esfahani,
	Julian Armistead, Paolo Bonzini, Edgar E. Iglesias,
	Philippe Mathieu-Daudé

Few changes needed before being able to add the
split acceleration:

- few method docstring added
- remove pointless stubs
- propagate soon required AccelState argument
- try to reduce current_accel() uses
- move declarations AccelClass <-> AccelOpsClass
- display model name in 'info cpus'
- add 'info accel' command to monitor
- rename CPUState @dirty -> @hwaccel_synchronized
- make accel_create_vcpu_thread() more generic
- introduce hwaccel_enabled()
- expose init/exec/destroy vcpu hooks in AccelOpsClass for re-use
- add SysemuCPUOps::can_accelerate() hook

Commit descriptions are scarse because it is a RFC
(and I'm quite tired before the week-end).

Also available in the split-accel-rfc-v5 tag:
https://gitlab.com/philmd/qemu/-/commits/split-accel-rfc-v5

Regards,

Phil.

Philippe Mathieu-Daudé (48):
  system/runstate: Document qemu_add_vm_change_state_handler()
  system/cpus: Defer memory layout changes until vCPUs are realized
  system/cpus: Assert interrupt handling is done with BQL locked
  accel/kvm: Remove kvm_init_cpu_signals() stub
  accel/kvm: Reduce kvm_create_vcpu() declaration scope
  accel: Propagate AccelState to AccelClass::init_machine()
  accel/kvm: Prefer local AccelState over global MachineState::accel
  accel/hvf: Re-use QOM allocated state
  accel/tcg: Prefer local AccelState over global current_accel()
  accel: Pass AccelState argument to gdbstub_supported_sstep_flags()
  accel: Move supports_guest_debug() declaration to AccelClass
  accel: Move cpus_are_resettable() declaration to AccelClass
  accel: Move cpu_common_[un]realize() declarations to AccelOpsClass
  hw/core/machine: Display CPU model name in 'info cpus' command
  accel/system: Add 'info accel' on human monitor
  accel/tcg: Factor tcg_dump_flush_info() out
  accel/tcg: Implement get_[vcpu]_stats()
  accel/hvf: Implement get_vcpu_stats()
  cpus: Document CPUState::vcpu_dirty field
  cpus: Rename 'vcpu_dirty' field as negated 'hwaccel_synchronized'
  accel/hvf: Replace @dirty field by generic @hwaccel_synchronized
  accel/nvmm: Replace @dirty field by generic @hwaccel_synchronized
  accel/whpx: Replace @dirty field by generic @hwaccel_synchronized
  accel/kvm: Remove kvm_cpu_synchronize_state() stub
  accel/system: Document cpu_synchronize_state()
  accel/system: Document cpu_synchronize_state_post_init/reset()
  accel/dummy: Factor dummy_thread_precreate() out
  accel/dummy: Factor tcg_vcpu_thread_precreate() out
  accel: Factor accel_create_vcpu_thread() out
  accel: Introduce AccelOpsClass::cpu_thread_routine handler
  accel/dummy: Convert to AccelOpsClass::cpu_thread_routine
  accel/tcg: Convert to AccelOpsClass::cpu_thread_routine
  accel/hvf: Convert to AccelOpsClass::cpu_thread_routine
  accel/kvm: Convert to AccelOpsClass::cpu_thread_routine
  accel/nvmm: Convert to AccelOpsClass::cpu_thread_routine
  accel/whpx: Convert to AccelOpsClass::cpu_thread_routine
  accel/nvmm: Expose nvmm_enabled() to common code
  accel/whpx: Expose whpx_enabled() to common code
  accel/system: Introduce hwaccel_enabled() helper
  accel: Factor accel_cpu_realize() out
  accel/tcg: Factor tcg_vcpu_init() out for re-use
  accel/tcg: Expose vcpu_[un]register() and cpu_exec() for MTTCG
  accel/tcg: Expose vcpu_[un]register() and cpu_exec() for RR
  accel/system: Declare init/exec/destroy vcpu hooks
  accel/tcg: Register init/exec/destroy vcpu hooks
  accel/hvf: Register init/exec/destroy vcpu hooks
  accel: Expose generic_handle_interrupt()
  system: Introduce SysemuCPUOps::can_accelerate()

 qapi/machine.json                 |  3 ++
 accel/accel-internal.h            |  2 +
 accel/tcg/internal-common.h       |  2 +
 accel/tcg/tcg-accel-ops-icount.h  |  4 +-
 accel/tcg/tcg-accel-ops-mttcg.h   |  7 ++-
 accel/tcg/tcg-accel-ops-rr.h      |  3 ++
 accel/tcg/tcg-accel-ops.h         |  5 ++
 include/hw/core/cpu.h             | 13 +++++-
 include/hw/core/sysemu-cpu-ops.h  |  4 ++
 include/qemu/accel.h              | 11 +++--
 include/system/accel-ops.h        | 32 +++++++++++--
 include/system/cpus.h             |  5 +-
 include/system/hvf.h              |  2 +-
 include/system/hvf_int.h          |  1 -
 include/system/hw_accel.h         | 34 +++++++++++++-
 include/system/kvm.h              |  8 ----
 include/system/nvmm.h             | 23 +++++-----
 include/system/runstate.h         | 10 ++++
 include/system/whpx.h             | 27 +++++------
 accel/accel-common.c              | 60 ++++++++++++++++++++----
 accel/accel-system.c              | 40 +++++++++++++++-
 accel/dummy-cpus.c                | 10 +---
 accel/hvf/hvf-accel-ops.c         | 60 ++++++++++++------------
 accel/kvm/kvm-accel-ops.c         | 18 +-------
 accel/kvm/kvm-all.c               | 42 ++++++++++-------
 accel/qtest/qtest.c               |  5 +-
 accel/stubs/kvm-stub.c            |  9 ----
 accel/stubs/nvmm-stub.c           | 12 +++++
 accel/stubs/whpx-stub.c           | 12 +++++
 accel/tcg/monitor.c               | 27 +++++++----
 accel/tcg/tcg-accel-ops-icount.c  |  8 ++--
 accel/tcg/tcg-accel-ops-mttcg.c   | 53 +++++++++++++--------
 accel/tcg/tcg-accel-ops-rr.c      | 76 +++++++++++++++++++++----------
 accel/tcg/tcg-accel-ops.c         | 36 +++++++++++----
 accel/tcg/tcg-all.c               | 20 ++++++--
 accel/xen/xen-all.c               |  3 +-
 bsd-user/main.c                   |  2 +-
 gdbstub/system.c                  |  7 +--
 hw/core/cpu-system.c              | 13 ++++++
 hw/core/machine-hmp-cmds.c        |  3 +-
 hw/core/machine-qmp-cmds.c        |  1 +
 linux-user/main.c                 |  2 +-
 system/cpus.c                     | 18 ++------
 system/physmem.c                  |  8 ++++
 target/arm/hvf/hvf.c              |  6 +--
 target/i386/hvf/hvf.c             |  6 +--
 target/i386/hvf/x86hvf.c          |  2 +-
 target/i386/nvmm/nvmm-accel-ops.c | 12 +----
 target/i386/nvmm/nvmm-all.c       | 29 +++++-------
 target/i386/whpx/whpx-accel-ops.c | 12 +----
 target/i386/whpx/whpx-all.c       | 30 +++++-------
 target/mips/kvm.c                 |  4 +-
 accel/stubs/meson.build           |  2 +
 hmp-commands-info.hx              | 12 +++++
 54 files changed, 560 insertions(+), 296 deletions(-)
 create mode 100644 accel/stubs/nvmm-stub.c
 create mode 100644 accel/stubs/whpx-stub.c

-- 
2.49.0



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

end of thread, other threads:[~2025-06-23 14:16 UTC | newest]

Thread overview: 77+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-20 17:12 [RFC PATCH v2 00/48] accel: Preparatory cleanups for split-accel Philippe Mathieu-Daudé
2025-06-20 17:12 ` [RFC PATCH v2 01/48] system/runstate: Document qemu_add_vm_change_state_handler() Philippe Mathieu-Daudé
2025-06-22  1:11   ` Richard Henderson
2025-06-20 17:12 ` [RFC PATCH v2 02/48] system/cpus: Defer memory layout changes until vCPUs are realized Philippe Mathieu-Daudé
2025-06-20 17:12 ` [RFC PATCH v2 03/48] system/cpus: Assert interrupt handling is done with BQL locked Philippe Mathieu-Daudé
2025-06-22  1:12   ` Richard Henderson
2025-06-20 17:12 ` [RFC PATCH v2 04/48] accel/kvm: Remove kvm_init_cpu_signals() stub Philippe Mathieu-Daudé
2025-06-22  1:13   ` Richard Henderson
2025-06-20 17:12 ` [RFC PATCH v2 05/48] accel/kvm: Reduce kvm_create_vcpu() declaration scope Philippe Mathieu-Daudé
2025-06-22  1:14   ` Richard Henderson
2025-06-20 17:12 ` [RFC PATCH v2 06/48] accel: Propagate AccelState to AccelClass::init_machine() Philippe Mathieu-Daudé
2025-06-20 17:13 ` [RFC PATCH v2 07/48] accel/kvm: Prefer local AccelState over global MachineState::accel Philippe Mathieu-Daudé
2025-06-20 17:13 ` [RFC PATCH v2 08/48] accel/hvf: Re-use QOM allocated state Philippe Mathieu-Daudé
2025-06-20 17:13 ` [RFC PATCH v2 09/48] accel/tcg: Prefer local AccelState over global current_accel() Philippe Mathieu-Daudé
2025-06-20 17:13 ` [RFC PATCH v2 10/48] accel: Pass AccelState argument to gdbstub_supported_sstep_flags() Philippe Mathieu-Daudé
2025-06-22  1:16   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 11/48] accel: Move supports_guest_debug() declaration to AccelClass Philippe Mathieu-Daudé
2025-06-22  1:20   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 12/48] accel: Move cpus_are_resettable() " Philippe Mathieu-Daudé
2025-06-22  1:22   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 13/48] accel: Move cpu_common_[un]realize() declarations to AccelOpsClass Philippe Mathieu-Daudé
2025-06-22  1:24   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 14/48] hw/core/machine: Display CPU model name in 'info cpus' command Philippe Mathieu-Daudé
2025-06-20 17:13 ` [RFC PATCH v2 15/48] accel/system: Add 'info accel' on human monitor Philippe Mathieu-Daudé
2025-06-22  1:26   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 16/48] accel/tcg: Factor tcg_dump_flush_info() out Philippe Mathieu-Daudé
2025-06-22  1:28   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 17/48] accel/tcg: Implement get_[vcpu]_stats() Philippe Mathieu-Daudé
2025-06-22  1:28   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 18/48] accel/hvf: Implement get_vcpu_stats() Philippe Mathieu-Daudé
2025-06-22  1:30   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 19/48] cpus: Document CPUState::vcpu_dirty field Philippe Mathieu-Daudé
2025-06-22  1:30   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 20/48] cpus: Rename 'vcpu_dirty' field as negated 'hwaccel_synchronized' Philippe Mathieu-Daudé
2025-06-22  1:35   ` Richard Henderson
2025-06-23 14:13     ` Philippe Mathieu-Daudé
2025-06-20 17:13 ` [RFC PATCH v2 21/48] accel/hvf: Replace @dirty field by generic @hwaccel_synchronized Philippe Mathieu-Daudé
2025-06-20 17:13 ` [RFC PATCH v2 22/48] accel/nvmm: " Philippe Mathieu-Daudé
2025-06-20 17:13 ` [RFC PATCH v2 23/48] accel/whpx: " Philippe Mathieu-Daudé
2025-06-20 17:13 ` [RFC PATCH v2 24/48] accel/kvm: Remove kvm_cpu_synchronize_state() stub Philippe Mathieu-Daudé
2025-06-22  1:35   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 25/48] accel/system: Document cpu_synchronize_state() Philippe Mathieu-Daudé
2025-06-22  1:46   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 26/48] accel/system: Document cpu_synchronize_state_post_init/reset() Philippe Mathieu-Daudé
2025-06-22  1:46   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 27/48] accel/dummy: Factor dummy_thread_precreate() out Philippe Mathieu-Daudé
2025-06-22  1:58   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 28/48] accel/dummy: Factor tcg_vcpu_thread_precreate() out Philippe Mathieu-Daudé
2025-06-22  1:49   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 29/48] accel: Factor accel_create_vcpu_thread() out Philippe Mathieu-Daudé
2025-06-22  1:56   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 30/48] accel: Introduce AccelOpsClass::cpu_thread_routine handler Philippe Mathieu-Daudé
2025-06-22  1:58   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 31/48] accel/dummy: Convert to AccelOpsClass::cpu_thread_routine Philippe Mathieu-Daudé
2025-06-22  1:59   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 32/48] accel/tcg: " Philippe Mathieu-Daudé
2025-06-22  2:03   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 33/48] accel/hvf: " Philippe Mathieu-Daudé
2025-06-22  2:04   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 34/48] accel/kvm: " Philippe Mathieu-Daudé
2025-06-22  2:05   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 35/48] accel/nvmm: " Philippe Mathieu-Daudé
2025-06-22  2:05   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 36/48] accel/whpx: " Philippe Mathieu-Daudé
2025-06-22  2:05   ` Richard Henderson
2025-06-22  2:10   ` Richard Henderson
2025-06-23 12:31     ` Philippe Mathieu-Daudé
2025-06-20 17:13 ` [RFC PATCH v2 37/48] accel/nvmm: Expose nvmm_enabled() to common code Philippe Mathieu-Daudé
2025-06-22  2:06   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 38/48] accel/whpx: Expose whpx_enabled() " Philippe Mathieu-Daudé
2025-06-22  2:07   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 39/48] accel/system: Introduce hwaccel_enabled() helper Philippe Mathieu-Daudé
2025-06-22  2:08   ` Richard Henderson
2025-06-20 17:13 ` [RFC PATCH v2 40/48] accel: Factor accel_cpu_realize() out Philippe Mathieu-Daudé
2025-06-22  2:14   ` Richard Henderson
2025-06-23 14:16     ` Philippe Mathieu-Daudé
2025-06-20 17:13 ` [RFC PATCH v2 41/48] accel/tcg: Factor tcg_vcpu_init() out for re-use 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).